通过正交梯度投影缓解大模型对齐导致的性能下降问题
Safety Alignment as Continual Learning: Mitigating the Alignment Tax via Orthogonal Gradient Projection
- 用少量通用数据梯度构建参考子空间,正交投影去除有害更新分量
- 在Qwen2.5-7B和Llama3.1-8B上安全与通用能力平衡提升9%~13%
- 轻量级改造适配现有训练流程,无需大规模重放数据
安全后训练可提升大语言模型的无害性和策略合规性,但可能降低其通用能力,即所谓‘对齐税’。本文从持续学习视角分析该权衡:连续对齐阶段带来数据分布与目标的变化,梯度间相互干扰,削弱已有通用能力。为此提出正交梯度投影对齐方法(OGPSA),通过小规模通用数据梯度估计低秩参考子空间,将安全梯度中位于该子空间内的分量正交移除。更新方向在保持参考目标的前提下,是局部最陡的安全下降方向。OGPSA兼容标准后训练流程,避免大规模重放,仅需周期性计算参考梯度。在SFT、DPO及串行SFT→DPO设置下均优于基线。在串行SFT→DPO流程中,Qwen2.5-7B-Instruct平均性能提升从33.98%增至42.74%,Llama3.1-8B-Instruct从19.74%增至32.98%。代码已开源。
原文摘要 · Abstract (English)
Safety post-training can improve the harmfulness and policy compliance of Large Language Models (LLMs), but it may also reduce general utility, a phenomenon often described as the \emph{alignment tax}. We study this trade-off through the lens of continual learning: sequential alignment stages expose the model to shifted data distributions and objectives, and their gradients may interfere with directions that support previously acquired general capabilities. This view does not claim that all alignment degradation has a single cause; rather, it provides a useful first-order mechanism for mitigating one important source of capability regression. We propose \textbf{O}rthogonal \textbf{G}radient \textbf{P}rojection for \textbf{S}afety \textbf{A}lignment (\textbf{OGPSA}), a lightweight update rule that estimates a low-rank reference subspace from gradients on a small set of general-capability data and removes from each safety gradient the component lying in this subspace. The resulting update is the steepest local safety-descent direction subject to first-order preservation constraints on the reference objectives. OGPSA is compatible with standard post-training pipelines and avoids large-scale replay, although it introduces periodic reference-gradient computation. Across Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), and sequential SFT$\rightarrow$DPO settings, OGPSA improves the observed safety--utility trade-off over standard baselines. Under the sequential SFT$\rightarrow$DPO pipeline, the average performance gain increases from 33.98\% to 42.74\% on Qwen2.5-7B-Instruct and from 19.74\% to 32.98\% on Llama3.1-8B-Instruct. We have open sourced our code at https://github.com/SunGL001/OGPSA.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。