Test-Time Detoxification without Training or Learning Anything
Not on the map. Why?
Abstract (arXiv)
Large language models can produce toxic or inappropriate text even for benign inputs, creating risks when deployed at scale. Detoxification is therefore important for safety and user trust, particularly when we want to reduce harmful content without sacrificing the model's generation quality. Many existing approaches rely on model retraining, gradients, or learned auxiliary components, which can be costly and may not transfer across model families or to truly black-box settings. We introduce a test-time procedure that approximates the gradient of completion toxicity with respect to the input embeddings and uses a small number of descent steps to steer generation toward less toxic continuations. This is achieved with zeroth-order optimization that requires only access to input embeddings, a toxicity scoring function, and forward evaluations of the model. Empirically, the approach delivers robust toxicity reductions across models and prompts and, in most settings, achieves the best overall toxicity-quality trade-off. More broadly, our work positions word embeddings as effective control variables and encourages wider use of black-box optimization to guide autoregressive language models toward scalable, safer text generation, without requiring any training or access to intermediate computations.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 42 of its 56 references that are in the map. First posted on arXiv 14 Jan 2026.
Builds on
42 of 56 references.
References · 42
- 2017Attention Is All You Needcited by 59,932
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 793
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 434
- 2021BOLD: Dataset and Metrics for Measuring Biases in Open-Ended Language Generationcited by 410
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 377
- 2021FUDGE: Controlled Text Generation With Future Discriminatorscited by 374
- 2023Fine-Tuning Language Models with Just Forward Passescited by 337
- 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 336
30 more
- 2022Quark: Controllable Text Generation with Reinforced Unlearningcited by 236
- 2024SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decodingcited by 233
- 2021Challenges in Detoxifying Language Modelscited by 169
- 2020Recipes for Safety in Open-domain Chatbotscited by 168
- 2023Reward-Augmented Decoding: Efficient Controlled Text Generation With a Unidirectional Reward Modelcited by 79
- 2023Word Embeddings Are Steers for Language Modelscited by 70
- 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 67
- 2024Sparse MeZO: Less Parameters for Better Performance in Zeroth-Order LLM Fine-Tuningcited by 53
- 2024Variance-reduced Zeroth-Order Methods for Fine-Tuning Language Modelscited by 50
- 2024Enhancing Zeroth-order Fine-tuning for Language Models with Low-rank Structurescited by 48
- 2022Critic-Guided Decoding for Controlled Text Generationcited by 45
- 2023Self-Detoxifying Language Models via Toxification Reversalcited by 45
- 2023On the Challenges of Using Black-Box APIs for Toxicity Evaluation in Researchcited by 44
- 2023Click: Controllable Text Generation with Sequence Likelihood Contrastive Learningcited by 41
- 2022DIRECTOR: Generator-Classifiers For Supervised Language Modelingcited by 38
- 2023DPZero: Private Fine-Tuning of Language Models without Backpropagationcited by 26
- 2023Unveiling Safety Vulnerabilities of Large Language Modelscited by 26
- 2024Localized Zeroth-Order Prompt Optimizationcited by 23
- 2024Parameter-Efficient Detoxification with Contrastive Decodingcited by 18
- 2023Systematic Rectification of Language Models via Dead-end Analysiscited by 16
- 2022Language Detoxification with Attribute-Discriminative Latent Spacecited by 11
- 2024DESTEIN: Navigating Detoxification of Language Models via Universal Steering Pairs and Head-wise Activation Fusioncited by 9
- 2025UniDetox: Universal Detoxification of Large Language Models via Dataset Distillationcited by 8
- 2024Attribute Controlled Fine-tuning for Large Language Models: A Case Study on Detoxificationcited by 7
- 2024Supporting Human Raters with the Detection of Harmful Content using Large Language Modelscited by 4
- 2025DSCD: Large Language Model Detoxification with Self-Constrained Decodingcited by 3
- 2023Model-Free Learning of Two-Stage Beamformers for Passive IRS-Aided Network Designcited by 2
- 2024Compatible Gradient Approximations for Actor-Critic Algorithmscited by 2
- 2024Data-Driven Learning of Two-Stage Beamformers in Passive IRS-Assisted Systems with Inexact Oraclescited by 1
- 2025DAPI: Domain Adaptive Toxicity Probe Vector Intervention for Fine-Grained Detoxificationcited by 1
Built on by
Citing papers per year: 2026: 2.
2 papers.
- 2026Test-Time Safety Alignmentcited by 2
- 2026Self-Improving In-Context Learningcited by 0
- 2026Self-Improving In-Context Learning22 May 2026
- 2026Test-Time Safety Alignment28 Apr 2026