Toward Context-Invariant Safety Alignment for Large Language Models
Towards Context-Invariant Safety Alignment for Large Language Models
AI summary
Anchor Invariance Regularization (AIR) uses verifiable prompts as anchors and regularizes only open-ended prompt variants with a stop-gradient target, making large language models' safety behavior depend on request intent rather than surface wording. The method is implemented as a plug-in auxiliary loss, combining heterogeneous prompt grouping with grouped preference optimization such as GRPO. In the three domains of Safety, Moral Reasoning, and Math, AIR improves in-distribution grouped accuracy by 12.71% and out-of-distribution consistency by 33.49%, making safety constraints more robust to adversarial phrasing.