arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.37481cs.LGcs.AIcs.CL
收藏

追踪梯度:将安全退化溯源至训练数据

Follow the Gradient: Tracing Safety Degradation Back to Training Data

DatologyAI(达托洛吉AI);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Saket Reddy, Amro Abbas, Anshuman Suri, Ari Morcos, David Schwab, Pratyush Maini

AI总结:

本研究提出SimpleLoRIF梯度嵌入方法,构建SafeTulu模型,移除20%与不安全响应梯度对齐的样本,可降低GCG攻击成功率最多22%,优于现有方法且保留模型能力。

摘要:

在指令数据上微调大语言模型(LLM)会悄悄削弱其安全性,即便没有任何训练样本看起来有害。由于这类导致安全退化的数据看似良性,标准内容过滤器难以捕捉。我们开发了SimpleLoRIF,一种可扩展的梯度嵌入方法,用于识别梯度与不安全行为对齐的微调样本。通过简化低秩归因方法并将反向传播限制在最后四个Transformer块,SimpleLoRIF可嵌入百万级样本的数据集,将梯度归因从小规模分析工具升级为适用于完整后训练数据集的实用过滤器。我们首先在涌现失配场景中验证该方法,发现梯度可将不安全代码训练数据与微调后出现的广泛有害行为关联,在失配模型的梯度空间中AUC高达0.865。随后我们用SimpleLoRIF构建了SafeTulu,即移除了20%与不安全响应梯度最对齐样本的Tulu 3版本。在Qwen、Llama和Olmo上使用SafeTulu训练可将GCG攻击成功率降低最多22%,优于LLM-as-a-judge和现有基于梯度的过滤方法,同时基本保留甚至提升了模型能力。最后,我们分析了被移除的数据,识别出可能被低估的安全退化来源,如工具执行失败和叙事算术。我们发布了SafeTulu以及一个Hugging Face Space,供研究人员构建自定义版本的SafeTulu,例如调整移除比例或仅过滤特定子集。

英文摘要:

Fine-tuning Large Language Models (LLMs) on instruction data can quietly erode their safety, even when no training example looks harmful. Because this safety-degrading data looks benign, standard content filters struggle to catch it. We tackle this problem by developing SimpleLoRIF, a scalable gradient embedding method that identifies fine-tuning examples whose gradients align with unsafe behavior. By simplifying a low-rank attribution method and restricting backpropagation to the final four transformer blocks, SimpleLoRIF can embed datasets on the order of a million examples, boosting gradient attribution from a small-scale analysis tool into a practical filter for full post-training datasets. We first validate it on emergent misalignment, where we find that gradients can connect insecure-code training data to the broadly harmful behaviors that appear after fine-tuning, with AUC as high as 0.865 in the gradient space of misaligned models. We then use SimpleLoRIF to build SafeTulu, a version of Tulu 3 with the 20% of examples most gradient-aligned with unsafe responses removed. Training on SafeTulu reduces GCG attack success rate by up to 22% across Qwen, Llama, and Olmo, outperforming both LLM-as-a-judge and prior gradient-based filtering, while largely preserving or even improving capability. Finally, we analyzed the removed data and identify possibly under-studied sources of safety degradation, such as tool-execution failures and narrative arithmetic. We release SafeTulu along with a Hugging Face Space that lets researchers build their own customized versions of SafeTulu to fine-tune on, such as by changing the removal fraction or filtering only certain subsets.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