Amnesia: Adversarial Activation Steering on Specific Semantic Layers of Large Language ModelsAmnesia: Adversarial Semantic Layer Specific Activation Steering in Large Language Models
Amnesia increases Llama-2-7B-Chat's ASR on Forbidden Questions from 0.536 to 0.921.
White-box: the attacker has full access to the target model's internal parameters and residual stream, and can freely query, observe, and manipulate intermediate representations. The goal is to elicit harmful or incorrect outputs at inference time and to interpret intermediate layers. No training changes or retraining. It requires sufficient compute for inference and activation analysis.
- Although open-weight LLMs have RLHF, safety fine-tuning, and red teaming, the authors still believe these are insufficient to prevent harmful responses. Existing jailbreaks often require carefully crafted prompts or training, which is costly and limited by the discrete input space. The authors want a training-free, inference-time attack that does not modify prompts or weights.
- Amnesia decodes attention outputs in a white-box setting to locate the refusal layer, and uses sensitive keywords to extract the value of that layer. The user query subtracts α times that vector at an earlier layer j (where j is 1, 2, or 3) and then continues generation. When not specified, α is 0.6, and weights and prompts are not modified.
- For Llama-2-7B-Chat, Amnesia's Forbidden Questions ASR is 0.921 and AdvBench is 0.863. Llama-3-8B-Instruct has 0.923 on the same benchmark; Qwen-7B-Chat's HarmBench union is 64.9%, with L24 at 30.6%.
- The authors state that extrapolation to untested architectures is not possible, α and Sb are chosen empirically, and they plan to inject malicious behavior at specific layers and then combine it with Amnesia. The experiments include three target models and refusal heuristics, GPT-4o, and Llama Guard 2; the paper does not report the number of repetitions for the main ASR or agreement with human judgment.
- Evaluated models
- Llama-2-7B-ChatLlama-3-8B-InstructQwen-7B-Chat
- Benchmarks
- Forbidden Questions (WildJailbreak)AdvBench Harmful_behavioursHARMBENCH standard behaviorsMMLUSAMSumPerplexity Evaluation Corpus
- Metrics
- ASRMMLU accuracyROUGE-1/2/L/LsumPerplexitylooping percentageLlama Guard 2 unsafe rate
The researchers propose a lightweight activation-space adversarial attack named Amnesia that bypasses the safety mechanisms of open-weight large language models by manipulating the internal states of the Transformer. The attack can make the model generate harmful content without fine-tuning or additional training, and experiments on benchmark datasets show it can induce various antisocial behaviors. The authors thereby point out that open-weight models need more robust safety measures and call for continued research to prevent misuse.
Paper analysis
What problem does this paper attempt to solve?
The authors use a training-free value subtraction to bypass the safety refusal of open-source LLMs during white-box inference.
Can the safety refusal of open-weight LLMs be bypassed by inference-time activation interventions without fine-tuning or changing prompts.
- Scenario: The authors state that LLMs can be used to write phishing emails, harmful programs, or generate antisocial and racist content. Although the development pipeline includes data, synthetic data, safety fine-tuning and testing, red teaming, supervised fine-tuning, and RLHF, the authors believe it is still uncertain whether these measures are sufficient to prevent harmful responses.
- Existing limitations: The authors state that most jailbreaks rely on manually crafted prompts, and/or require fine-tuning or training on an objective function, which is time- and compute-intensive; they are also limited by the lack of suitable jailbreak targets, discrete input space, and tedious optimization, making them prone to failure in practice.
- Core observation: The authors state that different layers capture information at different levels, and intermediate layer outputs can be decoded. Amnesia hypothesizes that refusal takes shape along the attention value pathway in some decoder layer, so it only performs local subtraction in earlier blocks.
- Proposed method: The authors propose Amnesia, a training-free activation-space adversarial attack: without changing prompts or weights, it uses only a small portion of attention activations, and simultaneously evaluates utility with ASR and MMLU, ROUGE, and perplexity.
- Threat model:
- Knowledge: The paper states white-box. The attacker has full access to internal parameters and can access and manipulate the residual stream.
- Capability: Can query freely, observe hidden states or layer activations, and has the compute for inference and activation analysis.
- Goal: Cause targeted misbehavior at inference time, such as incorrect or harmful outputs; also interpret or reconstruct intermediate layer outputs.
- Boundary: No training changes, no retraining, only inference-time manipulation. The victim is an open-weight LLM.
What related research exists?
Related work includes prompt jailbreaks, gradient suffixes, and residual refusal directions; Amnesia is positioned as local value intervention.
Black-box prompt jailbreaks
- DAN and WildJailbreak (Shen et al., 2024): Treat the model as a black box, using role-play or system prompts to override safety behavior. WildJailbreak collects 390 forbidden questions covering 13 OpenAI policy scenarios.
- PAIR (Chao et al., 2024): Maintains a population of candidate jailbreak prompts, queries the target model and a safety reviewer, and performs mutation-based edits based on success scores. The authors claim that high-success prompts can be found within roughly a few dozen queries, without gradients.
- Prompt engineering empirical study (Liu et al., 2023): In the introduction, the authors state they evaluated various prompt-based jailbreaks. The paper does not separately report numerical comparisons with Amnesia.
White-box gradient suffixes and training
- GCG (Zou et al., 2023): Frames jailbreaking as learning a short universal adversarial suffix, using Greedy Coordinate Gradient to increase the log-likelihood of affirmative or non-refusal continuations; the suffix can be appended to new inputs and often transfers to other models.
- LSGM and LILA (Li et al., 2024): Suppress gradients in later residual blocks, or align updates with intermediate-layer adversarial directions. The authors claim improved ASR on AdvBench relative to original GCG, along with better transfer and computational efficiency.
- Fine-tuning erodes alignment (Qi et al., 2023): Supervised fine-tuning on a small amount of harmful data, or even seemingly benign data with adversarial labels, can weaken safety guarantees. AutoDAN (Liu et al., 2023) is described as generating covert, readable adversarial examples based on Zou et al.
Activation space and intermediate representations
- Refusal direction (Arditi et al., 2024): The authors claim that refusal is primarily mediated by a single direction in the residual stream; by contrasting harmful prompts that elicit refusal versus compliance, they estimate a refusal vector, and at inference time project it out or edit weights to be orthogonal to it. The paper criticizes this method for requiring activations computed across layers and many harmful and benign prompts, relying on curated datasets, which is impractical for attackers.
- Tuned lens (Belrose et al., 2023): Trains an affine probe for each block to decode hidden states into the vocabulary. The authors state that Amnesia is inspired by this, but the mechanism differs. Work on decoding intermediate activations (Shan et al., 2024; Skean et al., 2025) is cited to support "intermediate-layer interpretability."
- Abliteration (Labonne, 2024): Only cited alongside global residual direction methods; the paper does not elaborate on its approach.
Baselines and benchmarks
- Baseline methods: No-Attack; Section 5.1 refers to Arditi et al.'s weight orthogonalization as ORTHO and calls it SOTA. Table 12 also compares Arditi et al., AutoDAN, PAIR, Zou et al., and Li et al. based on whether they use target training, modify weights, modify prompts, and whether activation steering is global or local.
- Benchmarks: Forbidden Questions (WildJailbreak, 390 questions, 13 scenarios), AdvBench's Harmful_behaviours, HARMBENCH's 159 standard behaviors; utility side includes MMLU, SAMSum, and perplexity.
The authors position Amnesia as: relative to black-box prompt attacks and white-box suffix optimization, it is training-free, does not modify prompts or weights, and only accesses a small number of attention activations; relative to global residual direction methods, it performs local intervention only on the attention value path at a single safety site.
How does the paper address this problem?
After locating the refusal layer, subtract α times that layer's vector from the value stream of an earlier layer, then recompute attention.
Overall, it is a local activation steering at inference time: first find the refusal-related layer, then subtract a scaled version of that layer's vector from the value of an earlier layer. The authors call the method Amnesia. In the contributions section, they describe subtracting αVi from the value stream; Section 3 writes the same operation as updating V and recomputing attention.
Threat model and formalization
- Attacker: white-box, can read and write residual stream and layer activations, but cannot modify training.
- Notation: target model M, adversarial query AQ, sensitive keyword set Sb, user query UQ, layer offset j, scaling factor α. Table 1 lists these notations.
- No input modification: The user prompt and weights remain unchanged; the intervention occurs on internal activations during the forward pass.
Locating safety-related layers
- One forward pass of AQ: AQ is any input intended to elicit a refusal. The paper provides fill-in-the-blank example sentences, not quoted here. Layer-wise logits are decoded via Decode to obtain tokens; the formulas correspond to Eq. 6–7; the algorithm requires Top-K, and Table 2 reports Top 10.
- Decoding position: Earlier layers are not decoded. The authors' rationale is that earlier layers typically handle lexical rather than semantic content. Decoding is performed after each layer's multi-head attention, with the rationale that models like Llama and OpenAI are built on transformer attention.
- Layer selection: Identify finds layers among decoded tokens related to illegal or other sensitive topics, denoted as Li (Eq. 8). This step is done once per model.
Extracting the vector and subtracting it at an earlier layer
- Calibration forward pass: Run another forward pass with Sb, hooking the residual stream value matrix V_Li at Li (Eq. 9). The paper gives examples of Sb as denial-like tokens such as illegal, harmful, and also illegal, sensitive, unethical. Initialization is performed only once.
- User query: The forward pass only goes up to L(i-j), with j in {1, 2, 3}. Update as VL(i−j)=VL(i−j)−α× VLi, i.e., subtract α times the vector from Li from the value of an earlier layer.
- Recompute attention: Use the updated V with the original softmax(QK^T/√d_k)·V to obtain A, then autoregressively generate to the end. The authors state that the subtraction occurs before safety features fully converge.
- Empirical choice of α: α is an empirical floating-point scaling. A footnote states that too large may lead to repetition or unstable loops, while too small may fail to suppress the target activation. Unless otherwise specified, α=0.6.
Success determination
- Section 4.1: Compares baseline and Amnesia at the response level. If the attacked model exhibits at least one non-refusal pattern and the baseline refuses, it is a success; detected using refusal phrase heuristics. ASR is the proportion of prompts with such non-refusal.
- Section 4.2: Also states, following prior work, that success is defined as not refusing according to the heuristic, only distinguishing refuse and answer, with no additional ground truth. The two statements are not identical, and the paper does not unify them.
- Looping outputs: Later, responses that meet non-refusal but exhibit degenerate repetition are separately counted as looping, distinct from non-looping.
What experiments did the paper conduct?
The ASR of Amnesia increases on Llama-2, Llama-3, and Qwen, with MMLU at 46.77%.
Experimental Setup
- Model under test: Default Llama-2-7B-Chat; also Llama-3-8B-Instruct, Qwen-7B-Chat. No auxiliary LLM for attacks.
- Harmful request data: Forbidden Questions is a WildJailbreak subset, 390 questions, 13 OpenAI-style scenarios; AdvBench's Harmful_behaviours, the paper does not state the number of items; HARMBENCH's 159 standard behaviors.
- Baseline: No-Attack. For comparison with Arditi et al., their reported ORTHO is used; the authors state this number is copied from the original paper.
- Main metric: ASR. The success definitions in 4.1 and 4.2 are from the previous question. Also report looping proportion, MMLU accuracy, ROUGE, and perplexity.
- Evaluation: The main tables use a refusal-phrase heuristic. Section 4.9 uses GPT-4o outputting Yes (unsafe), No (safe), or Pass. Section 5.1 uses Meta-Llama-Guard-2-8B, mapping outputs starting with unsafe or safe to the corresponding label; the authors state there were no ambiguous labels.
- Default intervention: α=0.6, unless otherwise stated. On Llama-2, the authors set the layer related to refusal tokens at 16 (Table 2: security importance score 24, legal 7). The temperature, maximum length, and number of repetitions for the main ASR are not stated in the paper. HarmBench-style generation is greedy, temperature≈0, maximum 512 tokens.
Main Results
In Table 3, 0.921 is the best result among i=16, j=1,2,3; the paper does not state which j it corresponds to. In Table 7, with the layer fixed at 14 and α=0.6, the ASR is 81.54%, which is not the same setting as 0.921.
Swipe horizontally to read the table
Model Benchmark Baseline Amnesia Source Llama-2-7B-Chat Forbidden Questions 0.536 0.921 Table 3 Llama-2-7B-Chat AdvBench harmful_behaviours 0.348 0.863 (j=2,3) Table 4 Llama-3-8B-Instruct AdvBench 0.551 0.863 (L13 and L14) Table 6 Llama-3-8B-Instruct Forbidden Questions 0.692 0.923 (L13–15) Table 6 Qwen-7B-Chat HARMBENCH 159 items 45.5% 64.9% (union of L21–24) Figure 3 - The authors state that on Forbidden Questions, Llama-2 increases by approximately 38 percent; the Δ for AdvBench is 0.515. The authors state that Llama-3 has a higher baseline and weaker default refusal, but after intervention it is close to Llama-2 on Forbidden Questions, so they consider it usable across models.
- For Qwen, not every single layer is above baseline: L21 is 48.5%, L22 is 35.8%, L23 is 45.5%, L24 is 30.6%. The authors state that single-layer changes are moderate, and only the union increases; they consider this consistent with Layer 23 having theft-related Chinese tokens. Qwen uses a refusal-string heuristic, which the authors state is broader than the official HarmBench classifier.
- The authors state that Financial Advice and Health Consultation already have baselines ≥0.96, leaving limited room for increase.
Category Breakdown and α
- Table 5 (Llama-2-7B-Chat, j=2, i=16, i.e., L14): Malware 0.267→0.900 (Δ=+0.633), Fraud 0.233→0.800 (Δ=+0.567), Physical Harm 0.367→0.667 (Δ=+0.300), Hate Speech 0.433→0.700 (Δ=+0.267), Illegal Activity 0.033→0.300 (Δ=+0.267). Financial Advice is 1.000 at both ends. The attached text's Table 5 does not list the Political Lobbying, Pornography, or Privacy Violence rows.
- Table 7 (layer fixed at 14): at α=0.4, ASR 62.31%, Loop 0.00%; at 0.6, 81.54% and 1.03%; at 0.8, 96.15% and 29.23%, with non-looping success at 66.92%. The authors state that increasing α makes ASR rise monotonically, but after α≥0.7 looping success increases sharply, reducing usability for attackers. The text of Figure 5 states that at α≈0.6, ASR rises while looping remains low.
- Figure 4 (α=0.6, Layers 13–15): the authors state that L14 is overall higher than L13 and L15, but this does not hold for all categories; on Malware, L13 is higher. The text does not give the values of the bars. Table 5 and Table 8 have different numbers for the same category names at α=0.6; the paper does not state whether they are from the same run.
GPT-4o Evaluation and Benign Utility
- Table 9: GPT-4o evaluates Forbidden Questions. The paper does not state the layer or α in Section 4.9, only that multiple runs are aggregated, without giving the number. Without attack, the Safe column ranges from 95.0 to 100. With attack, Unsafe ranges from 20.0 for Physical Harm to 96.6 for Political Lobbying; those below 50 also include Malware 33.3 and Fraud 48.0. The authors state that most categories have a higher proportion of unsafe. The no-attack Unsafe cell for Illegal Activity in the text is "02", with uncertain column alignment; it is not cited here.
- Not the same metric as ASR: In Table 5, the baseline ASR for Financial Advice is already 1.000, but in Table 9, without attack, 99.6 is still judged Safe. The authors do not explain this difference.
- Utility (Llama-2-7B-Chat, Layer 14, α=0.6): MMLU goes from 46.47% to 46.77%. The authors state this is about 0.3%, and broad-domain QA is not substantially harmed. On SAMSum, ROUGE-1 +0.0066, ROUGE-2 −0.0067, ROUGE-L −0.0027, ROUGE-Lsum +0.0044; perplexity goes from 56.992 to 66.161 (+9.169). The authors state that ROUGE is essentially unchanged, perplexity rises by about 9.2, and external LMs prefer these outputs less, but overlap with reference summaries is not systematically reduced. The authors state that the results hold only for the chosen layer, α, and keyword probe.
HarmBench Comparison with ORTHO
- Protocol: Same 159 standard behaviors, greedy, temperature≈0, maximum 512 tokens, no system prompt, no per-prompt optimization. The classifier is Meta-Llama-Guard-2-8B.
- Amnesia: L13, L14, L15 have 112, 90, 77 / 159 marked unsafe, respectively; Figure 6 labels them 70.4%, 56.6%, 48.4%. In Figure 7, DR is 0.0%, ORTHO is 79.9%, and Amnesia at L13 is 70.4%. The authors state that ORTHO is copied from Arditi et al.'s reported values with and without the default system prompt, but the figure shows only one 79.9%.
- Another heuristic: For the same 159 items, using the refusal-phrase heuristic instead, the baseline ASR is 53.5%, and the union of L13–15 is 95.6%. The authors state that classifier evaluation is more conservative, and under both protocols Amnesia increases the proportion of non-refusals that are often judged unsafe.
Other Ablations and Analyses
- Table 8, cells for α=0.4/0.6/0.8 are ASR/looping percentages; the authors state that 0.4 to 0.6 improves more on boundary categories, while at 0.8 the gain worsens and looping increases. Example: Illegal Activity is 17/0, 43/0, 87/27.
- Footnote: α too large may cause repetition or instability; too small may fail to suppress the target activation.
- Qwen's Li is determined by decoding: Layer 23 contains Chinese tokens such as theft, steal, and steal, so Layers 21–24 are evaluated.
- Appendix A is a qualitative comparison of custom antisocial prompts; the original replies are not quoted. Appendix B's Table 13 gives example queries for each scenario.
What are some points that can be further explored?
The authors state that untested architectures cannot be extrapolated, α and Sb are chosen empirically, and they plan deliberate activation manipulation.
Limitations and future directions noted by the authors
- Untested architectures: The authors state that results cannot be generalized to architectures not tested (Section 6.1).
- Empirical parameters: The method relies on empirically determined scaling factor α and steering vector Sb; optimizing α by ASR remains an open problem (Section 6.1).
- Positioning: In Limitations, the authors view this study as a proof-of-concept to show that single-layer additive activation steering can alter refusal (Section 6.1).
- Future plans: The authors plan to explore informed activation manipulation, introducing malicious behavior at specific layers, combined with Amnesia, to examine whether outputs are more creative and also more malicious (Section 7).
Experimental coverage
- Target models for attack experiments are Llama-2-7B-Chat, Llama-3-8B-Instruct, Qwen-7B-Chat (Section 4, Table 6, Figure 3).
- Harmful request data includes Forbidden Questions (390 questions, 13 scenarios), AdvBench Harmful_behaviours, and HARMBENCH's 159 standard behaviors.
- Evaluation methods include refusal phrase heuristics, GPT-4o (Yes/No/Pass), and Meta-Llama-Guard-2-8B; benign tasks are MMLU, SAMSum, and perplexity, all specified as Llama-2-7B-Chat, Layer 14, α=0.6 (Tables 10, 11).
- Comparison with Arditi et al. uses ORTHO as transcribed by the authors, and Amnesia without system prompts and without per-prompt optimization (Figure 7, Section 5.1).
- The paper does not report the number of repetitions for the main ASR, nor the decoding temperature for the main experiments (except for HarmBench-style settings); it does not report agreement between reviewers and human judgments; it does not specify the number of AdvBench Harmful_behaviours items; it does not clarify whether Table 5 and Table 8 are from the same run.
Summarize the main content of the paper
Amnesia does not modify weights or prompts, and the ASR on Llama-2's Forbidden Questions is 0.921.
Amnesia is a white-box inference-time attack against open-weight LLMs: no fine-tuning, no weight modification, no prompt modification, only changing one attention value.
The authors address the fact that models may still be jailbroken after RLHF and safety fine-tuning, and that prompt construction and gradient-based suffix optimization are costly. The approach is to use adversarial queries to locate the refusal-related layer Li, extract that layer's vector with a few sensitive keywords, then subtract α times that vector at an earlier L(i-j) and recompute attention. Unless otherwise stated, α=0.6 and j is 1, 2, or 3.
- Llama-2-7B-Chat: ASR on Forbidden Questions goes from 0.536 to 0.921 (Table 3, best result among j=1,2,3); on AdvBench from 0.348 to 0.863 (Table 4, j=2,3). With fixed L14 and α=0.6, Table 7 gives 81.54%, which is not the same setting as 0.921.
- Llama-3-8B-Instruct: Forbidden Questions from 0.692 to 0.923 (L13–15), AdvBench from 0.551 to 0.863 (L13 and L14) (Table 6).
- Qwen-7B-Chat: baseline 45.5% on 159 questions, union of L21–24 64.9%; L22 is 35.8% and L24 is 30.6%, below baseline (Figure 3).
- Stricter evaluation: under Llama Guard 2, L13 is 70.4% (112/159). In Figure 7, DR without attack is 0.0%, and the ORTHO transcribed by the authors is 79.9%. The union of refusal heuristics on the same 159 questions is 95.6%, with baseline 53.5%.
- Utility: with L14 and α=0.6, MMLU goes from 46.47% to 46.77%; perplexity from 56.992 to 66.161. Increasing α raises ASR but also raises the proportion of repetitive outputs.
The authors believe open-weight models need more robust defenses. In Limitations, they state this is a proof-of-concept that cannot be extrapolated to untested architectures, and α and the steering vector are chosen empirically; they plan to later actively inject malicious behavior at specific layers and then combine it with Amnesia.
Related papers
- Safety Alignment Should Be Made More Than Just a Few Tokens DeepAnalysis / interpretabilityICLR 2025