J-Anchor: Defending Against Prefill Attacks via J-Space Selective Refusal Restoration
Abstract
Prefill jailbreaks can cause safety-aligned language models to continue an unsafe assistant prefix even when they would refuse the same request under normal decoding. We study how the model's internal harmfulness and refusal signals evolve along this attacker-controlled trajectory. Using the Jacobian lens, we track vocabulary-grounded harmfulness and refusal signals from the assistant header through prefilling and subsequent generation. We identify a characteristic phenomenon, which we call refusal-state erosion: both the refusal signal and the harmfulness signal weaken as the prefill progresses, but the refusal signal progressively declines to the benign baseline by the end of the prefill, while the harmfulness signal remains above its benign baseline and detectable during subsequent generation. Motivated by this observation, we introduce J-Anchor, a training-free inference-time defense that uses the model's pre-attack harmfulness and refusal signals as a request-specific anchor and selectively restores weakened refusal in J-space during prefilling and decoding. J-Anchor substantially reduces attack success under both fixed and deep prefill attacks across different model families. J-Anchor largely preserves benign behavior and reasoning ability, and ablations highlight the importance of targeted restoration in the J-space refusal subspace. Our results suggest that preserving latent refusal dynamics offers a promising route to robust defense against prefill jailbreaks.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI
- Comments
- 22 pages, 5 figures
Related papers
Bounded Autonomy: A Trust-Anchored Defense Against Resource-Exhaustion Attacks on Tool-Augmented LLM Agents
Shared title terminologycs.CRZiyuan Chen, Yueming Lyu, Songze Li et al.
MirrorGuard: Defending LiDAR Perception against Passive Mirror Attacks
Shared title terminologycs.CRAymen Bouferroum, Ildi Alla, Selma Yahia et al.
Jev as an LLM Safety Guardrail: An Empirical Study of Input Filtering, Selective Output Review, and Over-Refusal
Shared title terminologycs.CROlivia Cognetti, Bhaskar Krishnamachari
BridgeHammer: DNN Backdoor Attack via CPU-iGPU Shared-memory Rowhammer
Shared title terminologycs.CRYufei Wang, Saion K. Roy, Yunsi Fei
Poisoning Attacks to Local Differential Privacy Protocols for Dynamic Graphs
Shared title terminologycs.CRShang Liu, Yuhan Bao, Hongbin Zhao et al.
Bit-Flip Attacks on Quantized Neural Networks without Knowledge of Model Parameters
Shared title terminologycs.CRMahmoud Abumandour, Srinija Ramichetty, Guru Venkataramani et al.