atlas

Research map / Large language models / Instruction and fine-tuning

Large Language Models can Become Strong Self-Detoxifiers

ICLR 2025 · Large language models › Instruction and fine-tuning · approach: Efficient LLM fine-tuning systems

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes SASA, a training-free controlled decoding method that learns a Bayes-optimal linear toxic/non-toxic subspace from the LM's own embeddings and reweights next-token sampling by the margin to reduce toxicity.

Problem

Reducing toxic output of LLMs at inference time without an external reward model or any retraining, while keeping fluency.

Approach

Learn a closed-form Gaussian discriminant (linear) subspace over the LM's own last-token context embeddings from a labeled toxicity dataset, and at each decoding step add beta times the softmax-normalized margin to the logits; the paper proves this is the optimal solution to an expected-margin minus KL-regularized objective.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply SASA β=500 instead of the unmodified modelGPT2-Large · RTP non-toxic promptsAvg. Max Toxicity: 0.327 -> 0.083Helped
Use SASA β=500 instead of RAD β=500GPT2-Large · RTP non-toxic promptsAvg. Max Toxicity: 0.114 -> 0.083Helped
Apply SASA β=500 instead of the unmodified modelLlama-2-7B · RTP non-toxic promptsToxic Rate: 0.190 -> 0.021Helped
Use SASA β=500 instead of RAD β=500Llama-2-7B · RTP challengingAvg. Max Toxicity: 0.481 -> 0.426Helped
Use SASA β=500 instead of RAD β=500Llama-2-7B · RTP challengingPerplexity: 7.33 -> 7.20Helped
Apply SASA β=500 instead of the unmodified modelLlama-2-7B · BOLD first 1000 samplesAvg. Max Toxicity: 0.214 -> 0.0229Helped
Use SASA β=500 instead of RAD β=500Llama-2-7B · AttaQAvg. Max Toxicity: 0.264 -> 0.142Helped
Apply SASA β=500 instead of the unmodified modelLlama-3.1-8B-Instruct · RTP challengingToxic Rate: 0.892 -> 0.171Helped
Add word filtering to SASA β=500 (ablation)SASA on Llama-2-7B · RTP challengingAvg. Max Toxicity: 0.426 -> 0.178Helped
Add word filtering to SASA β=500 (ablation)SASA on Llama-2-7B · RTP challengingPerplexity: 7.195 -> 19.657Hurt

Surprising findings

Limitations

Experimental setup

Datasets: Jigsaw Unintended Bias in Toxicity Classification RealToxicityPrompts BOLD AttaQ

Benchmarks: RealToxicityPrompts BOLD AttaQ

Metrics: average maximum toxicity toxic rate perplexity

Baselines: RAD PPLM GeDi DExperts Rectification DAPT PPO Quark Self-Debiasing ToxificationReversal

Builds on: RAD PPLM Rectification

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy