Conformal Nucleus Sampling

Shauli Ravfogel, Yoav Goldberg, Jacob Goldberger
5/4/2023
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Language models generate text based on successively sampling the next word. A decoding procedure based on nucleus (top-$p$) sampling chooses from the smallest possible set of words whose cumulative probability exceeds the probability $p$. In this work, we assess whether a top-$p$ set is indeed aligned with its probabilistic meaning in various linguistic contexts. We employ conformal prediction, a calibration procedure that focuses on the construction of minimal prediction sets according to a desired confidence level, to calibrate the parameter $p$ as a function of the entropy of the next word distribution. We find that OPT models are overconfident, and that calibration shows a moderate inverse scaling with model size.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ravfogel2023conformal,
  title  = {Conformal Nucleus Sampling},
  author = {Shauli Ravfogel and Yoav Goldberg and Jacob Goldberger},
  year   = {2023},
  eprint = {2305.02633},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.02633v1}
}

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

Discussion