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

Chenxia Tang, Jianchun Liu, Hongli Xu, Liusheng Huang
11/12/2024
cs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

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.

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. 2 weaker matches are hidden by default — 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{tang2024topn,
  title  = {Top-$nσ$: Not All Logits Are You Need},
  author = {Chenxia Tang and Jianchun Liu and Hongli Xu and Liusheng Huang},
  year   = {2024},
  eprint = {2411.07641},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.07641v1}
}

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

Discussion