TL;DR
Current safety alignment in Large Language Models primarily alters surface-level output behaviors rather than fundamentally restructuring internal representations. This paper shows that small, statistically normalized perturbations to intermediate hidden activations—termed Activation Steering Attacks (ASA)—easily dismantle safety guardrails across modern aligned models. To counter this, the authors introduce Layer-wise Adversarial Patch Training (LAPT), an internal adversarial training approach that significantly hardens latent safety without sacrificing reasoning performance.
What Problem Does This Paper Address?
Standard post-training alignment techniques—such as Supervised Fine-Tuning (SFT) and Preference Optimization (PO/RLHF)—condition models to generate refusal responses when prompted with dangerous requests (e.g., "How to build a bomb?"). However, do these techniques actually eliminate harmful capabilities, or do they just paste a polite refusal mask over dangerous internal states?
The authors demonstrate that safety alignment is shallow: the latent space of aligned models lacks local robustness. Even when an aligned model successfully refuses a malicious prompt at the input-output level, subtle shifts in its internal activations during generation can cause it to abandon refusal and emit harmful instructions.
Methods
The paper investigates this vulnerability and develops defenses through three complementary techniques:
- Negative Log-Likelihood (NLL) Probing: Rather than evaluating against a handcrafted target string, the authors measure the NLL of the model's original safe refusal response under internal perturbations. A sharp rise in refusal NLL acts as an automated diagnostic tool indicating local safety failure.
- Activation Steering Attack (ASA):
- $ASA_{\text{random}}$: Injects Gaussian noise into intermediate transformer layers at generation time. Critically, perturbations are normalized to match the activation layer’s mean and variance, preventing generation collapse into repetitive gibberish.
- $ASA_{\text{grad}}$: A white-box, gradient-guided attack inspired by FGSM. It computes the gradient of the loss with respect to intermediate activations using a harmful target suffix, steering activations along the steepest unsafe direction.
- Multi-Token Accumulation: Injected across consecutive decoding steps, latent shifts compound autoregressively, steadily widening the output distribution divergence (measured via KL divergence).
- Layer-wise Adversarial Patch Training (LAPT): A defense strategy that fine-tunes the model on safety prompts while injecting normalized perturbations into identified "fragile layers." To prevent degradation of general reasoning, the trained weights are subsequently interpolated with the base model weights.
Datasets
- AdvBench: The first 100 prompts served as seeds across all model layers to discover vulnerabilities; the remaining 420 samples were reserved for out-of-distribution generalization testing.
- ASABench (New Benchmark): A curated benchmark of 4,862 validated jailbreak instances across 8 open-source models, paired with fine-grained layer-attribution metrics.
- Evaluation Datasets: HEx-PHI (safety benchmark), along with GSM8K (math reasoning) and CommonsenseQA (general reasoning) to verify that defensive fine-tuning does not impair general capabilities.
Key Insights and Ideas
- Vulnerabilities are concentrated in specific layers: Models do not fail uniformly; attack success clusters heavily around specific intermediate "fragile layers."
- Harmful gradients expose sharp latent cliffs: Visualizing the 3D loss landscape reveals that aligned models exhibit dramatically sharper curvature along gradient directions derived from harmful suffixes compared to random vectors.
- Normalization is essential: Unnormalized perturbations typically result in high-perplexity gibberish (e.g., perplexity spiking to over 600,000 on Llama-3.1-8B-Instruct). Statistical matching preserves coherent text generation while uncovering safety failures.
- Composability with prompt-based attacks: ASA can act as a catalyst for other jailbreaks. Combining ASA with Greedy Coordinate Gradient (GCG) lowers the barrier to unsafe behavior, dramatically boosting GCG attack success rates.
Key Results
- Latent Jailbreak Efficacy: $ASA_{\text{random}}$ achieved a Max-layer Attack Success Rate (MASR) of 94% on Llama-3.2-3B-Instruct and 80% on Qwen-2.5-7B-Instruct, despite both having very low initial failure rates without perturbations (12% and 11%, respectively).
- Gradient-Based Attacks: $ASA_{\text{grad}}$ achieved up to 100% MASR on Qwen-2.5-7B-Instruct and boosted the Peak-layer Attack Success Rate (PASR) on Llama-3.1-8B-Instruct from 0.41 to 0.82.
- Amplifying GCG: Pre-pending ASA to GCG increased MASR substantially across the board—for example, from 14% to 93% (+0.79) on Llama-3.1-8B-Instruct.
- LAPT Defense: LAPT reduced average attack success on vulnerable layers (e.g., cutting Llama-3.2-3B-Instruct peak ASR from 0.60 to 0.28) while preserving CommonsenseQA and GSM8K accuracy within a narrow 0.05 performance margin.
- Safety Judge Accuracy: QwQ-32B proved to be a more accurate safety judge against human ground truth than GPT-4 (79% vs. 62% accuracy).
Limitations and Future Work
- White-Box Requirement: ASA requires direct access to intermediate activations, limiting its immediate threat model against closed-source commercial APIs (though it remains a potent diagnostic tool and risk for open weights).
- Weight Interpolation Dependency: LAPT relies on post-hoc weight interpolation to retain general task performance, which requires empirical tuning of the mixing parameter $\lambda$.
- Future Directions: Exploring whether representation-level defenses can be integrated directly into foundational pre-training or standard RLHF objectives, rather than applied as post-hoc fine-tuning patches.
Summary updated