Skip to content

The study uses causal activation patching to locate the decision layers where models comply with prompt injection instructions.Where Do LLMs Decide to Break the Rules? Mechanistic Localization of Prompt Injection Compliance

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2609.37737· Rui Wen, Jiayang Liu, Zeyu Yang, Jun Sakuma, Lu Sun·Indexed by this site · 2026-09-30· Originally publishedAttacks

Quick read

Interpretability

Based on the paper PDF (AI-generated); refer to the original

Performing layer-by-layer activation patching on 5 models of 4B–32B, we found that the causal lever for prompt-injection compliance is concentrated in the last 1/3 of layers; patching this bottleneck can flip 77–92% of compliance into resistance.

Questions
When a prompt injection succeeds, the model abandons its system role to execute the adversarial instruction. Existing work mostly counts success rates or defends at the input and output layers, but does not know at which layer inside the network the compliance decision is made.
Methods
On compliant forward passes, at the last prompt token of each layer, causal activation patching is applied using the average hidden state from resistant samples, and the flip rate is recorded. Rank-k PCA, sub-layer decomposition, and layer-by-layer linear detection then verify whether this bottleneck is low-rank and whether it is the optimal location for detection.
Experiments and results
Attack presence can be linearly decoded from layer 1, but causal leverage appears only in the final third of the network. Qwen3-4B reaches a flip rate of 0.917 at L24; detection at that layer has AUROC 0.993, 100% recall on leetspeak, while L1 has only 13.3%. On natural corpora the flip rate drops to about 12%.
Limitations and future work
The authors state that the detailed analysis focuses on Qwen3-4B, and the peak layer must be calibrated per model; the main stimuli are mostly synthetic, single-turn, and in English. Single-token patching is markedly weaker in reasoning, MoE, and agentic settings, and threats such as tool misuse may involve multi-step mechanisms.
Experimental setupQwen3-4B、Qwen3-14B et al. · AcmeCorp role-conflict (300 queries)、deepset/prompt-injections et al. · causal flip rate、probe accuracy et al.
Threat model
An attacker can insert instructions into the context to make the model abandon its system role and execute an adversarial instruction (direct, covert, or indirect injection). This paper analyzes where in the model the compliance decision arises internally, rather than proposing a new attack.
Evaluated models
Qwen3-4BQwen3-14BQwen3-32BPhi-3-miniMistral-7B-Instruct-v0.3Qwen3-4B-BaseQwen3-30B-A3B
Benchmarks
AcmeCorp role-conflict (300 queries)deepset/prompt-injectionsneuralchemy/Prompt-injection-datasetmicrosoft/BIPIALakera/gandalf ignore instructionsindirect injection corpus (600)hard-negative set (100)
Metrics
causal flip rateprobe accuracyAUROCLeet. recallrecall @ 5% FPRP(resist)compliance logit gapASR
AI summaryThe researchers performed layer-by-layer causal activation patching on five models ranging from 4B to 32B and found that attack information can be linearly decoded from the first layer onward, but only a late-layer bottleneck in the final third of the network has a significant causal effect on behavior. The authors report that patching this bottleneck can reverse the model's compliance with attack instructions in the tested cases; the relevant mechanism lies in a compact linear subspace, and different model families exhibit similar structures. This is a mechanistic study within the tested models and experimental settings, not a general defense guarantee for arbitrary models.

The researchers performed layer-by-layer causal activation patching on five models ranging from 4B to 32B and found that attack information can be linearly decoded from the first layer onward, but only a late-layer bottleneck in the final third of the network has a significant causal effect on behavior. The authors report that patching this bottleneck can reverse the model's compliance with attack instructions in the tested cases; the relevant mechanism lies in a compact linear subspace, and different model families exhibit similar structures. This is a mechanistic study within the tested models and experimental settings, not a general defense guarantee for arbitrary models.

Related events and news

