Probing the robustness of large language models safety to latent perturbations

Tianle Gu, Kexin Huang, Zongqi Wang, Yixu Wang, Jie Li, Yuanqi Yao, Yang Yao, Yujiu Yang, Yan Teng, Yingchun Wang · Submission to ICLR 2026 · Withdrawn

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:

  1. 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.
  2. Activation Steering Attack (ASA):
  3. $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.
  4. $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.
  5. Multi-Token Accumulation: Injected across consecutive decoding steps, latent shifts compound autoregressively, steadily widening the output distribution divergence (measured via KL divergence).
  6. 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

Abstract

Safety alignment is a key requirement for building reliable Artificial General Intelligence. Despite significant advances in safety alignment, we observe that minor latent shifts can still trigger unsafe responses in aligned models. We argue that this stems from the shallow nature of existing alignment methods, which focus on surface-level refusal behaviors without sufficiently altering internal representations. Consequently, small shifts in hidden activations can re-trigger harmful behaviors embedded in the latent space. To explore the robustness of safety alignment to latent perturbations, we introduce a probing method that measures the Negative Log-Likelihood of the original response generated by the model. This probe quantifies local sensitivity in the latent space, serving as a diagnostic tool for identifying vulnerable directions. Based on this signal, we construct effective jailbreak trajectories, giving rise to the Activation Steering Attack (ASA). More importantly, these insights offer a principled foundation for improving alignment robustness. To this end, we introduce Layer-wise Adversarial Patch Training (LAPT), a fine-tuning strategy that inject controlled perturbations into hidden representations during training. Experimental results highlight that LAPT strengthen alignment robustness without compromising general capabilities. Our findings reveal fundamental flaws in current alignment paradigms and call for representation-level training strategies that move beyond surface-level behavior supervision.
BibTeX
@misc{gu2025probing,
  author = {Tianle Gu and Kexin Huang and Zongqi Wang and Yixu Wang and Jie Li and Yuanqi Yao and Yang Yao and Yujiu Yang and Yan Teng and Yingchun Wang},
  title = {{Probing the robustness of large language models safety to latent perturbations}},
  year = {2025},
  eprint = {2506.16078},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.16078},
}
Figure