Table of Contents
Fetching ...

Top-$nσ$: Not All Logits Are You Need

Chenxia Tang, Jianchun Liu, Hongli Xu, Liusheng Huang

TL;DR

The extensive experimental results across four reasoning-focused datasets demonstrate that the novel sampling method, top-$n\sigma, not only outperforms existing sampling approaches but also surpasses greedy decoding, while maintaining consistent performance even at high temperatures.

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-$nσ$, 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-$nσ$ maintains a stable sampling space regardless of temperature scaling. We also provide a theoretical analysis of top-$nσ$ 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.

Top-$nσ$: Not All Logits Are You Need

TL;DR

The extensive experimental results across four reasoning-focused datasets demonstrate that the novel sampling method, top-$n\sigma, not only outperforms existing sampling approaches but also surpasses greedy decoding, while maintaining consistent performance even at high temperatures.

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-, 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-, min-) that inadvertently include more noise tokens at higher temperatures, top- maintains a stable sampling space regardless of temperature scaling. We also provide a theoretical analysis of top- 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.

Paper Structure

This paper contains 31 sections, 4 theorems, 13 equations, 2 figures, 3 tables, 1 algorithm.

Key Result

Theorem 1

Consider $V$ logits $\{l_i\mid i=1, \cdots, V\}$ independently and identically distributed according to $f(x)$. For any threshold $t$, we have:

Figures (2)

  • Figure 1: Distribution of logits and descendingly sorted probabilities of LLaMA3-8B-Instruct on an AQuA sample. Note that the leading tokens in the right plot (with higher probabilities) correspond to the right-side region of the logits distribution. The maximum logit is approximately $10\sigma$ above the mean of the distribution.
  • Figure 2: Relationship between $\sigma$-distance and nucleus size when temperature $T=1$ during generation. The plots demonstrate an inverse relationship: high $\sigma$-distances correspond to small nucleus sizes (mostly 1), while lower $\sigma$-distances (though remaining above 10) correlate with larger nucleus sizes.

Theorems & Definitions (7)

  • Theorem 1
  • Lemma 2
  • Remark
  • Theorem 3
  • proof
  • Theorem 4
  • proof