[Paper Review] A Contrastive Framework for Neural Text Generation
The paper introduces SimCTG, a contrastive training objective to produce discriminative, isotropic token representations and a decoding method called contrastive search to balance coherence and diversity in generated text, showing state-of-the-art results on multiple benchmarks and languages.
Text generation is of great importance to many natural language processing applications. However, maximization-based decoding methods (e.g. beam search) of neural language models often lead to degenerate solutions -- the generated text is unnatural and contains undesirable repetitions. Existing approaches introduce stochasticity via sampling or modify training objectives to decrease probabilities of certain tokens (e.g., unlikelihood training). However, they often lead to solutions that lack coherence. In this work, we show that an underlying reason for model degeneration is the anisotropic distribution of token representations. We present a contrastive solution: (i) SimCTG, a contrastive training objective to calibrate the model's representation space, and (ii) a decoding method -- contrastive search -- to encourage diversity while maintaining coherence in the generated text. Extensive experiments and analyses on three benchmarks from two languages demonstrate that our proposed approach significantly outperforms current state-of-the-art text generation methods as evaluated by both human and automatic metrics.
Motivation & Objective
- Motivate and address degeneration in neural text generation when using standard likelihood-based training and decoding.
- Propose a contrastive training objective to calibrate token representations toward isotropy and discriminativeness.
- Introduce a decoding algorithm (contrastive search) that preserves coherence while enhancing diversity.
Proposed method
- Define and optimize a contrastive loss L_CL to encourage discriminative token representations using cosine similarity with a margin rho.
- Combine L_MLE and L_CL into the SimCTG objective for training.
- Derive a contrastive decoding rule that selects from top-k candidates by balancing model confidence and a degeneration penalty based on token representation similarity.
- Evaluate decoding methods including greedy, beam search, nucleus sampling, and the proposed contrastive search.
- Apply the approach to open-ended document generation and open-domain dialogue generation across multiple languages and model sizes.
Experimental results
Research questions
- RQ1Does contrastive training yield more discriminative and isotropic token representations compared to standard MLE training?
- RQ2Can the proposed contrastive search decoding improve coherence and diversity without sacrificing semantic alignment with the prefix?
- RQ3Is SimCTG effective across tasks (document generation, dialogue) and languages (English, Chinese) and different model scales?
- RQ4How do different hyperparameters of the contrastive loss (margin rho) and the decoder (k, alpha) affect performance?
Key findings
- SimCTG achieves better perplexity and next-token accuracy than baselines on Wikitext-103.
- SimCTG combined with contrastive search yields the best generation quality, including lower repetition, higher diversity, and closer token distribution to humans (MAUVE).
- Contrastive search improves coherence and fluency in human evaluations and outperforms nucleus sampling in several settings, especially with SimCTG.
- Human evaluations show SimCTG with contrastive search matching or surpassing human fluency and coherence on multiple datasets, with notable gains for larger models.
- Across English and Chinese dialogue datasets, SimCTG + contrastive search consistently improves coherence, fluency, and informativeness over baselines.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.