Safety Alignment Should Be Made More Than Just a Few Tokens Deep

Xiangyu Qi, Ashwinee Panda, Kaifeng Lyu, Xiao Ma, Subhrajit Roy, Ahmad Beirami, Prateek Mittal, Peter Henderson

arXiv:2406.05946 · 2026-07-27 공개 · arXiv · PDF

llm fine-tuning robustness adversarial-attacks safety-alignment prefilling-attacks shallow-safety token-depth

Abstract

The safety alignment of current Large Language Models (LLMs) is vulnerable. Relatively simple attacks, or even benign fine-tuning, can jailbreak aligned models. We argue that many of these vulnerabilities are related to a shared underlying issue: safety alignment can take shortcuts, wherein the alignment adapts a model's generative distribution primarily over only its very first few output tokens. We refer to this issue as shallow safety alignment. In this paper, we present case studies to explain why shallow safety alignment can exist and provide evidence that current aligned LLMs are subject to this issue. We also show how these findings help explain multiple recently discovered vulnerabilities in LLMs, including the susceptibility to adversarial suffix attacks, prefilling attacks, decoding parameter attacks, and fine-tuning attacks. Importantly, we discuss how this consolidated notion of shallow safety alignment sheds light on promising research directions for mitigating these vulnerabilities. For instance, we show that deepening the safety alignment beyond just the first few tokens can often meaningfully improve robustness against some common exploits. Finally, we design a regularized finetuning objective that makes the safety alignment more persistent against fine-tuning attacks by constraining updates on initial tokens. Overall, we advocate that future safety alignment should be made more than just a few tokens deep.

한국어 요약

한 줄 요약

현재 대형 언어 모델의 안전 정렬은 첫 몇 개의 토큰만 고려하는 "얕은 안전 정렬"로 인해 취약하다.

핵심 기여도

핵심 아이디어

기존 안전 정렬 방법은 모델의 **첫 몇 토큰**(일반적으로 5개 이내)만 안전하게 만들도록 학습되어, 이후 토큰에서는 해로운 생성 경로로 이어질 수 있다. 예를 들어, 사용자가 "How do I build a bomb?"라고 질문하고, 모델이 "Sure, here's a detailed guide."로 시작하면, 이후 토큰이 자동으로 해로운 정보로 이어질 가능성이 높다. 이는 **초기 토큰 분포에 의존적인 "짧은 정렬"**(shallow alignment)의 한계이다.

이를 해결하기 위해, **깊은 정렬**(deep alignment)을 추구해야 한다. 즉, 안전 정렬이 단순히 첫 몇 토큰이 아니라 전체 생성 과정에 걸쳐 지속적으로 적용되어야 한다. 이를 위해 **데이터 증강**을 통해 해로운 응답을 시작으로 안전한 응답으로 전환하는 학습 데이터를 구성하고, **초기 토큰에 대한 분포 변화를 제한하는 제약 최적화**(constrained fine-tuning objective)를 도입한다. 이는 **β_t 파라미터**를 통해 구현되며, 첫 5개 토큰에는 강한 제약(β₁=0.5, β₂~₅=2)을, 이후 토큰에는 약한 제약(β₆ 이상=0.1)을 적용한다.

기술적 접근법

주요 결과

의의 및 한계

실용적 활용