基于实例级前缀的大语言模型细粒度去毒方法
Fine-Grained Detoxification via Instance-Level Prefixes for Large Language Models
AI总结:
本文提出 FGDILP 方法,通过实例级正负前缀对比构建细粒度亚毒性向量并融合校正生成过程,在不增加额外成本的情况下实现大语言模型可控去毒,性能优于提示基线方法。
摘要:
通过训练大语言模型(LLMs),自然语言处理(NLP)任务取得了令人瞩目的成果。然而,这些模型在响应某些提示时偶尔会产生侮辱、威胁和亵渎等有毒内容,从而限制了其实际应用价值。为了解决这一问题,人们采用了各种基于微调和基于解码的方法来减轻毒性。然而,这些方法通常需要额外的成本,例如高质量的训练数据或辅助模型。在本文中,我们提出了基于实例级前缀的细粒度去毒方法(FGDILP),以在不增加额外成本的情况下减轻有毒文本。具体而言,FGDILP 在实例级别上将使用正向前缀前置提示与多个负向前缀前置提示在注意力空间中的上下文表示进行对比。这使得能够构建细粒度的亚毒性向量,从而在给定原始提示时,通过融合这些向量来校正正常生成过程,实现协同去毒。我们验证了 FGDILP 能够在话语级别和上下文级别上实现关于毒性的可控文本生成。我们的方法在去毒方面优于基于提示的基线方法,尽管在生成流畅性和多样性方面略有代价。
英文摘要:
Impressive results have been achieved in natural language processing (NLP) tasks through the training of large language models (LLMs). However, these models occasionally produce toxic content such as insults, threats, and profanity in response to certain prompts, thereby constraining their practical utility. To tackle this issue, various finetuning-based and decoding-based approaches have been utilized to mitigate toxicity. However, these methods typically necessitate additional costs such as high-quality training data or auxiliary models. In this paper, we propose fine-grained detoxification via instance-level prefixes (FGDILP) to mitigate toxic text without additional cost. Specifically, FGDILP contrasts the contextualized representation in attention space using a positive prefix-prepended prompt against multiple negative prefix-prepended prompts at the instance level. This allows for constructing fine-grained subtoxicity vectors, which enables collaborative detoxification by fusing them to correct the normal generation process when provided with a raw prompt. We validate that FGDILP enables controlled text generation with regard to toxicity at both the utterance and context levels. Our method surpasses prompt-based baselines in detoxification, although at a slight cost to generation fluency and diversity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。