In-context representation hijacking attackIn-Context Representation Hijacking
Translation in progress — untranslated text is omitted.
The researchers propose the Doublespeak attack, which systematically replaces harmful keywords with benign words in in-context examples, causing the model's internal representations of benign words to gradually converge toward harmful semantics, thereby bypassing safety alignment. The attack requires no optimization and transfers across models, achieving a 74% attack success rate on Llama-3.3-70B-Instruct with only a single-sentence context overwrite, and a 92% bypass rate against the dedicated guardrail LLaMA-Guard-3-8B. Using logit lens and Patchscopes, the authors trace that benign semantics appear in early layers while harmful semantics gradually form in later layers; in Llama-3-8B-Instruct, the layer where the refusal direction resides, layer 12, is still in the benign region. They therefore argue that current alignment methods relying on input-layer inspection are insufficient, and safety mechanisms need continuous monitoring at the representation level.
- Investigate the mechanism by which internal representations of large language models are dynamically remapped during in-context learning, and evaluate the vulnerability of current safety alignment strategies based on input-layer keyword detection and shallow refusal directions under representation-level manipulation.
- Propose the optimization-free Doublespeak attack, which prepends context examples that systematically replace sensitive words with benign words before harmful requests, prompting the model to redirect the internal representation of benign words to harmful semantics layer by layer during forward propagation, bypassing shallow safety alignment mechanisms.
- On AdvBench, achieved 88% ASR for Llama-3-8B-Instruct, 75% ASR for Llama-3.3-70B-Instruct with a single context example, and a 92% bypass rate for the guardrail LLaMA-Guard-3-8B.
- Experiments were only completed on a single benchmark, AdvBench. The main experiments fixed the single replacement word "potato" and simplified prompts to a single concept. The paper did not evaluate specific defense strategies, and some production models only showed qualitative results without reporting quantitative ASR.
The paper uses logit lens and Patchscopes to trace how benign word representations are layer-by-layer overridden by harmful semantics, pointing out that alignment strategies that only inspect the input layer have blind spots.