1 events · 0 news mentions

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Prompt-injection attack information is readable early, but where the model decides to comply has lacked causal localization.

    When a prompt injection succeeds, at which layer of the network does the model decide to abandon its system role and instead follow the adversarial instruction.

    • Scenario: The authors note that there is no hard security boundary between developer instructions and user input; an attacker who controls any part of the context can overwrite the system prompt with new instructions (Perez & Ribeiro, 2022). When the model acts as an autonomous agent with access to tools, databases, and external APIs, injections in retrieved documents, emails, or tool outputs can redirect behavior into the real world (Greshake et al., 2023; Zhan et al., 2024).
    • Existing gaps: The authors state that prior work has extensively quantified how often attacks succeed (Liu et al., 2024; Yi et al., 2025; Debenedetti et al., 2024), and defenses range from input filtering to system prompt hardening, but all treat the model as a black box and do not explain why compliance occurs. Without knowing where in the network the decision happens, defenses remain heuristic.
    • Core observation: The authors state that attack information can be linearly decoded from the first layer, but the causal lever on behavior only appears at a late-layer bottleneck in the latter third of the network. The authors use this separation between representation and execution as the basis for detection and intervention.
    • What this paper does: Using layer-by-layer causal activation patching, it localizes compliance decisions on 5 models ranging from 4B to 32B, characterizes their low-rank linear subspaces, and tests whether the causal peak layer is also the optimal location for detection.
    • Threat model:
      • Goal: Make the model abandon its specified system role and instead obey an adversarial instruction (direct attacks, covert attacks in narratives or roleplay, and indirect injections in retrieved content).
      • Knowledge: This paper's intervention analysis reads and replaces model hidden states, which is a causal intervention on internal activations; the paper also includes white-box GCG for detectors.
      • Capability: The attacker can insert instructions into the context window, including direct or covert instructions in user turns, as well as indirect payloads in simulated retrieval blocks.
      • Victim system: Instruction-tuned LLMs given a fixed system role (primary setting is AcmeCorp customer service); the appendix additionally tests an agentic multi-step scenario, where the authors state that single-token patching becomes weaker.
  2. What related research exists?

    Related work is divided into prompt-injection attack and defense, and causal intervention and representation engineering; this paper first measures causal leverage, then tests whether it predicts the best detection layer.

    Prompt-injection attack and defense

    • Direct and indirect injection — Perez & Ribeiro (2022) systematically study adversarial instructions in user input that make the model deviate from established behavior; Greshake et al. (2023) extend the threat to malicious instructions in retrieved documents, web pages, or tool outputs, hijacking behavior without direct user interaction.
    • Benchmarks — Liu et al. (2024), Zhan et al. (2024), and Yi et al. (2025) evaluate these vulnerabilities across multiple models and scenarios; AgentDojo by Debenedetti et al. (2024) covers agentic settings where injection can trigger unauthorized tool calls.
    • Input- and output-layer defenses — StruQ by Chen et al. (2025) uses structured queries to separate instructions from data; Hines et al. (2024) apply source marking (spotlighting) to untrusted inputs; Wallace et al. (2024) use instruction-hierarchy training to make models prioritize high-privilege instructions; DataSentinel by Liu et al. (2025) is a detection-based guardrail. The authors state these methods mainly mitigate injection at the input and output layers, measuring or reducing whether attacks succeed, but do not identify which internal computations have causal control over compliance.

    Causal intervention, representation engineering, and safety internals

    • Causal localization — Meng et al. (2022) use causal tracing to localize factual associations; Goldowsky-Dill et al. (2023) propose path patching; Geiger et al. (2025) give a formal framework for causal abstraction.
    • Representation engineering — Zou et al. (2023), Rimsky et al. (2024), and Turner et al. (2024) change model behavior by manipulating directions in activation space.
    • Safety internals — Arditi et al. (2024) find a low-dimensional refusal direction; Li et al. (2025) and Zhao et al. (2025) localize safety-critical layers and neurons; Zhou et al. (2024) and Ball et al. (2026) study jailbreak-related hidden-state dynamics; Heo et al. (2025) show that instruction-following success can be predicted from intermediate representations. Recent work by Wen et al. (2025) defends against indirect prompt injection with instruction detection and states that detection signals at intermediate layers can be stronger than at the last layer.

    Baseline methods and benchmarks

    • Causal and detection baselines: resistance-mean activation patching is compared against benign-mean, compliant-mean, and norm-matched random noise; detection is compared against ProtectAI/deberta-v3-base-prompt-injection and a white-box GCG targeting the L24 score. Public benchmarks include deepset/prompt-injections, neuralchemy/Prompt-injection-dataset, microsoft/BIPIA, and Lakera/gandalf ignore instructions.

    The authors position this paper as a complementary question: rather than selecting layers solely by detection performance, they first measure causal leverage with layer-by-layer activation intervention, then test whether that localization predicts the best detection layer, and further characterize the late-layer mechanism as a compact subspace.

  3. How does the paper address this problem?

    Using resistance-sample mean hidden states for activation patching across layers of compliant forward passes, locating the late-layer causal bottleneck via flip rate.

    Overall approach uses causal activation patching: when the model complies with the injection, at layer ℓ the forward pass is intercepted and the hidden state is replaced with the average state from a resistant run; if the model then refuses, that layer has causal leverage over compliance. Scanning layer by layer yields a causal map.

    Problem setup and annotation

    • Models and stimuli: Five instruction-tuned models, 4B to 32B: three from the Qwen family (Yang et al., 2025), Phi-3-mini, and Mistral-7B-Instruct-v0.3, with Qwen3-4B as the primary testbed. The system role is AcmeCorp customer service (the original prompt is given in Appendix A, with MedBot, CodeReviewer, and LegalAdvisor also used). 300 test queries include direct attacks, covert attacks embedded in narratives, or benign controls.
    • Annotation: Strict keyword matching classifies outputs as compliant (breaks character and executes the attack) or resistant (refuses). Labels are independently validated by cross-model LLM review; the paper does not state the reviewer model name.
    • Intervention location: For each compliant run and each layer ℓ, the intervention is applied at the last prompt token.

    Causal activation patching

    Three steps:

    1. Isolate the "antidote": compute the average internal representation μ_res^(ℓ) from successful resistance.
    2. Overwrite the state: in the ongoing compliant forward pass, replace the hidden state at layer ℓ with that resistance average.
    3. Measure the flip: continue generation; the flip rate is the proportion of trials in which the intervention makes the model abandon compliance and switch to resistance.

    If an intervention at a layer stably flips the output, the authors treat that layer as having direct causal leverage over the compliance decision.

    Controls and mechanism isolation

    • Four-condition control: injecting a benign state, a compliant state, or norm-matched random noise at the causal peak layer has a smaller effect than the resistance intervention. The authors therefore claim the effect is specific to the resistance geometry, not to perturbation magnitude.
    • Rank-k PCA patching: project the per-stimulus displacement μ_res − h_comp,i onto the top k principal components of the compliance/resistance state matrix and add back only that projection. Qwen3-4B has hidden dimension 2560. Appendix B also has a class-mean protocol: project μ_res − μ_comp onto a PCA basis fitted on resistance states, then replace the state with μ_comp plus that projection; the authors state the two protocols' numbers are not directly comparable.
    • Sub-layer decomposition: on seven layers, three patching variants are compared: replacing the full residual-stream output, replacing only the attention sub-layer output, or replacing only the MLP sub-layer output, to determine whether the signal is produced within the layer or carried by the residual stream entering that layer.
    • Causal window: the exact peak layer shifts by a few layers with the prompt template. A more stable summary is the contiguous scanned-layer band whose flip rate reaches at least 75% of the peak, described by starting depth, width (number of sampled layers in the window), and centroid (flip-rate-weighted average layer within the window; depth = centroid / total layers).

    Detection as mechanism validation

    • Classifier: a LinearSVC is trained on hidden states at each layer. For faster optimization and stable regularization, the 2560 dimensions are first reduced to 128 principal components (retaining about 90% variance), then evaluated on 100 benign hard negatives deliberately containing injection-adjacent vocabulary.
    • Obfuscation: the authors test five obfuscation strategies, including leetspeak, zero-width spaces, synonym substitution, noise insertion, and base64. The paper does not expand the specific substitution tables as a method step.
    • External control: comparison with ProtectAI/deberta-v3-base-prompt-injection; additionally, a universal GCG suffix minimizes the L24 detection score while maintaining compliance, and recall at a 5% FPR threshold is reported. The authors treat the causal-peak detector as mechanistic corroboration and a lightweight complementary signal, not as a standalone defense.

    Success criteria and evaluation metrics

    • Behavioral flip: keyword judgment changes from compliant to resistant; when the same prompt is sampled repeatedly, P(resist) is also reported.
    • Logit lens: the compliance logit difference is log P(Sure) − log P(Sorry), observed on the compliant pool and the resistant pool separately to see when commitment forms.
    • Detection: AUROC, and recall on obfuscated inputs; in the adaptive setting, recall at 5% FPR.
    • Logit difference and probes: logistic-regression probes for attack presence; 5-fold AUROC with a linear SVM for base-vs-instruct comparison.
  4. What experiments did the paper conduct?

    On Qwen3-4B, L24 flip rate 0.917, detection AUROC 0.993; natural corpus peak drops to about 12%, indirect injection own centroid no better than random.

    Experimental Setup

    • Models tested: Qwen3-4B (36 layers, primary testbed), Qwen3-14B (40 layers), Qwen3-32B (64 layers), Phi-3-mini (32 layers), Mistral-7B-Instruct-v0.3 (32 layers). The appendix also includes Qwen3-4B-Base and Qwen3-30B-A3B (48 layers, ~3B activated parameters per token).
    • Data: AcmeCorp role-conflict 300 queries. Indirect injection 600 (300 topics × 2 prefixes), natural compliance rate 25.0% (150/600); 60 pilot corpus compliance 73% (44/60). Multi-turn 360 two-turn stimuli. Public sets: deepset/prompt-injections and neuralchemy/Prompt-injection-dataset, each partially taken, totaling 300 injections; microsoft/BIPIA (attack payloads extracted and placed in user turn, authors state this tests BIPIA attack content, not its indirect threat model); Lakera/gandalf ignore instructions. Detection hard-negative 100.
    • Baseline interventions: resistance mean compared to benign mean, compliance mean, norm-matched random noise; PCA compared to random rank-8 subspace. Detection compared to text classifier ProtectAI/deberta-v3-base-prompt-injection.
    • Metrics: causal flip rate; attack presence probe accuracy; P(resist); compliance logit difference; AUROC and leetspeak recall; recall at 5% FPR; ASR. Causal window defined as contiguous scanned layers where original flip rate ≥ 75% of peak.
    • Sample sizes: Figure 2B at L24 Nc=84; Figure 3B gives Qwen3-4B Nc=84 (mean-patch), Qwen3-14B Nc=83, Qwen3-32B Nc=182, Phi-3-mini Nc=258 (dir-only), Mistral-7B Nc=75 (structural). Temperature experiments Nc=86/87/95. Multi-turn Nc=62. Natural corpus test end Nc=90, calibration resistance Nr=55. The paper does not report the number of random repetitions for the main scans.
    • Review: outputs checked with strict keyword matching and cross-model LLM review; the paper does not specify the review model. Detectors are per-layer LinearSVC, hidden states first reduced to 128 principal components.

    Main Results

    On Qwen3-4B, the attack presence probe achieves accuracy ≥80% at every layer; causal flipping is negligible before L19, rises sharply from L19, maintains 80–90% in late layers, peaking at L24 (Figure 2A). Across architectures, the authors state no model shows meaningful causal leverage before 44% of total depth, with peak depth falling between 63% and 91% (Figure 3B).

    Table 1 peak flip rates and windows (depth = layer/total layers):

    Swipe horizontally to read the table

    ModelCorpusPeak layerPeak flipWindow startWidth
    Qwen3-4BHeadlineL24 (67%)0.917L24 (67%)6
    Qwen3-4BMulti-turnL24 (67%)0.871L20 (56%)4
    Qwen3-14BAcmeCorpL28 (70%)0.855L24 (60%)5
    Phi-3-miniAcmeCorp (additive)L20 (63%)0.771L20 (63%)4

    Table 1 does not list window rows for Qwen3-32B and Mistral-7B. Figure 3B caption gives scan settings for both (32B mean-patch, Nc=182; Mistral structural, Nc=75), but the main text does not give peak flip rates alignable with Table 1.

    • Authors' interpretation: L24 is a late-layer causal leverage point, not the location where the compliance decision is first computed. In the logit lens (Figure 3A), L23 strengthens resistance, L25 completes the compliance commitment, and L24 sits between them. Sub-layer decomposition (Table 6) shows at L24 attention and MLP each alone give 21.4%, neither recovering the full-patch 90.5%, with the signal coming from the residual stream entering that layer.
    • Same-prompt control: for prompts that under repeated sampling show both compliance and resistance, replacing the prompt final state at L24 with the resistance centroid raises P(resist) from 0.57 to 0.93; content-matched resistance donor raises to 0.87; compliance centroid nearly unchanged (0.54); norm-matched random intervention drops to 0.15. Up to L16, no donor changes P(resist) by more than 0.09. On L28–L32 the compliance centroid also begins to induce resistance, so the authors treat L24 as the clearest class-specific leverage point.
    • Figure 2B: in the four-condition control at L24, the authors annotate the gap between resistance and random, and mark +61% class-specific magnitude and bar values such as 31%, 31%, 23%; the caption states the resistance–random gap confirms a class-specific effect. The main text does not map these bars one-to-one to specific donor names, so 31% etc. are not rewritten as flip rates for a particular donor.

    Low-Rank Subspaces and Covert Attacks

    • Rank k (Table 5, per-stimulus protocol): Qwen3-4B at L24, k=8 flip rate 81.0%, k=16 89.3%, full patch 90.5%. Qwen3-14B at L28, k=8 80.2%, full patch 87.7%. Qwen3-32B at L58, k=8 72.5%, k=64 80.8%, full patch 81.3%. The authors state that normalized by their respective full patches, k=8 recovers 90% for 4B, 91% for 14B, 89% for 32B; the first principal component of 32B captures 90% of the mean shift. Under the class-mean protocol, learned PCA rank 8 gives 85.7%, energy-matched random rank 8 gives 38.1%. The authors state that after splitting resistance samples in half, intervention effects from the two side subspaces are similar.
    • Covert attacks (Figure 4): at every layer, the ℓ2 centroid distance from covert state to direct attack state is greater than the distance between direct compliance and direct resistance; at L1 this distance is roughly eight to nine times larger. A linear probe separates covert and direct attacks at every layer, separability=1.000. Patching with the direct-attack resistance mean at L30 gives flip rate 96.5% (Nc=57); benign mean 42.1%, covert compliance mean 0.0%, norm-matched random 0.0%. The authors state this is a 54-percentage-point advantage over the benign baseline, and calibration had not seen these attack types.
    • Sub-layers (Table 6, Qwen3-4B): L1 full patch 3.6%, L8 7.1%, L16 15.5% (MLP 9.5%), L24 90.5%, L28 89.3%, L32 85.7%, L36 88.1%. The main carrier at L28 is labeled MLP+residual, and L32 and L24 both as incoming residual stream.

    Generalization, Temperature, and Detection

    • Indirect injection: using the corpus's own resistance centroid, on the 600-corpus Nc=150, flip rate rises late, L36 0.433, same as norm-matched random (Table 7); L24 0.287. On the 60 pilot, transferring the clean direct-injection resistance/compliance contrast to the indirect compliance target (Nc=44), L24 flip rate 95.5%, while the pilot's own centroid on the same target is 6.8–15.9%. The authors emphasize the two corpora differ, so 95.5% and 43.3% are not directly comparable. Under clean donors (Nc=40, Table 8): full centroid 0.950, 2× scaled contrast direction 0.925, rank-8 pooled subspace 0.850, rank-8 of resistance states only 0.550; indirect own centroid L24 0.159, L36 0.068.
    • Natural corpus and templated benchmarks: benchmark-matched donor 19-layer scan (Table 10) shows a zero zone L1–L18 (flip rate ≤3.3%), L24 peak 12.2%, same-layer random 1.1%; cross-distribution AcmeCorp donor peak 18.9%. The authors state the absolute flip rate is about 1/7.5 of the synthetic setting (12.2% vs 91.7%), but the early–late separation shape remains. BIPIA and Gandalf both peak at L24: BIPIA 0.70 vs random 0.13, Gandalf 0.66 vs 0.32; the appendix states the class-specific gap is largest at L24 (BIPIA +0.57, Gandalf +0.34), dropping to about random level by L36.
    • Temperature, GCG, multi-turn, and detection: with sampling decoding T∈{0.3, 0.7, 1.3}, flip rates at L24 and L36 all exceed 89%, while L1 and L16 are markedly lower (Table 2; at T=1.3 L1 rises to 0.200, L24 0.905). A 20-token universal GCG suffix applied to the remaining 280 queries reduces compliance from 28% without suffix to 28/280 (10%); the authors explicitly do not treat this experiment as evidence of robustness against stronger GCG. On still-compliant GCG samples, L16 flip rate 0.321, L24 to L36 1.000 (Table 3). Multi-turn Nc=62, peak still at L24, 0.871, vs single-turn 0.917 (Table 9; L36 drops to 0.484). Detection (Table 4): L24 AUROC 0.993, leetspeak recall 100%; L1 0.888 and 13.3%; L36 0.892 and 100%. L24 achieves full recall on all five confusion strategies. Relative to the text classifier, on hard-negatives AUROC 0.993 vs 0.709. White-box GCG targeting L24 scores reduces 5% FPR recall from 1.00 to 0.48 (Table 13 1.000→0.475), while the text classifier only 0.625→0.600.

    Other Ablations and Analyses

    • Geometric distance: distance between injection and benign mean states increases from L1 to L35, decreasing at L36.
    • Base vs instruct (Table 12): on the same headline set, Qwen3-4B-Base and instruct both have attack decodability AUROC 1.00 at L1; compliance ASR drops from 0.65 to 0.28; L32 contrast direction norm rises from 72.5 to 126.0 (authors state 74% increase). This 1.00 is relative to ordinary benign queries, not the same evaluation as L1's 0.888 on hard-negatives in Section 7.
    • MoE: Qwen3-30B-A3B peak flip rate 0.06 (L21), same-layer random control 0.04. The authors make no strong claim about whether sparse MoE preserves the dense single-token bottleneck.
    • Reasoning and agents: the authors state that single-token causal leverage is weaker on reasoning models and Mixture-of-Experts; agent rollouts are not controlled by patching a single prompt-final token or commitment token (Appendices G, H). The paper does not give specific flip-rate numbers for reasoning models and agent settings in the visible main text.
    • Donor quality: the authors summarize that direct-injection donors transfer to pilot indirect targets at about 95% at L24, indirect corpus own centroids are no better than random; benchmark-matched donors on natural attacks are no better than cross-distribution AcmeCorp donors (12% vs 19%, Appendix F).
  5. What are some points that can be further explored?

    The authors believe the peak location is more stable than the intervention magnitude, but the single-token causal map cannot yet be turned directly into a generalizable defense.

    Limitations and Future Directions Noted by the Authors

    • Magnitude depends on donor and wording: flip rates reach 77–92% in the calibrated AcmeCorp setting, dropping to about 12% on diverse natural benchmarks; more templated BIPIA and Gandalf recover 66–70% in the same L24 region. In indirect injection, topic variation dilutes the global own centroid to random-vector level, while clean direct-injection donors recover 95% flip rate at the same late layer. The authors state intervention strength depends on whether the donor cleanly isolates the compliance contrast and on wording diversity, with causal location relatively more stable (Section 8).
    • Open questions: richer donor representations may improve transfer to natural inputs; strong detection signals and low-dimensional subspaces motivate lightweight monitoring and targeted activation steering. The single-token picture weakens in broader settings: agent rollouts are not controlled by patching a single prompt-final token or commitment token; single-token causal leverage is weaker in reasoning and MoE models. The Base vs instruct comparison suggests attack decodability emerges in pretraining, with instruction tuning suppressing compliance and sharpening late-layer geometry (Section 8, pointing to Appendices G, H, H.2).
    • Analysis focus and peak layers: detailed analysis is mainly on Qwen3-4B, although architecture evaluation extends to 32B. Peak layers vary between 63% and 91% of network depth, so calibration per model is necessary (Limitations).
    • Stimulus scope: main stimuli are mostly synthetic, single-turn, English (Limitations).
    • Model types: the strong single-token causal localization observed in dense, non-thinking models is markedly weaker in reasoning, MoE, and agent settings; compliance may be distributed across generated tokens or computational paths (Limitations).
    • Threat models and open challenges: broader threat models such as tool misuse or data exfiltration may involve different multi-step mechanisms (Limitations). In the conclusion, the authors state that converting this causal map into robust, generalizable defenses remains a core open challenge for protecting language models against adversarial inputs.

    Experimental Coverage

    • Models: main causal scans cover Qwen3-4B/14B/32B, Phi-3-mini, Mistral-7B-Instruct-v0.3; additionally compare Qwen3-4B-Base, and report on Qwen3-30B-A3B peak 0.06 vs random 0.04 (Figure 3B, Appendix H).
    • Attacks and formats: direct attacks, role-play and split payloads, 600 indirect injections and 60 pilot, multi-turn 360, sampling temperatures 0.3/0.7/1.3, 20-token GCG suffix, five surface confusions (Sections 5–7, Appendices D, E).
    • Public benchmarks: 19-layer scans on deepset/prompt-injections and neuralchemy/Prompt-injection-dataset, test end 90 compliant; BIPIA payloads placed in user turn, Gandalf used as released, authors state the BIPIA experiment does not test its indirect-injection threat model (Appendix F).
    • Detection: LinearSVC on Qwen3-4B at L1, L24, L36, hard-negative 100; compared to ProtectAI text classifier, and white-box GCG targeting L24 scores while maintaining compliance (Section 7, Appendix I, Table 13).
    • Not reported: the paper does not report the number of repetitions for the main scans, nor agreement values between keyword annotation and LLM review; specific flip rates for reasoning models and agent rollouts are referred to appendices in the main-text discussion, but no numbers aligned with the main tables are given.
  6. Summarize the main content of the paper

    Compliant causal levers concentrate in a low-rank subspace in the final third of the network, and this layer is also the best location for detection under confusion.

    This work uses layer-by-layer activation patching to locate where prompt-injection compliance occurs in the network, and uses that location for detection validation.

    • Problem: whether an attack is present can be read out linearly from layer 1, but when the model decides to follow instructions outside its system role lacks a causal answer. Input- and output-layer defenses therefore remain heuristic.
    • Method: at the last prompt token of a compliant forward pass, the layer activation is replaced with the average hidden state from resistant runs, and the flip rate is used to draw a causal map; rank-k PCA, sub-layer decomposition, and layer-by-layer linear classifiers then test whether this bottleneck is low-rank and whether it is also the best detection layer.
    • Main localization: across five dense models from 4B to 32B, causal leverage is negligible in the first 37–44% of depth, and the peak falls in the final third. Qwen3-4B on the Headline corpus has a flip rate of 0.917 at L24 (Table 1); patching this bottleneck turns 77–92% of compliance into resistance under the settings described in the abstract. Attention or MLP alone at L24 gives only 21.4%, while full patching gives 90.5%, and the signal lies in the residual stream entering that layer.
    • Mechanism and transfer: Qwen3-4B and 14B cross the 80% flip-rate threshold at k=8, while 32B needs k=64, yet its full-patching ceiling is only 81.3%. Covert attacks separate from direct attacks in early representations, yet are still flipped by the direct-attack resistance geometry at L30 with 96.5%. On natural corpora the peak is about 12.2%; for indirect injection the centroid itself is 0.433 at L36, the same as random; a clean direct donor transferred to a pilot indirect target reaches 95.5%.
    • Detection and authors' conclusion: on Qwen3-4B, L24 has AUROC 0.993, 100% recall on leetspeak, and L1 only 13.3%. The authors believe the causal peak encodes the compliance decision rather than surface form, but it is a lightweight complementary signal, not a standalone defense; turning this map into a generalizable defense remains an open problem. In reasoning, MoE, and agentic settings, single-token leverage is markedly weaker.

Related papers

Read originalarxiv.org