Local and Global Decoding in Text Generation

Daniel Gareev, Thomas Hofmann, Ezhilmathi Krishnasamy, Tiago Pimentel
10/14/2024
cs.CL

No official code found. Best implementation: lowlypalace/global-decoding (0 stars, last commit 2024-10-11).

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-$k$ and top-$π$, 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-$k$ and top-$π$) 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.

View on arXivView PDF

Code Implementations(1)

00Shell, PythonMar 17, 20242 years ago

Similar Papers

Cite this paper

@article{gareev2024local,
  title  = {Local and Global Decoding in Text Generation},
  author = {Daniel Gareev and Thomas Hofmann and Ezhilmathi Krishnasamy and Tiago Pimentel},
  year   = {2024},
  eprint = {2410.10810},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.10810v1}
}

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/2410.10810.svg)](https://codeofpaper.com/paper/2410.10810)

Discussion