LLM Detoxification via Transition-Aware Reward-Guided Representation Sampling
作者: Aishan Liu, Yisong Xiao, Xianglong Liu, Yongxin Huang, Siyuan Liang, Zonghao Ying, Yang Qu, Jian Yang, Yaodong Yang, Dacheng Tao
分类: cs.AI
发布日期: 2026-10-30
💡 一句话要点
提出TARGRS以解决大语言模型生成有毒内容的问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 去毒化 奖励引导 表示采样 毒性生成 潜在表示 动态建模 多模态模型
📋 核心要点
- 现有的去毒化方法多依赖静态干预,无法准确建模毒性与非毒性之间的过渡,导致效果不佳。
- 本文提出的TARGRS框架通过学习毒性过渡的奖励指导,采用逐步引导的方式在潜在空间中进行采样。
- 在多个数据集上,TARGRS在减少毒性方面表现优异,最高可减少69.38%的毒性,同时保持模型的核心能力。
📝 摘要(中文)
大语言模型(LLMs)可能生成有毒内容,因此需要有效的测试时去毒化方法。现有的表示引导方法往往依赖静态或粗略的干预,导致对有毒与非有毒生成之间的过渡建模不足,从而提供不精确的指导。本文提出了过渡感知奖励引导表示采样(TARGRS),这是一个在潜在表示空间中学习毒性过渡奖励指导的测试时框架。实验表明,TARGRS在多个基准数据集上显著优于现有方法,能够有效减少生成内容的毒性。
🔬 方法详解
问题定义:本文旨在解决大语言模型生成有毒内容的问题,现有方法在干预时缺乏对毒性与非毒性之间过渡的精确建模,导致去毒化效果不理想。
核心思路:TARGRS通过在潜在表示空间中学习毒性过渡的奖励指导,采用逐步引导的方式构建从非毒性到毒性的轨迹,从而实现更精确的去毒化干预。
技术框架:TARGRS的整体架构包括两个主要阶段:探索阶段和推理阶段。在探索阶段,通过沿毒性方向的逐步引导构建轨迹,并生成稀疏标注的密集监督;在推理阶段,利用训练好的奖励模型进行粗到细的采样。
关键创新:TARGRS的创新在于其过渡感知的奖励引导机制,能够有效地将稀疏的毒性标注转化为密集的监督信号,与现有方法相比,能够更好地捕捉毒性生成的动态变化。
关键设计:在模型设计上,TARGRS使用了特定的损失函数来优化奖励模型,并在采样过程中引入了粗细分层的策略,以确保在干预时对表示的扰动最小化。该方法还能够扩展到大视觉语言模型(LVLMs),进一步增强其应用范围。
🖼️ 关键图片
📊 实验亮点
在多个基准数据集上,TARGRS显著优于现有最先进的方法,尤其是在RealToxicityPrompts上,毒性减少幅度高达69.38%。此外,TARGRS的运行速度几乎与原始LLM相当,且对模型核心能力的影响最小。
🎯 应用场景
TARGRS的研究成果具有广泛的应用潜力,尤其是在社交媒体、在线内容生成和自动化客服等领域。通过有效减少生成内容的毒性,该方法能够提升用户体验,降低有害信息的传播风险,具有重要的社会价值和实际意义。
📄 摘要(原文)
Large Language Models (LLMs) can generate toxic content, motivating effective test-time detoxification. Existing representation steering methods often rely on static or coarse interventions and provide imprecise guidance because they inadequately model transitions between toxic and non-toxic generations. We propose Transition-Aware Reward-Guided Representation Sampling (TARGRS), a test-time framework that learns reward guidance over toxicity transitions in latent representation space. During exploration, progressive steering along the toxicity direction constructs trajectories from non-toxic to toxic states. Toxicity scores along these trajectories turn sparse annotations into dense, listwise supervision for a transition-aware token-level reward model. During inference, TARGRS uses this model to guide coarse-to-fine sampling along the opposite, non-toxic direction: coarse sampling identifies the intervention needed to reach non-toxic regions, and refinement selects a detoxified representation with minimal perturbation. Experiments on 10 LLMs across RealToxicityPrompts, BOLD, and AttaQ show that TARGRS consistently outperforms state-of-the-art baselines, reducing toxicity by up to 69.38% on RealToxicityPrompts. TARGRS runs nearly as fast as the original LLM while preserving its core capabilities with minimal impact. By intervening in the language decoder space, TARGRS also extends to Large Vision-Language Models (LVLMs), reducing toxicity by up to 64.23% across 3 representative LVLMs.