파인튜닝된 LLM의 안전성 이해 및 유지
Understanding and Preserving Safety in Fine-Tuned LLMs
파인튜닝은 대규모 언어 모델(LLM)을 다양한 하위 작업에 적용하는 데 필수적인 기능입니다. 그러나 파인튜닝은 안전성 정렬을 크게 저하시킬 수 있는 잠재력이 있으며, 심지어 파인튜닝 데이터가 완전히 안전한 경우에도 공격에 대한 취약성이 크게 증가할 수 있습니다. 파인튜닝 단계에서 안전성 방어를 위한 연구가 활발히 진행되고 있지만, 기존 방법은 지속적인 안전성-유용성 딜레마에 어려움을 겪습니다. 안전성을 강조하면 작업 성능이 저하되는 반면, 유용성을 우선시하려면 불가피하게 안전성이 크게 감소하는 깊은 파인튜닝이 필요하기 때문입니다. 본 연구에서는 안전성 정렬된 LLM에서 안전성과 유용성 지향적인 그래디언트 간의 기하학적 상호 작용에 대한 새로운 통찰력을 제공하여 이 딜레마를 해결합니다. 체계적인 실증 분석을 통해 세 가지 주요 내용을 밝혀냈습니다. (I) 안전성 그래디언트는 저랭크 부분 공간에 존재하고, 유용성 그래디언트는 더 넓은 고차원 공간을 포함합니다. (II) 이러한 부분 공간은 종종 부정적인 상관 관계를 가지므로 파인튜닝 과정에서 방향 충돌이 발생합니다. (III) 지배적인 안전성 방향은 단일 샘플로부터 효율적으로 추정할 수 있습니다. 이러한 새로운 통찰력을 바탕으로, 본 연구에서는 그래디언트 구성 요소를 명시적으로 제거하여 저랭크 안전성 부분 공간과 충돌하는 구성 요소를 제거하는 경량화된 방법인 안전성 유지 파인튜닝(SPF)을 제안합니다. 이론적으로, SPF는 유용성 수렴을 보장하고 안전성 변화를 제한한다는 것을 증명했습니다. 실험적으로, SPF는 파인튜닝 시나리오에서도 하위 작업 성능을 일관되게 유지하고 사전 훈련된 안전성 정렬을 거의 완전히 복원합니다. 또한, SPF는 깊은 파인튜닝 및 동적 공격에 대해 강력한 저항성을 보입니다. 종합적으로, 본 연구의 결과는 LLM 파인튜닝에 대한 새로운 메커니즘적 이해와 실용적인 지침을 제공합니다.
Fine-tuning is an essential and pervasive functionality for applying large language models (LLMs) to downstream tasks. However, it has the potential to substantially degrade safety alignment, e.g., by greatly increasing susceptibility to jailbreak attacks, even when the fine-tuning data is entirely harmless. Despite garnering growing attention in defense efforts during the fine-tuning stage, existing methods struggle with a persistent safety-utility dilemma: emphasizing safety compromises task performance, whereas prioritizing utility typically requires deep fine-tuning that inevitably leads to steep safety declination. In this work, we address this dilemma by shedding new light on the geometric interaction between safety- and utility-oriented gradients in safety-aligned LLMs. Through systematic empirical analysis, we uncover three key insights: (I) safety gradients lie in a low-rank subspace, while utility gradients span a broader high-dimensional space; (II) these subspaces are often negatively correlated, causing directional conflicts during fine-tuning; and (III) the dominant safety direction can be efficiently estimated from a single sample. Building upon these novel insights, we propose safety-preserving fine-tuning (SPF), a lightweight approach that explicitly removes gradient components conflicting with the low-rank safety subspace. Theoretically, we show that SPF guarantees utility convergence while bounding safety drift. Empirically, SPF consistently maintains downstream task performance and recovers nearly all pre-trained safety alignment, even under adversarial fine-tuning scenarios. Furthermore, SPF exhibits robust resistance to both deep fine-tuning and dynamic jailbreak attacks. Together, our findings provide new mechanistic understanding and practical guidance toward always-aligned LLM fine-tuning.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.