针对大型语言模型的对话响应生成中的有毒子词修剪
Toxic Subword Pruning for Dialogue Response Generation on Large Language Models
AI总结:
本文提出了一种名为ToxPrune的新型算法,通过修剪包含有毒词的子词来防止大型语言模型生成有毒内容,同时提升了对话响应生成任务中非有毒模型的表现。
摘要:
如何防御大型语言模型(LLMs)生成有毒内容是一个重要的研究领域。然而,大多数研究集中在各种模型训练技术上,通过更新权重来修复LLMs。安全对齐是一个相关研究领域,但这种方法通常成本高且繁琐,且如果不小心处理,可能会导致模型出现灾难性遗忘等问题。因此,我们提出了一种简单但有效且新颖的算法,即ToxPrune,用于修剪训练好的LLMs中的BPE子词中的有毒词。与之前的研究不同,我们发现修剪BPE标记在机器翻译任务中是有害的,但其在防止LLMs生成有毒内容方面却很有用。幸运的是,我们的发现表明,ToxPrune同时明显提升了有毒语言模型NSFW-3B在对话响应生成任务中的表现。我们还发现,ToxPrune甚至可以明显提升官方Llama-3.1-6B在对话多样性指标上的表现。广泛的自动结果和人工评估表明,ToxPrune对修复有毒LLMs和提升非有毒LLMs在对话响应生成任务中的表现都有帮助。
英文摘要:
How to defend large language models (LLMs) from generating toxic content is an important research area. Yet, most research focused on various model training techniques to remediate LLMs by updating their weights. A typical related research area is safety alignment. This however is often costly and tedious and can expose the model to even more problems such as catastrophic forgetting if the trainings are not carefully handled by experienced NLP practitioners. We thus propose a simple yet effective and novel algorithm, namely \textbf{Tox}ic Subword \textbf{Prun}ing (ToxPrune) to prune the subword contained by the toxic words from BPE in trained LLMs. In contrast to the previous work that demonstrates pruning BPE tokens as harmful to the task of machine translation, we surprisingly found its usefulness in preventing toxic content from being generated on LLMs. Fortunately, our findings suggest that ToxPrune simultaneously improves the toxic language model NSFW-3B on the task of dialogue response generation obviously. We surprisingly found that ToxPrune can even obviously improve official Llama-3.1-6B in the metric of dialogue diversity. Extensive automatic results and human evaluation indicate that ToxPrune could be helpful for both remediating toxic LLMs and improving non-toxic LLMs on the task of dialogue response generation.\footnote{We plan to release the resources to facilitate future work.}
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。