Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
Yisong Xiao, Aishan Liu, Siyuan Liang, Zonghao Ying, Xianglong Liu, Dacheng Tao
Abstract
Large Language Models (LLMs) have demonstrated impressive performance across various tasks, yet they remain vulnerable to generating toxic content, necessitating detoxification strategies to ensure safe and responsible deployment. Test-time detoxification methods, which typically introduce static or dynamic interventions into LLM representations, offer a promising solution due to their flexibility and minimal invasiveness. However, current approaches often suffer from imprecise interventions, primarily due to their insufficient exploration of the transition space between toxic and non-toxic outputs. To address this challenge, we propose Autoregressive Reward Guided Representation Editing (ARGRE), a novel test-time detoxification framework that explicitly models toxicity transitions within the latent representation space, enabling stable and precise reward-guided editing. ARGRE identifies non-toxic semantic directions and interpolates between toxic and non-toxic representations to reveal fine-grained transition trajectories. These trajectories transform sparse toxicity annotations into dense training signals, enabling the construction of an autoregressive reward model that delivers stable and precise editing guidance. At inference, the reward model guides an adaptive two-step editing process to obtain detoxified representations: it first performs directional steering based on expected reward gaps to shift representations toward non-toxic regions, followed by lightweight gradient-based refinements. Extensive experiments across 8 widely used LLMs show that ARGRE significantly outperforms leading baselines in effectiveness (-62.21% toxicity) and efficiency (-47.58% inference time), while preserving the core capabilities of the original model with minimal degradation. Our code is available at the website.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
2 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Locating and Editing Factual Associations in GPT cites Language Models are Few-Shot Learners
- Search for Truth from Reasoning: A Dynamic Representation Editing Framework for Steering LLM Trajectories cites Locating and Editing Factual Associations in GPT
- Distillation Traps and Guards: A Calibration Knob for LLM Distillability cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Distillation Traps and Guards: A Calibration Knob for LLM Distillability cites Training language models to follow instructions with human feedback
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Language Models are Few-Shot Learners
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Training language models to follow instructions with human feedback
- Language Models are Few-Shot Learners cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
- Training language models to follow instructions with human feedback cites Language Models are Few-Shot Learners
Cited by top-tier papers2
- Search for Truth from Reasoning: A Dynamic Representation Editing Framework for Steering LLM TrajectoriesTianlong Wang, Yuhang Wang, Weibin Liao, Xin Gao et al.ICML 2026 · 1 citation
- Distillation Traps and Guards: A Calibration Knob for LLM DistillabilityWeixiao Zhan, Yongcheng Jing, Leszek Rutkowski, Dacheng TaoACL 2026
Builds on36
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 citations
Related papers
- From Chaos to Cure: A Prefix Heuristics Guided Model-Agnostic Adaptive Detoxification FrameworkYuhu Shang, Xiang Cheng, Yimeng Ren, Huijia Wu et al.AAAI 2026
- CausalDetox: Causal Head Selection and Intervention for Language Model DetoxificationYian Wang, Yuen Chen, Agam Goyal, Hari SundaramACL Findings 2026
- Test-Time Detoxification without Training or Learning AnythingBaturay Saglam, Dionysios KalogeriasICML 2026 · 2 citations
- Systematic Rectification of Language Models via Dead-end AnalysisMeng Cao, Mehdi Fatemi, Jackie C. K. Cheung, Samira ShabanianICLR 2023 · 2 citations
- Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge EditingYifan Lu, Jing Li, Yigeng Zhou, Yihui Zhang et al.ACL Findings 2025
