Adaptive Contrastive Search: Uncertainty-Guided Decoding for Open-Ended Text Generation

Esteban Garces Arias, Julian Rodemann, Meimingwei Li, Christian Heumann, Matthias Aßenmacher
7/26/2024
cs.CLcs.LGstat.ME

No official code found. Best implementation: YecanLee/Adaptive-Contrastive-Search (42 stars, MIT, last commit 2025-02-15).

Abstract

Decoding from the output distributions of large language models to produce high-quality text is a complex challenge in language modeling. Various approaches, such as beam search, sampling with temperature, $k-$sampling, nucleus $p-$sampling, typical decoding, contrastive decoding, and contrastive search, have been proposed to address this problem, aiming to improve coherence, diversity, as well as resemblance to human-generated text. In this study, we introduce adaptive contrastive search, a novel decoding strategy extending contrastive search by incorporating an adaptive degeneration penalty, guided by the estimated uncertainty of the model at each generation step. This strategy is designed to enhance both the creativity and diversity of the language modeling process while at the same time producing coherent and high-quality generated text output. Our findings indicate performance enhancement in both aspects, across different model architectures and datasets, underscoring the effectiveness of our method in text generation tasks. Our code base, datasets, and models are publicly available.

View on arXivView PDF

Code Implementations(1)

MIT

[EMNLP 2024 Findings] Official PyTorch Implementation of "Adaptive Contrastive Search: Uncertainty-Guided Decoding for Open-Ended Text Generation"

422C, C++Sep 20, 20241 years agoMIT
decoding-algorithmemnlp2024multi-languagesnatural-language-processingtext-generation

Similar Papers

Cite this paper

@article{arias2024adaptive,
  title  = {Adaptive Contrastive Search: Uncertainty-Guided Decoding for Open-Ended Text Generation},
  author = {Esteban Garces Arias and Julian Rodemann and Meimingwei Li and Christian Heumann and Matthias Aßenmacher},
  year   = {2024},
  eprint = {2407.18698},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.18698v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.18698.svg)](https://codeofpaper.com/paper/2407.18698)

Discussion