Skip to main content
QUICK REVIEW

[Paper Review] A Simple Contrastive Learning Objective for Alleviating Neural Text Degeneration

Shaojie Jiang, Ruqing Zhang|arXiv (Cornell University)|May 5, 2022
Topic ModelingComputer Science10 citations
TL;DR

This paper proposes a contrastive token (CT) learning objective that explicitly contrasts positive (ground-truth) tokens against negative (repetitive) candidates during training, improving text generation quality by reducing repetition. The method combines cross-entropy and unlikelihood objectives, achieving state-of-the-art results on text degeneration with minimal perplexity cost and significantly lower repetition rates in both language modeling and open-domain dialogue tasks.

ABSTRACT

The cross-entropy objective has proved to be an all-purpose training objective for autoregressive language models (LMs). However, without considering the penalization of problematic tokens, LMs trained using cross-entropy exhibit text degeneration. To address this, unlikelihood training has been proposed to reduce the probability of unlikely tokens predicted by LMs. But unlikelihood does not consider the relationship between the label tokens and unlikely token candidates, thus showing marginal improvements in degeneration. We propose a new contrastive token learning objective that inherits the advantages of cross-entropy and unlikelihood training and avoids their limitations. The key idea is to teach a LM to generate high probabilities for label tokens and low probabilities of negative candidates. Comprehensive experiments on language modeling and open-domain dialogue generation tasks show that the proposed contrastive token objective yields much less repetitive texts, with a higher generation quality than baseline approaches, achieving the new state-of-the-art performance on text degeneration.

Motivation & Objective

  • To address neural text degeneration, a common failure mode in autoregressive language models where repetition of tokens, phrases, or sentences occurs.
  • To overcome the limitations of cross-entropy and unlikelihood training, which fail to distinguish between negative (repetitive) and irrelevant tokens in the vocabulary.
  • To design a training objective that explicitly contrasts positive (correct) tokens against negative (repetitive) candidates to suppress unwanted repetition.
  • To improve generation quality by reducing repetition while maintaining or slightly increasing perplexity.
  • To achieve state-of-the-art performance on text degeneration in both language modeling and open-domain dialogue generation tasks.

Proposed method

  • The CT objective is defined as a contrastive loss that maximizes the probability of the ground-truth (positive) token while minimizing the probability of a set of negative candidates.
  • Negative candidates are selected as the preceding M tokens in the sequence, representing likely repetition patterns.
  • The method combines the CT objective with standard cross-entropy loss to preserve language modeling capacity while reducing degeneration.
  • The model is trained end-to-end using both objectives during the autoregressive generation process.
  • The CT objective is applied at each decoding step, contrasting the true next token with the M most recent tokens as negative examples.
  • The approach avoids boosting irrelevant tokens by focusing only on contextually relevant negative candidates, reducing noise and improving suppression of repetition.

Experimental results

Research questions

  • RQ1Can a contrastive learning objective that explicitly contrasts positive and negative tokens reduce text degeneration more effectively than cross-entropy or unlikelihood training?
  • RQ2Does focusing on recent context tokens as negative candidates improve repetition suppression compared to using all previous tokens?
  • RQ3Can the CT objective maintain low perplexity while significantly reducing repetition in autoregressive text generation?
  • RQ4How does the CT objective compare to existing methods in terms of automatic and human evaluation metrics on dialogue and language modeling tasks?
  • RQ5What is the impact of sequence length and window size for negative candidate selection on generation quality and repetition rates?

Key findings

  • On the language modeling task, the CT objective achieved a rep-1 rate of 9.19 (greedy) and 6.89 (beam), significantly lower than all baselines including UL-TS and NCE.
  • On the open-domain dialogue task, CT achieved a rep-1 rate of 0.60 (greedy) and 0.64 (beam), with the lowest repetition and highest diversity among all methods.
  • CT reduced rep-4 rates to 0.05 (greedy) and 0.12 (beam) on language modeling, outperforming all baselines, including unlikelihood-based methods.
  • Human evaluation showed that CT-generated responses were less repetitive and more coherent than those from UL-TS and other baselines, with a human preference score of 0.64 on the dialogue task.
  • Despite a minor increase in perplexity (1.44 points higher than baseline), CT achieved the best overall generation quality due to substantial gains in diversity and coherence.
  • Ablation studies confirmed that using only the M most recent tokens as negative candidates (rather than all prior tokens) led to better performance and reduced noise.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.