Reproduce “Contrastive Decoding: Open-ended Text Generation as Optimization” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Xiang Lisa Li, Ari Holtzman, Daniel Fried, Percy Liang, Jason Eisner, Tatsunori Hashimoto, Luke Zettlemoyer, Mike Lewis

Contrastive Decoding (CD) improves open-ended text generation by leveraging a contrastive objective between a large "expert" language model and a smaller "amateur" model. This decoding-time strategy produces text that is highly coherent and fluent while maintaining lexical diversity, without requiring any model retraining or fine-tuning.

Key insights

  • The inherent differences in generation quality between large (expert) and small (amateur) language models can be exploited at decoding time to produce higher-quality text.
  • Penalizing tokens that are highly predictable by a less capable (amateur) model encourages the generation of more informative, diverse, and less repetitive text.
  • A plausibility constraint is essential to ground the contrastive objective, preventing the selection of rare or implausible tokens that might coincidentally have high contrastive scores.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.