NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Click: Controllable Text Generation with Sequence Likelihood Contrastive Learning

Chujie Zheng, Pei Ke, Zheng Zhang, Minlie Huang

Abstract

Large language models (LLMs) often suffer from misalignment, generating toxic or repetitive content. We present CLICK (Controllable text generation with sequence Likelihood Contrastive Learning), a "plug-and-play" training framework designed to steer models away from undesirable behaviors. By contrasting the likelihood of model-generated "good" and "bad" sequences using a novel ranking strategy, CLICK achieves state-of-the-art control without requiring architectural changes or sacrificing text diversity.

Introduction

While LLMs are highly fluent, they are prone to generating toxic content, social biases, or unnatural repetitions. Current solutions for Controllable Text Generation (CTG) typically involve decoding-time steering, which is computationally expensive, or token-level training (e.g., Unlikelihood Training), which can be overly restrictive and degrade fluency. CLICK addresses these gaps by operating at the sequence level, optimizing the probability of entire sentences rather than individual tokens.

Methodology: The CLICK Framework

The CLICK pipeline consists of three primary stages designed to refine the model's output distribution without complex architectural modifications.

The CLICK pipeline: (1) Generation, (2) Likelihood-based sample construction, and (3) Contrastive training.
  1. Generation & Labeling: The model generates multiple continuations for a given prompt. An external classifier (label function) categorizes these as positive (desirable) or negative (undesirable).
  2. Likelihood Ranking-Based Construction: This novel step avoids random pairing. Instead, CLICK pairs each negative sample with a positive sample that has a similar likelihood. Specifically, it selects the positive sample that ranks highest in likelihood but remains less likely than the negative one. This "Goldilocks" pairing forces the model to learn subtle boundaries between desirable and undesirable content.
  3. Contrastive Training: The model is fine-tuned using a dual loss function. It combines standard Language Modeling loss (to preserve fluency) with a max-margin contrastive loss. This loss pushes the likelihood of negative sequences below their paired positive counterparts by a specific margin.

Experimental Setup

CLICK was evaluated across three distinct tasks:

  • Language Detoxification: Using the Bot-Adversarial Dialogue (BAD) dataset.
  • Sentiment Steering: Using OpenWebText prompts and SST-5 sentiment labels.
  • Repetition Reduction: Using WikiText-103 to address looping during greedy decoding.

Key Results

CLICK consistently outperforms strong baselines such as GeDi, DExperts, and Director across all metrics.

Comparison of CLICK against baselines on the detoxification task. CLICK achieves the lowest toxicity while maintaining high diversity.

In detoxification tasks, CLICK reduced toxicity probability to 0.084, significantly lower than the 0.450 of a standard non-toxic fine-tune. Crucially, it maintained the highest diversity scores (Dist-2/3 of 0.49/0.56). In sentiment steering, CLICK achieved 90-96% target accuracy, even in adversarial settings. For repetition reduction, it reached a diversity score of 0.72 and a MAUVE score of 0.93, vastly improving upon the standard MLE baseline.

Discussion and Insights

The success of CLICK stems from its sequence-level approach. By optimizing the likelihood of the entire sequence, the model retains the "freedom" to use specific words as long as the overall path is deemed undesirable. The authors also highlighted the importance of the likelihood gap; pairing samples with similar likelihoods prevents overfitting and ensures the model focuses on the target attribute (e.g., toxicity) rather than just general fluency.

Limitations

The framework's performance is inherently tied to the quality of the external "label function." Biases or inaccuracies in the classifier will be inherited by the model. Additionally, while iterative training can further reduce toxicity, there is a trade-off where excessive training may eventually degrade fluency and increase perplexity.

Summary updated

BibTeX
@inproceedings{zheng2023click,
  author = {Chujie Zheng and Pei Ke and Zheng Zhang and Minlie Huang},
  title = {{Click: Controllable Text Generation with Sequence Likelihood Contrastive Learning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.65},
}
Figure