用轻量校准模型提升大模型输出安全性,不损失流畅性。
Detoxification of Large Language Models through Output-layer Fusion with a Calibration Model
- 引入小型校准模型,通过生成管道轻干预实现去毒
- 一次训练可适配多个大模型,保持语义连贯性
- 无需重训大模型,适合快速部署到各类应用
现有大语言模型去毒方法多依赖大规模无毒数据训练、提示工程或参数修改,存在计算成本高、鲁棒性差、影响流畅性与上下文理解的问题。本文提出一种简单有效的去毒方法:利用一个小型预训练校准模型,通过轻量级干预目标大模型的生成流程,引导其避开有害内容。该校准模型从无毒数据中学习去毒嵌入空间,有效抑制毒性输出。只需一次训练,即可无缝应用于多个大模型,且不损害流畅性与上下文理解能力。在基准数据集上的实验表明,该方法显著降低毒性,同时保持合理的内容表达。
原文摘要 · Abstract (English)
Existing approaches for Large language model (LLM) detoxification generally rely on training on large-scale non-toxic or human-annotated preference data, designing prompts to instruct the LLM to generate safe content, or modifying the model parameters to remove toxic information, which are computationally expensive, lack robustness, and often compromise LLMs' fluency and contextual understanding. In this paper, we propose a simple yet effective approach for LLM detoxification, which leverages a compact, pre-trained calibration model that guides the detoxification process of a target LLM via a lightweight intervention in its generation pipeline. By learning a detoxified embedding space from non-toxic data, the calibration model effectively steers the LLM away from generating harmful content. This approach only requires a one-time training of the calibration model that is able to be seamlessly applied to multiple LLMs without compromising fluency or contextual understanding. Experiment results on the benchmark dataset demonstrate that our approach reduces toxicity while maintaining reasonable content expression.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。