Papers
arxiv:2411.07641

Top-nσ: Not All Logits Are You Need

Published on Nov 12
· Submitted by tomorrowdawn on Nov 19
Authors:
,

Abstract

Large language models (LLMs) typically employ greedy decoding or low-temperature sampling for reasoning tasks, reflecting a perceived trade-off between diversity and accuracy. We challenge this convention by introducing top-nsigma, a novel sampling method that operates directly on pre-softmax logits by leveraging a statistical threshold. Our key insight is that logits naturally separate into a Gaussian-distributed noisy region and a distinct informative region, enabling efficient token filtering without complex probability manipulations. Unlike existing methods (e.g., top-p, min-p) that inadvertently include more noise tokens at higher temperatures, top-nsigma maintains a stable sampling space regardless of temperature scaling. We also provide a theoretical analysis of top-nsigma to better understand its behavior. The extensive experimental results across four reasoning-focused datasets demonstrate that our method not only outperforms existing sampling approaches but also surpasses greedy decoding, while maintaining consistent performance even at high temperatures.

Community

Paper author Paper submitter

We extensively studied the output of LLMs -- not probabilities but logits -- a gaussian noise emerges! Based on this finding we present our top-$n\sigma$ algorithm which improves the generation quality a lot. Its integration is super easy, only requiring two lines of pytorch code:

threshold = logits.max(dim=-1,keepdim=True).values - n*logits.std(dim=-1, keepdim=True)
logits[logits<threshold] = float('-inf')
·
Paper author

This is an automated message from the Librarian Bot. I found the following papers similar to this paper.

The following papers were recommended by the Semantic Scholar API

Please give a thumbs up to this comment if you found it helpful!

If you want recommendations for any Paper on Hugging Face checkout this Space

You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend

Showing that performance can be significantly improved (and the argument over temperature mostly ended) by standardizing the logits is huge. There's a bias against "post-training" research that needs to be eliminated from the AI community.

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2411.07641 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2411.07641 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2411.07641 in a Space README.md to link it from this page.

Collections including this paper 6