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

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.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.acl-long.125
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Moin Nabi, Tassilo Klein
Natural Language Processing Techniques
article

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

Moin Nabi, Tassilo Klein
article en

Abstract

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.

Openalex Percentile: Top 90%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.