mlsanityData to 7 Oct 2026

Contrastive Perplexity for Controlled Generation: An Application in Detoxifying Large Language Models

arXiv 2401.08491 ↗First posted 16 Jan 2024cs.CL cs.LGcited by 1

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

  1. 2017Proximal Policy Optimization Algorithmscited by 14,441
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  4. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  5. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  6. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  7. 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
  8. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
  9. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
  10. 2017Deep reinforcement learning from human preferencescited by 3,846
  11. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
  12. 2016Pointer Sentinel Mixture Modelscited by 2,992
37 more
  1. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  2. 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
  3. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  4. 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
  5. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
  6. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
  7. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
  8. 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
  9. 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 793
  10. 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 754
  11. 2022Contrastive Decoding: Open-ended Text Generation as Optimizationcited by 598
  12. 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Studycited by 478
  13. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
  14. 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 434
  15. 2023How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resourcescited by 405
  16. 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 377
  17. 2021FUDGE: Controlled Text Generation With Future Discriminatorscited by 374
  18. 2023Toxicity in ChatGPT: Analyzing Persona-assigned Language Modelscited by 356
  19. 2022Generating Sequences by Learning to Self-Correctcited by 271
  20. 2023Camels in a Changing Climate: Enhancing LM Adaptation with Tulu 2cited by 227
  21. 2020Learning from the Worst: Dynamically Generated Datasets to Improve Online Hate Detectioncited by 217
  22. 2020HateBERT: Retraining BERT for Abusive Language Detection in Englishcited by 206
  23. 2022SGPT: GPT Sentence Embeddings for Semantic Searchcited by 204
  24. 2018Learning to Write with Cooperative Discriminatorscited by 119
  25. 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 106
  26. 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 67
  27. 2023Controlled Text Generation via Language Model Arithmeticcited by 51
  28. 2022Detoxifying Text with MaRCo: Controllable Revision with Experts and Anti-Expertscited by 36
  29. 2018Generating More Interesting Responses in Neural Conversation Models with Distributional Constraintscited by 33
  30. 2023Inference-Time Policy Adapters (IPA): Tailoring Extreme-Scale LMs without Fine-tuningcited by 33
  31. 2023The Benefits of Bad Advice: Autocontrastive Decoding across Model Layerscited by 28
  32. 2023Contrastive Learning of Sentence Embeddings from Scratchcited by 24
  33. 2020Adapting a Language Model for Controlled Affective Text Generationcited by 22
  34. 2022Supervised Contrastive Learning with Hard Negative Samplescited by 13
  35. 2023CMD: a framework for Context-aware Model self-Detoxificationcited by 6
  36. 2023Controlled Text Generation with Hidden Representation Transformationscited by 4
  37. 2023Synthetic Hard Negative Samples for Contrastive Learningcited by 2

Built on by

Cited by year

Citing papers per year: 2024: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
  2. 2024QCRD: Quality-guided Contrastive Rationale Distillation for Large Language Models
  3. 2026Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models
  4. 2025Efficient Response Generation Strategy Selection for Fine-Tuning Large Language Models Through Self-Aligned Perplexity
  5. 2026Characterising Toxicity in Generative Large Language Models
  6. 2024Detoxifying Large Language Models via Knowledge Editing
  7. 2023Contrastive Decoding Improves Reasoning in Large Language Models
  8. 2025Turning Logic Against Itself : Probing Model Defenses Through Contrastive Questions