CMD:一个上下文感知的模型自我去毒框架
CMD: a framework for Context-aware Model self-Detoxification
AI总结:
针对文本去毒中生成质量与去毒效果难以平衡的问题,提出上下文感知的模型自我去毒框架CMD,通过先对上下文去毒再引导模型生成,并引入有毒对比损失,在多种LLM上取得最佳性能。
摘要:
文本去毒旨在最小化语言模型产生有毒内容的风险。现有的去毒方法,无论是直接约束模型输出还是在无毒语料上进一步训练模型,都未能实现去毒效果与生成质量之间的良好平衡。这一问题源于对上下文施加约束的忽视,因为语言模型被设计为生成与上下文紧密匹配的输出,而去毒方法则致力于确保输出的安全性,即使它在语义上偏离了上下文。鉴于此,我们引入了上下文感知的模型自我去毒(CMD)框架,该框架同时关注上下文和去毒过程,即首先对上下文进行去毒,然后使语言模型沿着安全的上下文生成。具体而言,CMD框架包含两个阶段:利用语言模型合成数据,并应用这些数据进行训练。我们还引入了有毒对比损失,鼓励模型生成远离负面的有毒样本。在多种LLM上的实验验证了我们MSD框架的有效性,与基线相比,它能产生最佳的性能。
英文摘要:
Text detoxification aims to minimize the risk of language models producing toxic content. Existing detoxification methods of directly constraining the model output or further training the model on the non-toxic corpus fail to achieve a decent balance between detoxification effectiveness and generation quality. This issue stems from the neglect of constrain imposed by the context since language models are designed to generate output that closely matches the context while detoxification methods endeavor to ensure the safety of the output even if it semantically deviates from the context. In view of this, we introduce a Context-aware Model self-Detoxification~(CMD) framework that pays attention to both the context and the detoxification process, i.e., first detoxifying the context and then making the language model generate along the safe context. Specifically, CMD framework involves two phases: utilizing language models to synthesize data and applying these data for training. We also introduce a toxic contrastive loss that encourages the model generation away from the negative toxic samples. Experiments on various LLMs have verified the effectiveness of our MSD framework, which can yield the best performance compared to baselines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。