Skip to main content
QUICK REVIEW

[Paper Review] Neural Text Generation: A Practical Guide

Ziang Xie|arXiv (Cornell University)|Nov 27, 2017
Topic ModelingComputer Science42 references33 citations
TL;DR

This practical guide offers actionable techniques for diagnosing and resolving common failures in neural text generation, such as repetition, truncation, and lack of diversity, focusing on decoding-stage interventions rather than retraining. It presents architecture-agnostic strategies like coverage penalties, length constraints, and diversity-promoting decoding heuristics to improve model behavior with minimal retraining.

ABSTRACT

Deep learning methods have recently achieved great empirical success on machine translation, dialogue response generation, summarization, and other text generation tasks. At a high level, the technique has been to train end-to-end neural network models consisting of an encoder model to produce a hidden representation of the source text, followed by a decoder model to generate the target. While such models have significantly fewer pieces than earlier systems, significant tuning is still required to achieve good performance. For text generation models in particular, the decoder can behave in undesired ways, such as by generating truncated or repetitive outputs, outputting bland and generic responses, or in some cases producing ungrammatical gibberish. This paper is intended as a practical guide for resolving such undesired behavior in text generation models, with the aim of helping enable real-world applications.

Motivation & Objective

  • Address the challenge of pathological behavior in neural text generation models, such as repetitive or truncated outputs, without requiring retraining.
  • Provide a systematic, architecture-agnostic approach to debugging decoding behavior in encoder-decoder models with attention.
  • Emphasize error analysis and decoding-time interventions as cost-effective alternatives to retraining for improving model output quality.
  • Support real-world deployment by offering techniques to enhance decoding speed and reliability in production settings.

Proposed method

  • Use coverage penalty to penalize incomplete source attention, computed as the sum of log-minimized attention sums across source timesteps.
  • Apply length constraints during decoding by restricting target sequence length to be within a delta of the source length, improving coherence.
  • Implement a repetition penalty by detecting repeated attention to previous timesteps and penalizing such behavior using the attention matrix.
  • Increase output diversity via temperature scaling of the softmax or by penalizing low-ranked siblings during beam search decoding.
  • Optimize decoding speed through beam pruning, batching, computation caching, and efficient computation graph compilation.
  • Use final re-ranking of hypotheses with coverage penalty to improve final output quality without altering the decoding process.

Experimental results

Research questions

  • RQ1How can decoding-stage interventions reduce repetitive or truncated outputs in neural text generation models?
  • RQ2What techniques can improve diversity in model outputs without retraining, especially in dialogue and QA tasks?
  • RQ3How can coverage penalties and length constraints be used to improve attention alignment and coherence?
  • RQ4What are effective, architecture-agnostic strategies for diagnosing and fixing decoding behavior in neural text generation?
  • RQ5How can decoding speed be improved for real-time production deployment without sacrificing output quality?

Key findings

  • Coverage penalty significantly reduces incomplete attention to source input, improving alignment and reducing truncation.
  • Length constraints that bound target length within a delta of the source length improve coherence and reduce out-of-distribution outputs.
  • Repetition penalties based on attention matrix analysis effectively reduce repetitive outputs by discouraging re-attending to already-attended timesteps.
  • Temperature scaling and sibling diversity penalties during beam search increase output diversity, especially in low-variability tasks like dialogue.
  • Decoding-level optimizations such as beam pruning, batching, and computation caching can reduce decoding time by orders of magnitude in practice.
  • Final re-ranking of hypotheses using coverage penalty leads to better final outputs without modifying the main decoding process.

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.