Adaptive Sampling for Efficient Softmax Approximation

Tavor Z. Baharav, Ryan Kang, Colin Sullivan, Mo Tiwari, Eric Luxenberg +2 more
2/3/2026

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

The softmax function is ubiquitous in machine learning and optimization applications. Computing the full softmax evaluation of a matrix-vector product can be computationally expensive in high-dimensional settings. In many applications, however, it is sufficient to calculate only the top few outputs of the softmax function. In this work, we present an algorithm, dubbed AdaptiveSoftmax , that adaptively computes the top k softmax values more efficiently than the full softmax computation, with probabilistic guarantees. We demonstrate the sample efficiency improvements afforded by AdaptiveSoftmax on real and synthetic data to corroborate our theoretical results. AdaptiveSoftmax yields > 10 x gain over full softmax computation on most datasets, yielding up to 30x improvement for Mis-tral7B evaluated on the Wikitext dataset. The adaptive method we propose for estimating the partition function (the softmax denominator) is of independent interest and can be used in other applications such as kernel density estimation

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is 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{baharav2026adaptive,
  title  = {Adaptive Sampling for Efficient Softmax Approximation},
  author = {Tavor Z. Baharav and Ryan Kang and Colin Sullivan and Mo Tiwari and Eric Luxenberg and David Tse and Mert Pilanci},
  year   = {2026},
  doi    = {10.52202/079017-3733},
  url    = {https://doi.org/10.52202/079017-3733},
  journal = {NEURIPS 2024 2024}
}

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

Discussion