Contrastive Perplexity for Controlled Generation: An Application in Detoxifying Large Language Models
Not on the map. Why?
Abstract (arXiv)
The generation of toxic content by large language models (LLMs) remains a critical challenge for the safe deployment of language technology. We propose a novel framework for implicit knowledge editing and controlled text generation by fine-tuning LLMs with a prototype-based contrastive perplexity objective. Central to our method is the construction of hard negatives - toxic outputs that are generated through adversarial paraphrasing to be semantically similar and model probability to their non-toxic counterparts. By training on these challenging and realistic pairs, our approach ensures robust and stable contrastive optimization. Experimental results in the domain of detoxification demonstrate that our method significantly reduces toxic generation while maintaining strong performance on downstream tasks such as commonsense reasoning and reading comprehension. Our findings highlight the effectiveness of exploiting hard negatives for attribute-aware fine-tuning.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 49 of its 74 references that are in the map. First posted on arXiv 16 Jan 2024.
Builds on
49 of 74 references.
References · 49
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
- 2017Deep reinforcement learning from human preferencescited by 3,846
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
- 2016Pointer Sentinel Mixture Modelscited by 2,992
37 more
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
- 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
- 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 793
- 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 754
- 2022Contrastive Decoding: Open-ended Text Generation as Optimizationcited by 598
- 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Studycited by 478
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 434
- 2023How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resourcescited by 405
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 377
- 2021FUDGE: Controlled Text Generation With Future Discriminatorscited by 374
- 2023Toxicity in ChatGPT: Analyzing Persona-assigned Language Modelscited by 356
- 2022Generating Sequences by Learning to Self-Correctcited by 271
- 2023Camels in a Changing Climate: Enhancing LM Adaptation with Tulu 2cited by 227
- 2020Learning from the Worst: Dynamically Generated Datasets to Improve Online Hate Detectioncited by 217
- 2020HateBERT: Retraining BERT for Abusive Language Detection in Englishcited by 206
- 2022SGPT: GPT Sentence Embeddings for Semantic Searchcited by 204
- 2018Learning to Write with Cooperative Discriminatorscited by 119
- 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 106
- 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 67
- 2023Controlled Text Generation via Language Model Arithmeticcited by 51
- 2022Detoxifying Text with MaRCo: Controllable Revision with Experts and Anti-Expertscited by 36
- 2018Generating More Interesting Responses in Neural Conversation Models with Distributional Constraintscited by 33
- 2023Inference-Time Policy Adapters (IPA): Tailoring Extreme-Scale LMs without Fine-tuningcited by 33
- 2023The Benefits of Bad Advice: Autocontrastive Decoding across Model Layerscited by 28
- 2023Contrastive Learning of Sentence Embeddings from Scratchcited by 24
- 2020Adapting a Language Model for Controlled Affective Text Generationcited by 22
- 2022Supervised Contrastive Learning with Hard Negative Samplescited by 13
- 2023CMD: a framework for Context-aware Model self-Detoxificationcited by 6
- 2023Controlled Text Generation with Hidden Representation Transformationscited by 4
- 2023Synthetic Hard Negative Samples for Contrastive Learningcited by 2
Built on by
Citing papers per year: 2024: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
- 2024QCRD: Quality-guided Contrastive Rationale Distillation for Large Language Models
- 2026Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models
- 2025Efficient Response Generation Strategy Selection for Fine-Tuning Large Language Models Through Self-Aligned Perplexity
- 2026Characterising Toxicity in Generative Large Language Models
- 2024Detoxifying Large Language Models via Knowledge Editing
- 2023Contrastive Decoding Improves Reasoning in Large Language Models
- 2025Turning Logic Against Itself : Probing Model Defenses Through Contrastive Questions