TL;DR
As Large Language Models (LLMs) scale up their reasoning capabilities via extended Chain-of-Thought (CoT), they become uniquely vulnerable to jailbreaks and prompt injections that hijack their internal "thinking" process. This paper introduces Activation Consistency Training (ACT), a self-supervised defense that forces a model's internal representations of an adversarial prompt to match its clean counterpart right at the assistant-turn boundary. ACT proves highly robust against adaptive attacks, maintains model utility, and operates via a clean, interpretable linear refusal direction in activation space.
What Problem Does This Paper Address?
Frontier reasoning models (like DeepSeek-R1 or OpenAI's o1/o3) generate hundreds or thousands of intermediate tokens before delivering a final answer. While this drastically boosts performance on complex tasks, it introduces a dangerous safety vulnerability: models can literally "talk themselves into compliance." An adversarial prompt can hijack the early steps of a CoT trace, gradually steering a model away from its safety alignment until it outputs harmful content.
Defending these models is notoriously difficult. Standard training-based defenses try to supervise the entire output text distribution. For reasoning models, this means supervising thousands of tokens per training example, which is computationally expensive and fragile. If an attacker finds a novel way to manipulate the reasoning path, the defense collapses. The authors set out to find a defense that works upstream of the reasoning process, independent of CoT length.
Methods
The authors explore Consistency Training, a self-supervised framework that teaches a model to behave identically when given a clean prompt ($p_{\text{clean}}$) versus an adversarially "wrapped" version ($p_{\text{wrapped}}$) containing a jailbreak or injection. They compare two main flavors:
- Bias-Augmented Consistency Training (BCT): An output-level defense that uses standard cross-entropy loss to force the model to reproduce the clean prompt's text completion (including the full CoT trace) when fed the wrapped prompt.
- Activation Consistency Training (ACT): An activation-level defense. Instead of looking at tokens, ACT minimizes the squared $L_2$ distance between the hidden states of the clean and wrapped prompts at the shared suffix positions across every single transformer layer.
As shown in Figure 1, these shared suffix positions typically align with the chat-template tokens right before generation begins (e.g., <|start|>assistant<|think|>). By pinning the internal activations of the adversarial prompt to the clean prompt's values, the model is forced to ignore the adversarial injection entirely.
Datasets
The methods were evaluated across five reasoning model families (including Qwen3, Phi-4-reasoning, and GPT-OSS-20B) using the following benchmarks:
- Prompt Injection: Open-Prompt-Injection (OPI), AlpacaFarm, and the SEP benchmark (which tests out-of-distribution injection locations at the start, middle, or end of user input).
- Jailbreak: 200 harmful behaviors from HarmBench, with adversarial rewrites generated via PAIR.
- Utility: MMLU and clean task accuracy on OPI to ensure the safety training didn't degrade the models' core capabilities.
Key Insights and Ideas
- Immunization Upstream of Reasoning: Because ACT applies its loss at the assistant-turn boundary before the model starts generating CoT tokens, it completely bypasses the need to supervise lengthy thinking traces.
- Robustness to Malicious CoT Prefills: To prove ACT doesn't just learn a surface-level pattern of "safe text," the authors ran a clever intervention: they prefilled the defended model's thinking block with a compliant CoT trace taken from an undefended base model. Even when forced to start with reasoning that concluded compliance was okay, ACT models successfully pivoted to refuse the request, whereas BCT models followed the malicious trace and failed.
- A Linear Refusal Direction: The authors discovered that ACT implicitly encodes its defense as a simple, linear shift in activation space at the assistant boundary. By extracting this single vector ($d_{\text{ACT}}$), they demonstrated that inference-time activation steering (adding or subtracting the vector) could bidirectionally turn the defense on or off.
Key Results
- Defeating Static Attacks: On standard benchmarks, both ACT and BCT successfully drove Attack Success Rates (ASR) close to zero for most models.
- Resisting Adaptive Attackers: The true test of a defense is an attacker optimized specifically to break it. The authors trained an adaptive attacker using Reinforcement Learning (GRPO). Against this aggressive threat model, ACT consistently outperformed BCT. For example, on GPT-OSS-20B under adaptive prompt injection, BCT suffered a 57.4% ASR, while ACT held the line at 37.0%.
- Jailbreak Superiority: In the jailbreak setting, ACT achieved a near 100% defense win rate against both static and adaptive attacks on almost all models, while BCT's robustness degraded significantly under adaptive pressure.
Limitations and Future Work
While highly effective, ACT has a few notable limitations:
- Data Dependency: It relies on generating high-quality, self-supervised pairs of clean and wrapped prompts, which can be difficult to curate for complex, novel attack vectors.
- Not 100% Foolproof: ACT does not guarantee absolute security, particularly against white-box attacks where an adversary has direct gradient access to the model weights.
- Future Directions: The authors suggest exploring Targeted ACT—applying the consistency loss only to specific, load-bearing layers or attention heads rather than uniformly across the entire network—to better preserve model utility and reduce training overhead. They also propose testing consistency training within agentic, multi-turn environments.
Summary updated