English

Local and Global Decoding in Text Generation

Computation and Language 2024-10-15 v1

Abstract

Text generation, a key component in applications such as dialogue systems, relies on decoding algorithms that sample strings from a language model distribution. Traditional methods, such as top-kk and top-π\pi, apply local normalisation to the model's output distribution, which can distort it. In this paper, we investigate the effect of this distortion by introducing globally-normalised versions of these decoding methods. Additionally, we propose an independent Metropolis-Hastings algorithm to approximate sampling from globally-normalised distributions without explicitly computing them. Our empirical analysis compares the performance of local and global normalisation across two decoding algorithms (top-kk and top-π\pi) with various hyperparameters, using Pythia language models. Results show that, in most configurations, global decoding performs worse than the local decoding version of the same algorithms -- despite preserving the distribution's integrity. Our results suggest that distortion is an important feature of local decoding algorithms.

Cite

@article{arxiv.2410.10810,
  title  = {Local and Global Decoding in Text Generation},
  author = {Daniel Gareev and Thomas Hofmann and Ezhilmathi Krishnasamy and Tiago Pimentel},
  journal= {arXiv preprint arXiv:2410.10810},
  year   = {2024}
}

Comments

Paper accepted in EMNLP 2024. Code is available in https://github.com/lowlypalace/global-decoding

R2 v1 2026-06-28T19:21:07.620Z