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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext af882915-2ac3-447f-a50d-fbf1eecb6382Builds on5
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- Fast Attention Requires Bounded EntriesJosh Alman, Zhao SongNeurIPS 2023 · 115 citations
- HyperAttention: Long-context Attention in Near-Linear TimeInsu Han, Rajesh Jayaram, Amin Karbasi, Vahab Mirrokni et al.ICLR 2024 · 104 citations
- 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
- Adaptive Learning of Rank-One Models for Efficient Pairwise Sequence AlignmentGovinda M. Kamath, Tavor Z. Baharav, Ilan ShomoronyNeurIPS 2020 · 9 citations
Related papers
- Statistical Perspective of Top-K Sparse Softmax Gating Mixture of ExpertsHuy Nguyen, Pedram Akbarian, Fanqi Yan, Nhat HoICLR 2024 · 29 citations
- Softmax is not Enough (for Sharp Size Generalisation)Petar Velickovic, Christos Perivolaropoulos, Federico Barbero, Razvan PascanuICML 2025
- A Tale of Two Efficient and Informative Negative Sampling DistributionsShabnam Daghaghi, Tharun Medini, Nicholas Meisburger, Beidi Chen et al.ICML 2021 · 11 citations
- LapSum - One Method to Differentiate Them All: Ranking, Sorting and Top-k SelectionLukasz Struski, Michal B. Bednarczyk, Igor T. Podolak, Jacek TaborICML 2025
- MultiMax: Sparse and Multi-Modal Attention LearningYuxuan Zhou, Mario Fritz, Margret KeuperICML 2024 · 4 citations
