arXiv:2410.20298cs.CLcs.AI2024-10被引 6

用非平行数据让大模型学会去毒,通过博弈机制提升生成效果

Learning from Response not Preference: A Stackelberg Approach for LLM Detoxification using Non-parallel Data

  • 将去毒过程建模为领导者-追随者博弈,利用筛子反馈指导模型
  • 在无配对数据下实现与顶尖模型相当的去毒性能
  • 对检测器反馈敏感,适合需要高精度去毒的社交平台应用

文本去毒是风格迁移的一种变体,广泛应用于在线社交媒体。本文提出一种仅使用非平行数据的微调方法,使大语言模型(LLM)转变为去毒重写器。将微调过程建模为LLM(领导者)与毒性筛子(追随者,即二分类器:有毒/无毒)之间的斯塔克尔伯格博弈。LLM旨在根据筛子反馈调整偏好,生成能通过筛选的改写文本。非平行数据微调的主要挑战是偏好信息不完整:当改写失败时,输入与改写同属有毒风格,筛子无法建立偏好。因此,直接偏好优化(DPO)等方法失效。为此,我们提出斯塔克尔伯格响应优化(SRO),源自DPO,使LLM能从追随者的响应中学习。核心思想是:若改写未通过筛子,则降低其生成概率;若通过,则对原输入与改写对执行DPO。实验表明,SRO微调后的LLM在风格准确率、内容相似性和流畅性上达到与现有最优模型相当的水平,整体去毒性能超越其他计算方法并接近人类参考。额外实验证明SRO对筛子反馈敏感,轻微扰动即导致性能显著下降。代码与模型已开源。

原文摘要 · Abstract (English)

Text detoxification, a variant of style transfer tasks, finds useful applications in online social media. This work presents a fine-tuning method that only uses non-parallel data to turn large language models (LLM) into a detoxification rewritter. We model the fine-tuning process as a Stackelberg game between an LLM (leader) and a toxicity screener (follower), which is a binary style classifier (toxic or non-toxic). The LLM aims to align its preference according to the screener and generate paraphases passing the screening. The primary challenge of non-parallel data fine-tuning is incomplete preference. In the case of unsuccessful paraphrases, the classifier cannot establish a preference between the input and paraphrase, as they belong to the same toxic style. Hence, preference-alignment fine-tuning methods, such as direct preference optimization (DPO), no longer apply. To address the challenge of incomplete preference, we propose Stackelberg response optimization (SRO), adapted from DPO, to enable the LLM to learn from the follower's response. The gist is that SRO decreases the likelihood of generating the paraphrase if it fails the follower's screening while performing DPO on the pair of the toxic input and its paraphrase when the latter passes the screening. Experiments indicate that the SRO-fine-tunned LLM achieves satisfying performance comparable to state-of-the-art models regarding style accuracy, content similarity, and fluency. The overall detoxification performance surpasses other computing methods and matches the human reference. Additional empirical evidence suggests that SRO is sensitive to the screener's feedback, and a slight perturbation leads to a significant performance drop. We release the code and LLM models at \url{https://github.com/XXXinhong/Detoxification_LLM}.

去毒大模型博弈非平行数据

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。