用影响函数主动剔除训练数据中的有害内容,显著降低大模型毒性。
IF-GUIDE: Influence Function-Guided Detoxification of LLMs
- 通过改进影响函数,定位训练数据中导致毒性的具体词元。
- 在预训练和微调中均减少毒性强达10倍,优于现有对齐方法3倍以上。
- 无需人类偏好数据,小模型即可高效识别有害样本,适合安全训练场景。
我们研究训练数据如何引发大语言模型的毒性行为。多数先前工作采用事后修正策略,如对已有毒模型进行微调以对齐人类价值观。本文提出主动防御方法IF-GUIDE,利用影响函数识别并抑制训练数据中的有害词元。首先发现标准影响函数难以发现有害训练记录;随后提出新方法,测量训练数据词元对模型毒性的贡献,并结合文档筛选技术和可嵌入预训练与微调的学习目标。该方法不依赖人类偏好数据。实验表明,IF-GUIDE在预训练和微调中均能将显性和隐性毒性降低至未净化模型的1/10,比DPO和RAD等基线方法降低1/3。计算高效:仅需百万参数模型(比百亿模型少7.5倍)即可有效代理识别有害数据。代码已开源。
原文摘要 · Abstract (English)
We study how training data contributes to the emergence of toxic behaviors in large language models. Most prior work on reducing model toxicity adopts reactive approaches, such as fine-tuning pre-trained (and potentially toxic) models to align them with human values. In contrast, we propose a proactive approach, IF-GUIDE, that leverages influence functions to identify and suppress harmful tokens in the training data. To this end, we first show that standard influence functions are ineffective at discovering harmful training records. We then present a novel adaptation that measures token-level attributions from training data to model toxicity, along with techniques for selecting toxic training documents and a learning objective that can be integrated into both pre-training and fine-tuning. Moreover, IF-GUIDE does not rely on human-preference data, which is typically required by existing alignment methods. In our evaluation, we demonstrate that IF-GUIDE substantially reduces both explicit and implicit toxicity-by up to 10$\times$ compared to uncensored models, and up to 3$\times$ compared to baseline alignment methods such as DPO and RAD-across both pre-training and fine-tuning scenarios. IF-GUIDE is computationally efficient: a billion-parameter model is not necessary for computing influence scores; a million-parameter model-with 7.5$\times$ fewer parameters-can effectively serve as a proxy for identifying harmful data. Our code is publicly available at: https://github.com/ztcoalson/IF-Guide
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。