On the Efficacy of Sampling Adapters

Clara Meister, Tiago Pimentel, Luca Malagutti, Ethan G. Wilcox, Ryan Cotterell
7/7/2023
cs.CL

No official code found. Best implementation: rycolab/sampling-adapters (5 stars, last commit 2023-06-26).

Abstract

Sampling is a common strategy for generating text from probabilistic models, yet standard ancestral sampling often results in text that is incoherent or ungrammatical. To alleviate this issue, various modifications to a model's sampling distribution, such as nucleus or top-k sampling, have been introduced and are now ubiquitously used in language generation systems. We propose a unified framework for understanding these techniques, which we term sampling adapters. Sampling adapters often lead to qualitatively better text, which raises the question: From a formal perspective, how are they changing the (sub)word-level distributions of language generation models? And why do these local changes lead to higher-quality text? We argue that the shift they enforce can be viewed as a trade-off between precision and recall: while the model loses its ability to produce certain strings, its precision rate on desirable text increases. While this trade-off is not reflected in standard metrics of distribution quality (such as perplexity), we find that several precision-emphasizing measures indeed indicate that sampling adapters can lead to probability distributions more aligned with the true distribution. Further, these measures correlate with higher sequence-level quality scores, specifically, Mauve.

View on arXivView PDF

Code Implementations(1)

50Python, Jupyter NotebookJun 10, 20233 years ago

Cite this paper

@article{meister2023efficacy,
  title  = {On the Efficacy of Sampling Adapters},
  author = {Clara Meister and Tiago Pimentel and Luca Malagutti and Ethan G. Wilcox and Ryan Cotterell},
  year   = {2023},
  eprint = {2307.03749},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.03749v2}
}

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

Discussion