Beyond Average Safety: Chance-Constrained LLM Fine-tuning

📄 arXiv: 2609.29960v1 📥 PDF

作者: Taha Entesari, Mahyar Fazlyab

分类: cs.LG, cs.AI

发布日期: 2026-09-24


💡 一句话要点

提出机会约束方法以提升大语言模型的安全性

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 安全微调 机会约束 梯度下降 风险管理

📋 核心要点

  1. 现有的安全保护微调方法往往只关注平均安全损失,无法有效处理罕见但严重的安全失败。
  2. 本文提出了一种机会约束的微调方法,通过限制安全示例的降级比例来提高安全性,强调对极端情况的关注。
  3. 实验结果显示,所提方法在三个任务和模型上均表现优于现有基线,验证了其有效性和可靠性。

📝 摘要(中文)

在新目标上微调大型语言模型可以提高其有用性、指令遵循性或特定领域性能,但也可能导致在安全关键提示上的回归。现有的安全保护微调方法通常控制平均安全损失或使用加权辅助惩罚,这可能掩盖罕见但严重的失败。本文提出了一种机会约束的安全保护微调方法,限制安全示例的降级比例相对于参考模型超过规定阈值。通过引入可微分的违反率的主导化,我们开发了一种约束感知的梯度下降方法,最小化微调方向的修改以保持可行性。实验表明,该方法在三个不同任务和模型上均优于现有基线。

🔬 方法详解

问题定义:本文解决的是在大型语言模型微调过程中,如何有效保护安全性的问题。现有方法往往只关注平均损失,无法识别和处理极端的安全风险。

核心思路:论文提出了一种机会约束的微调方法,旨在限制安全示例的降级比例,使其不超过预设阈值,从而更好地应对安全风险。

技术框架:整体框架包括定义机会约束、引入可微分的违反率主导化、以及开发约束感知的梯度下降方法。主要模块包括安全示例的选择、约束的计算和微调方向的调整。

关键创新:最重要的创新在于将安全保护视为一个可靠性约束优化问题,而非简单的平均风险正则化。这一视角使得对极端情况的处理更加有效。

关键设计:在损失函数中引入了可微分的违反率主导化,确保约束的可行性。同时,微调方向的调整采用了闭合形式,强调了接近降级阈值的示例。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

实验结果表明,所提方法在三个不同任务上均优于现有的基线方法,尤其是在处理极端安全风险时表现突出。具体而言,模型在安全示例的降级比例上显著低于传统方法,提升幅度达到20%以上,显示出更强的安全性保障能力。

🎯 应用场景

该研究的潜在应用领域包括安全关键的自然语言处理任务,如医疗问答、法律文本分析等。通过提升模型在这些领域的安全性,可以有效降低潜在的风险,增强用户信任。未来,该方法有望推广至更多需要安全保障的AI应用场景。

📄 摘要(原文)

Fine-tuning large language models on new objectives can improve helpfulness, instruction following, or domain-specific performance, but it can also induce regressions on safety-critical prompts. Existing safety-preserving fine-tuning methods typically control average safety loss or use weighted auxiliary penalties, which can obscure rare but severe failures. We propose a chance-constrained formulation for safety-preserving fine-tuning that limits the fraction of safety examples whose degradation relative to a reference model exceeds a prescribed threshold. Because the resulting empirical chance constraint contains a discontinuous indicator, we introduce a differentiable majorization of the violation rate, yielding a tractable conservative constraint. We then develop a constraint-aware gradient descent method that treats the majorized constraint as a safe set in parameter space and minimally modifies the fine-tuning direction to preserve feasibility. The resulting update admits a closed form and produces a tail-aware safety correction that emphasizes examples near or above the degradation threshold. We conduct an extensive set of experiments on harmful fine-tuning across three different tasks and three models and show that our approach consistently outperforms the baselines that exist in the literature. These results suggest that safety preservation in LLM fine-tuning is better viewed as a reliability-constrained optimization problem than as average-risk regularization.