Lune

NeurIPS2024Top-tier venue

Adaptive Sampling for Efficient Softmax Approximation

Tavor Z. Baharav, Ryan Kang, Colin Sullivan, Mo Tiwari, Eric Luxenberg, David Tse, Mert Pilanci

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

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • HyperAttention: Long-context Attention in Near-Linear Time cites Fast Attention Requires Bounded Entries
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on5

  1. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  2. Fast Attention Requires Bounded EntriesJosh Alman, Zhao SongNeurIPS 2023 · 115 citations
  3. HyperAttention: Long-context Attention in Near-Linear TimeInsu Han, Rajesh Jayaram, Amin Karbasi, Vahab Mirrokni et al.ICLR 2024 · 104 citations
  4. BanditPAM: Almost Linear Time k-Medoids Clustering via Multi-Armed BanditsMo Tiwari, Martin Jinye Zhang, James Mayclin, Sebastian Thrun et al.NeurIPS 2020 · 13 citations
  5. Adaptive Learning of Rank-One Models for Efficient Pairwise Sequence AlignmentGovinda M. Kamath, Tavor Z. Baharav, Ilan ShomoronyNeurIPS 2020 · 9 citations

Related papers

  1. Statistical Perspective of Top-K Sparse Softmax Gating Mixture of ExpertsHuy Nguyen, Pedram Akbarian, Fanqi Yan, Nhat HoICLR 2024 · 29 citations
  2. Softmax is not Enough (for Sharp Size Generalisation)Petar Velickovic, Christos Perivolaropoulos, Federico Barbero, Razvan PascanuICML 2025
  3. A Tale of Two Efficient and Informative Negative Sampling DistributionsShabnam Daghaghi, Tharun Medini, Nicholas Meisburger, Beidi Chen et al.ICML 2021 · 11 citations
  4. LapSum - One Method to Differentiate Them All: Ranking, Sorting and Top-k SelectionLukasz Struski, Michal B. Bednarczyk, Igor T. Podolak, Jacek TaborICML 2025
  5. Sampling from a k-DPP without looking at all itemsDaniele Calandriello, Michal Derezinski, Michal ValkoNeurIPS 2020 · 30 citations
Dusk over the sea between two cliffs drawn in fine vertical lines