Researchers use internal attribution graphs for mechanistic interpretability analysis of LLM jailbreaksMechanistic Interpretability of LLM Jailbreaks via Internal Attribution Graphs
On 30 pairs of prompts with Llama-2-7B-chat, path rerouting correlates with jailbreak success (r=0.461), and node ablation mitigates 0/4.
- Aligned models can still be jailbroken to rewrite outputs, but adversarial training, prompt filtering, and single-input attribution do not explain how internal computation changes. The authors aim to compare causal graphs of clean vs. attacked prompts to identify structures associated with failure.
- On Llama-2-7B-chat, build causal graphs with layer-wise transcoders, align clean and attack prompts by cosine similarity, and compute graph deviation, safety suppression, attack emergence, and path rerouting. Main analysis uses layers 0–5, 80 edges per node; zero-ablate top-3 emergent features on successful attacks.
- Among 30 pairs on Llama-2-7B-chat, 4 succeeded (13.3%). Only path rerouting correlated with success (r=0.461, p=0.010); the other three metrics had p=0.264, 0.503, 0.389. Ablation mitigation was 0/4. Rerouting was 0.000 for all 500 topic-decoupled samples.
- The authors write that evaluation is limited to Llama-2-7B-chat and single forward pass, and attribution graph construction is limited to layers 0–5 (A.4 also writes first ten layers). The 4 successes are called by the authors a limitation on statistical power; pathway-level defenses and arbitrary adversarial distributions are left for future work. The experiments also report 500 pairs of topic-decoupled prompts, and a rerun of the same 30 pairs on layers 0–15.
- Evaluated models
- Llama-2-7B-chat-hf
- Benchmarks
- 30 adversarial prompt pairs500 topic-decoupled prompt pairs
- Metrics
- attack success ratePearson rGraph DeviationSafety SuppressionAttack EmergencePath Rerouting
The researchers propose a mechanistic interpretability framework that uses paired internal computation graphs to diagnose LLM jailbreaks, representing prompt-specific reasoning as structured causal interactions between latent features. By constructing and aligning computation graphs of clean and attacked prompts, the authors find that adversarial attacks systematically alter internal reasoning, including suppressing safety-related components, emergence of attack-specific features, and rerouting of computational paths. Based on this representation, the framework decomposes computation into invariant, suppressed, and emergent structures, identifies recurring vulnerability motifs associated with failure modes, and performs causal interventions on nodes, paths, and subgraphs to assess their contribution to attack success. Experiments on multiple open-source LLMs and various adversarial and jailbreak benchmarks show that structural deviation in internal computation graphs is highly correlated with unsafe behavior, and intervening on identified vulnerability motifs improves model robustness.
Paper analysis
What problem does this paper attempt to solve?
Paired attribution graphs are used to diagnose how jailbreaks rewrite internal computation; node interventions in the main text did not mitigate.
How jailbreaks rewrite model internal computation, and which structures contribute to attack success, input-output analysis cannot answer.
- Context: The authors state LLMs are used for reasoning, programming, and scientific analysis, but remain vulnerable to adversarial prompts and jailbreaks inducing unsafe, unfaithful, or incorrect outputs; small input changes can bypass alignment. The authors believe this hinders safety-critical deployment.
- Existing shortcomings: Adversarial training, alignment tuning, prompt filtering, and retrieval augmentation mainly constrain inputs and outputs. The authors state they do not explain how malicious inputs change internal computation. Circuit and attribution work often targets clean inputs.
- Author hypothesis: Treating prompt-specific reasoning as a causal attribution graph over latent features, attacks suppress safety-related structures, elicit attack-specific features, and reroute computation to pathways that violate policy.
- This paper proposes: Paired internal computation graphs. Align clean and attack graphs, decompose into unchanged, suppressed, and emerged structures, identify vulnerability motifs, then intervene on nodes, paths, and subgraphs.
- Abstract vs. body: The abstract states experiments span multiple open-source LLMs and various adversarial/jailbreak benchmarks, and that motif-targeted interventions improve robustness. Jailbreak numbers come from 30 prompt pairs on Llama-2-7B-chat-hf; Table 2's node intervention mitigation is 0 (0%). The third bullet in the introduction and the conclusion state node-level interventions did not mitigate attacks.
What related research exists?
The authors position this paper among jailbreak defenses, circuit analysis, single-input attribution, and component-level causal interventions.
Section 2 of the paper discusses four groups. Critiques only record shortcomings explicitly stated by the authors.
Jailbreaks and Input-Output Defenses
- Szegedy et al. (2013), Goodfellow et al. (2014), Madry et al. (2018), Carlini and Wagner (2017) discuss adversarial examples in deep networks. Zou et al. (2023), Qi et al. (2024), and AutoDAN (Zhu et al., 2024) discuss prompt attacks that bypass alignment.
- Defenses named in the paper are adversarial training (Madry et al., 2018), alignment tuning (Ouyang et al., 2022), and prompt filtering. The authors state these stop at the input-output level and do not model internal computation under attack.
Circuits and Sparse Features
- Transformer circuits by Olah et al. (2020), Elhage et al. (2021), induction heads by Olsson et al. (2022), and sparse autoencoders by Huben et al. (2024) are used to reverse-engineer internal mechanisms.
- The authors state these works are typically applied to clean inputs and do not analyze how computation changes under adversarial or jailbreak conditions.
Attribution Graphs
- Saliency maps (Simonyan et al., 2013), Integrated Gradients (Sundararajan et al., 2017), SHAP (Lundberg and Lee, 2017), LIME (Ribeiro et al., 2016) explain single predictions.
- Attribution patching by Nanda (2023), causal abstraction by Geiger et al. (2025), and automatic circuit discovery by Conmy et al. (2023) extend to internal components or graphs. The authors state attribution graphs remain descriptive, limited to single inputs, cannot compare across inputs, and do not distinguish deviation types.
Causal Interventions and Experimental Baselines
- Causal mediation by Vig et al. (2020), activation patching by Meng et al. (2022), and causal abstraction are used to find components causally relevant to predictions. The authors state they mostly stop at single components, do not extend to graph level, and do not model changes in causal structure under attack.
- Baseline is gradient attribution (citing Integrated Gradients), compared with transcoders on 10 prompt pairs (Table 4). Data are 30 self-built pairs, strategies from Wei et al. (2023) and Zou et al. (2023); appendix has 500 topic-decoupled prompts. Discussion also contrasts with the indirect object circuit by Wang et al. (2022) and input-space detection by Carlini and Wagner (2017) and Jain et al. (2023).
The authors place the distinction on comparing clean vs. attack graphs, rather than only explaining clean computation.
How does the paper address this problem?
Use transcoders to build paired causal graphs, and test attack-related structures with path rerouting and node zero ablation.
The overall idea is to write the model's reasoning at a given output position as a causal computation graph, then compare clean input with attacked input. Experiments build graphs using layer-wise transcoder features; the conclusion also calls it a sparse autoencoder-based attribution graph.
Nodes, Edges, and Implementation
- Node space: Equation (2) includes embeddings, attention outputs, feedforward features, residual stream, logits, and reconstruction errors. Error nodes capture nonlinear residuals not representable in the transcoder basis.
- Edges: An edge exists if the pre-activation's partial derivative with respect to the upstream activation is nonzero; weights approximate the derivative times the activation. Each node retains top-k incoming edges, with k=80 in experiments.
- Implementation: On Llama-2-7B-chat-hf MLP outputs, layer-wise transcoders are trained following Huben et al., with 4096 features per layer, serving as feedforward nodes; reconstruction errors serve as error nodes. The authors state other types are implicitly covered by error correction. Section 4.1 reports the approximation's average KL as 0.0027 and top-1 accuracy 99.2%. Main analysis uses layers 0–5. Appendix E.2 states edges only connect adjacent layers at the same token position.
The graph is written as Gt(x)=(Vt(x), Et(x), Wt(x)), i.e., nodes, directed influences, and edge weights at that position.
Alignment and Four Metrics
- Alignment: Matching uses activation cosine similarity; matches below 0.5 are discarded, and corresponding nodes enter suppression or emergence.
- Three-way classification: unchanged, suppressed (clean activation much larger than attack side), emerged (attack side much larger than clean side). Local deviation is additionally defined as the sum of activation differences and the Frobenius difference of edge weight matrices.
- Experimental counts: Equation numbering in Section 4.2 does not fully correspond to Section 3; actual thresholds are as follows. Activation threshold τ=0.005. Suppression requires clean activation above τ and attack side below half of it; emergence requires attack side above τ and no match in the clean graph. Graph deviation is 1 minus twice the proportion of matched nodes to the sum of node counts in both graphs. Path rerouting first takes the top 20 paths by weight in the clean graph, then averages relative changes in multiplicative weights, with ε=10^-10.
Motifs and Interventions
- Three motif types: safety suppression, attack emergence, computation rerouting (same-endpoint paths diverging on both sides). Findings are written as weighted maximization of structural deviation and activation deviation; the paper does not give the α, β used in experiments. Experiments use NetworkX subgraph isomorphism with a window of 3 nodes.
- Contribution definition: Proposed operations include node suppression, activation restoration, edge masking, and subgraph replacement.
C(Ω;x,x̃)=L(f(x̃),y∗)−L(fI(x̃),y∗), i.e., how much loss relative to expected behavior decreases after modifying structure Ω.
- Interventions in experiments: Only zero ablations are performed. Top-3 emerged features by emergence magnitude are taken, activations set to 0, and contribution is the difference in indicator functions of whether refusal language appears (Equation 25). The paper does not list refusal phrases.
Prompt Pairs
Clean prompts are benign requests the model should answer. Attack prompts use four strategies from the literature: prefix injection, role-playing, context switching, developer mode, and are wrapped in the Llama-2-chat template. Success is recorded by whether safety mechanisms are bypassed; the paper does not specify the automatic evaluation model. In cases, outputs starting with a responsibility disclaimer but then providing technical content are counted as successful.
What experiments did the paper conduct?
Among 30 pairs, only path rerouting correlated with jailbreak success (r=0.461); 4 node ablations did not mitigate.
Experimental Setup
- Model under test: Main analysis uses Llama-2-7B-chat-hf (with RLHF). Attribution graphs use layer-wise transcoders for layers 0–5. The checklist states that both Llama-2-7B and the chat version are used for analysis, but jailbreak metrics are reported only for the chat version. Pythia-6.9B appears only in the reconstruction comparison in Appendix D.
- Data: Self-constructed 30 pairs. Strategies come from Wei et al. (2023) and Zou et al. (2023), categorized as prefix injection, role-playing, context switching, and developer mode. Appendix B.4 has an additional 500 pairs of topic-unrelated prompts. The paper does not call this the full set of any public benchmark.
- Metrics and criteria: Whether the attack bypasses safety mechanisms; four structural metrics with Pearson r and 95% bootstrap intervals. Suppression also reports Spearman. Interventions check whether the output contains refusal language. The paper does not specify an external review model nor report human agreement. A footnote states the generation window is 10 tokens.
- Controls and scale: Gradient attribution on 10 pairs (Table 4); error node ablation N=10 (Table 3). Main correlation N=30. The paper does not report number of repetitions. The 500 pairs took 22.8 minutes. Hardware is dual 12-core SkyLake, 2 Tesla V100 32GB, 128GB RAM (Appendix C).
Main Results
Correlations, intervals, and p are from Table 1; means, standard deviations, and medians from Table 2. All are Llama-2-7B-chat, N=30.
Swipe horizontally to read the table
Metric Pearson r 95% CI p Mean±SD Median Graph Deviation 0.210 [+0.010, +0.483] 0.264 0.372±0.289 0.333 Safety Suppression -0.127 [-0.227, -0.003] 0.503 2.77±7.76 0.000 Attack Emergence 0.163 [-0.070, +0.605] 0.389 3.23±4.85 1.000 Path Rerouting 0.461 [+0.189, +0.722] 0.010 0.641±0.457 0.575 - Outcome: 4 successes (13.3%), 26 failures (86.7%). Mitigation on the 4 successful attacks is 0 (0%) (Table 2).
- Authors' interpretation: The authors believe successful jailbreaks change information pathways rather than simply suppressing safety features or activating attack features; they also state the wide intervals come from N=30. Safety suppression is zero in 23/30, Spearman ρ=-0.015, p=0.936.
- Table titles and intervals in tables: Table 1's title states that only path rerouting's interval does not contain 0. According to the printed numbers in the table, Graph Deviation and Safety Suppression intervals also do not contain 0; only Attack Emergence contains 0. p-values follow the table. Figure 1's caption states that the three static metrics have no significant relationship with success; Figure 2's caption states that successful points fall in higher rerouting magnitudes. Scatter positions cannot be verified from plain text.
Attack Types and Cases
From Table 5. In the table, “–” indicates zero successes in that group and the paper did not compute a correlation.
Swipe horizontally to read the table
Attack Type N Successes Success Rate r Context Switching 10 3 30% +0.865 Other 4 1 25% +0.852 Prefix Injection 4 0 0% – Persona (DAN/AIM) 3 0 0% – Mode Framing 4 0 0% – Hypothetical Framing 4 0 0% – - Breakdown: Direct templates have 0 successes in this sample. Context switching p=0.001; Other p=0.148. Dual persona N=1, 0 successes. The authors believe the overall correlation is mainly driven by semantic bridging.
- 11 bridging subset: Successful examples have rerouting of 1.49, 1.20, 1.14, 0.88; failed examples have highest 0.67, lowest 0.12 (Table 6). The authors state that a threshold of 0.8 fully separates this subset, and they note N=11 is small and requires replication.
- Cases: Pair 21 has 12 emergent features, rerouting 1.49; the main text writes 123 new fork motifs, Appendix A.1 writes fork from 0 to 112. Pair 5: emergence 0, rerouting 0.46. Pair 28: emergence 3, rerouting 1.14, fork from 2 to 6. The authors state that directly overriding instructions barely changes the graph, while indirect context switching causes rerouting.
Extended Sample, Layer Depth, and Interventions
- 500 pairs: Success rate 8.4% (42/500). Table 7: graph deviation 0.866–0.983 (mean 0.964); safety suppression mean 713.6; attack emergence mean 58.7; path rerouting min, max, and mean all 0.000. The authors state that when topics are not shared, there is almost no alignable path, and the metrics return 0 by definition, not a null result about mechanisms.
- Layers 0–15: On the same 30 pairs, path rerouting correlation drops to r=+0.213, p=0.258 (Table 11). The authors attribute this to poorer reconstruction in middle layers. The correlation of this metric between the two depths is -0.059.
- Interventions: On the 4 successful attacks, zero-ablation of top-3 by emergence magnitude gives contributions of 0 each, mitigation 0%. The authors state the effect is distributed across many features, and selective ablation is compensated by redundancy; path-level and subgraph-level interventions have no results. Appendix A.2 states emergent features mean 3.2, max 20, top-3 about 15% of total emergent activation (proportion given by the authors).
Other Ablations and Analyses
- Error nodes (Table 3, N=10): with error nodes, mean KL 0.0014 (SD 0.0009); without, 46.96 (18.32); table shows improvement 99.997%. The KL 0.0027 in Section 4.1 is under different conditions.
- Gradient control (Table 4, 10 pairs): mean deviation 3.995 (SD 1.834), transcoder 0.217 (0.073). Table title states 18×.
- Successful attacks have average fork motif increase of 67.5, chain motif decrease (quantity not given). The authors state successful attacks cluster in high-fork regions and cite Figures 1 and 2; these captions respectively mention static metrics and path rerouting, without fork values.
- Appendix D.2 states FVE>98% for all layers; in Table 9, Llama layer 3 FVE is 0.212, layer 5 is 0.440. Follow the table. Table note states that except for layer 3, the main analysis has minor issues.
- Appendix B.6 failed example: node 29→14, edge 80→19. Appendix G: node 90→33 (-63.3%), edge count still 80, mean edge weight 3.425→17.922, graph similarity 10.81%, both prompts predict the same token.
- Figure 5 caption: PCA of layers 5, 10, 15, N=150 per class; caption states successful jailbreaks transition from harmless side to harmful request region with depth. Scatter positions cannot be verified from plain text.
What are some points that can be further explored?
The authors state in Appendix A.4 limitations such as single model, layer coverage, single forward pass, and number of successful samples.
Limitations and Future Directions Noted by the Authors
- Single model: Evaluation is limited to Llama-2-7B-chat; whether it generalizes to other safety paradigms like Constitutional AI, GPT, Gemini, the authors call an open question (Appendix A.4).
- Layer coverage: A.4 states the attribution graph only covers the first ten transformer layers, and the same paragraph states construction is still limited to layers 0–5; it also says PCA shows safety-related computation extends to later layers. The authors state the full-layer transcoder in Appendix D only partially addresses this gap (A.4).
- Single forward pass: The framework does not cover attacks in multi-turn dialogues that rely on iterative context manipulation (A.4).
- Interventions: Zero ablations 0/4 are used by the authors to argue that feature-level control is insufficient for distributed representations; activation steering and circuit patching are more promising but costly at scale (A.4). The conclusion suggests pathway-level defenses for future work. Appendix A.2 suggests counterfactual feature selection and states computational cost may be prohibitive.
- Sample size: Only 4 successes out of 30 pairs, limiting statistical power; the authors suggest validation on larger, more diverse adversarial benchmarks (A.4).
- Distribution: Appendix B.4 states extending the framework to arbitrary adversarial distributions, e.g., not relying on paired benign anchors, is left for future work.
Experimental Coverage
- Jailbreak numbers: Reports 30 self-built prompt pairs on Llama-2-7B-chat-hf (4 successes) and 500 pairs in Appendix B.4 (42 successes). Strategy breakdown is in Table 5.
- Model scope: The abstract mentions multiple open-source LLMs. Appendix D's Pythia-6.9B only reports 32-layer transcoder reconstruction, not jailbreak results. The checklist states Llama-2-7B is also used for analysis, but the paper does not give its separate jailbreak metrics.
- Interventions and protocols: Only top-3 zero ablations on 4 successful attacks are reported; the paper does not report results for path-level or subgraph-level interventions (Section 4.6). The paper does not report external evaluation models, agreement with human judgment, or repetitions of the main correlation.
- Layer depth: Main analysis is layers 0–5. Appendix H builds attribution graphs to layers 0–15 on the same 30 pairs. Gradient comparison is on 10 pairs (Table 4), error node ablation is N=10 (Table 3).
- Bridge subset: Appendix B.3 compares rerouting on 11 semantic bridge prompts; the authors note this subset is small. In B.4, path rerouting is 0.000 for all due to lack of shared paths.
Summarize the main content of the paper
On Llama-2-7B-chat, path rerouting correlated with jailbreak success, node ablations were 0/4.
This work uses paired internal attribution graphs to diagnose jailbreaks in Llama-2-7B-chat, rather than providing a defense that has been experimentally shown to mitigate successfully.
- Problem: The authors believe adversarial training, alignment tuning, and prompt filtering stop at inputs and outputs, and cannot explain how attacks rewrite internal reasoning.
- Approach: Use layer-wise transcoders to draw prompt reasoning as causal graphs, align clean and attack graphs by cosine similarity, then compute graph deviation, safety suppression, attack emergence, and path rerouting. Perform zero ablations on top-3 emerged features of successful samples. Main analysis is on layers 0–5.
- Main numbers: 4 successes out of 30 pairs (13.3%, Table 2). Path rerouting vs. success Pearson r=0.461 (p=0.010, Table 1). For context switching, the correlation across 10 pairs is r=0.865 (p=0.001, Table 5). Mitigation from 4 ablations is 0% (Table 2).
- Exceptions: Graph deviation, safety suppression, and attack emergence have p-values 0.264, 0.503, 0.389 respectively (Table 1). Path rerouting is 0.000 for all 500 topic-decoupled prompts (Appendix B.4). On layers 0–15, the correlation is r=0.213, p=0.258 (Table 11).
- Author conclusions: Successful jailbreaks more resemble rerouting computation to alternative pathways than turning off safety features; node ablation is insufficient for distributed representations. Future work should pursue pathway-level defenses. The abstract states interventions improve robustness, inconsistent with Table 2's 0% mitigation.