自我解毒语言模型:通过毒化逆转实现
Self-Detoxifying Language Models via Toxification Reversal
AI总结:
本文提出一种轻量级语言模型自我解毒方法,通过识别并逆转毒化方向,无需微调或额外组件,实现与最先进方法相当的解毒性能。
摘要:
语言模型解毒旨在最小化预训练语言模型(PLMs)生成冒犯性或有害内容的风险,以实现更安全的部署。现有方法大致可分为基于微调和基于解码的两类。然而,前者通常资源密集,而后者依赖额外组件并可能损害生成流畅性。在本文中,我们提出了一种更轻量级的方法,使PLM自身能够实现“自我解毒”。我们的方法基于一个观察:前置负面引导提示能有效诱导PLM生成有毒内容。同时,我们受到可解释性领域近期研究的启发,该研究将PLM内演化的上下文表示描述为由注意力层促进的信息流。基于此思想,我们设计了一种方法,从正常生成过程到带有负面前缀的生成过程识别毒化方向,然后通过操纵注意力层内的信息流动,将生成引导至相反方向。实验结果表明,我们的方法无需任何微调或额外组件,即可达到与最先进方法相当的性能。
英文摘要:
Language model detoxification aims to minimize the risk of generating offensive or harmful content in pretrained language models (PLMs) for safer deployment. Existing methods can be roughly categorized as finetuning-based and decoding-based. However, the former is often resource-intensive, while the latter relies on additional components and potentially compromises the generation fluency. In this paper, we propose a more lightweight approach that enables the PLM itself to achieve "self-detoxification". Our method is built upon the observation that prepending a negative steering prompt can effectively induce PLMs to generate toxic content. At the same time, we are inspired by the recent research in the interpretability field, which formulates the evolving contextualized representations within the PLM as an information stream facilitated by the attention layers. Drawing on this idea, we devise a method to identify the toxification direction from the normal generation process to the one prompted with the negative prefix, and then steer the generation to the reversed direction by manipulating the information movement within the attention layers. Experimental results show that our approach, without any fine-tuning or extra components, can achieve comparable performance with state-of-the-art methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。