Scaling Softmax for Extreme Classification and Recommendation

This direction is split into other directions: softmax normalization bottleneck. Its last version stays readable and citable here.

Version 1 of 169 papers71 conceptsfrozen 2026-10-04

In modern machine learning, we often encounter "extreme" output spaces where the number of possible categories $K$ reaches millions or even billions. Whether predicting the next song in a streaming catalog, the next word in a large language model, or identifying a face among millions of identities, the standard tool for the job is the softmax function.

However, the softmax function has a fundamental scaling problem. To calculate the probability of a single class, you must compute a normalization constant—the partition function—which requires summing the exponentiated scores of every single class in the catalog. This $O(K)$ complexity creates a "softmax bottleneck" that makes training and real-time inference prohibitively expensive as catalogs grow.

The Partition Function Bottleneck

The core challenge, as identified by Ulrich Paquet and Noam Koenigstein in Scalable Bayesian Modelling of Paired Symbols, is that the normalizing constant requires a summation over the entire product space of possible pairs. In a system with millions of users and items, this quadratic complexity prevents the application of full Bayesian inference.

This bottleneck isn't just a training issue; it affects the entire lifecycle of a model. Ankit Singh Rawat and colleagues note in Sampled Softmax with Random Fourier Features that this linear scaling makes training prohibitively slow for large-scale language models. Similarly, Tavor Baharav points out in Adaptive Sampling for Efficient Softmax Approximation that the complexity is actually $O(nd)$, scaling with both the number of classes and the vector dimension, which becomes unsustainable as architectures grow wider.

Sampling and the Bias-Variance Trade-off

The most common way to bypass the $O(K)$ sum is through sampling. Instead of looking at all $K$ classes, we estimate the partition function using a small subset of "negative" samples.

However, sampling introduces a fundamental tension between efficiency and accuracy. Li-Chung Lin and Chih-Jen Lin recently provided a definitive mathematical proof in Sampled Estimators For Softmax Must Be Biased that any estimator looking only at a subset of classes is inherently biased.

Because bias is inevitable, research has shifted toward Hard Negative Mining—finding the samples that provide the most informative gradient signals. Wenzheng Zhang 0003 and Karl Stratos theoretically justified this in Understanding Hard Negatives in Noise Contrastive Estimation, proving that hard negatives reduce the bias of the gradient estimator relative to the full cross-entropy loss.

Adaptive and Kernel-Based Sampling

To make sampling more effective, researchers have moved away from simple uniform sampling toward adaptive methods that "learn" which negatives to pick.

  1. Kernel-Based Methods: Guy Blanc and Steffen Rendle introduced a kernel-based sampling method that achieves low-bias results using 10 to 100 times fewer samples than traditional methods. Similarly, Ankit Singh Rawat proposed RF-softmax, which uses Random Fourier Features to approximate the distribution with logarithmic rather than linear complexity.
  2. Indexing Structures: Defu Lian and Jin Chen have pioneered the use of Inverted Multi-Indices (MIDX). In Fast Variational AutoEncoder with Inverted Multi-Index for Collaborative Filtering, they demonstrated that MIDX can create sublinear-time sampling strategies, achieving up to a 6x speedup in training without sacrificing quality.
  3. Hashing: Methods like Locality Sensitive Hashing (LSH), explored by Shabnam Daghaghi in A Tale of Two Efficient and Informative Negative Sampling Distributions, allow for "near-constant time" identification of the most informative hard negatives.

Structural and Hierarchical Efficiency

Another strategy is to change the architecture of the output layer itself to avoid the flat $O(K)$ structure.

Alternative Paradigms: Beyond Classification

Finally, some researchers argue that the best way to solve the softmax bottleneck is to stop treating the problem as a massive classification task.

Cedric De Boom and colleagues at Spotify Large-scale user modeling with recurrent neural networks reframed recommendation as a regression task. By mapping users into a continuous "taste vector" space and using nearest-neighbor search, they bypassed the need for a final softmax layer entirely.

Similarly, Wen-Yan Lin proposed Distance Classification in Distance Based Image Classification, which defines classes by "what they are" (generative) rather than "what they are not" (discriminative), allowing for easier scaling to massive class counts and better detection of out-of-distribution anomalies.

By combining these sampling, structural, and algorithmic innovations, the field is moving toward a future where "million-way" decisions are as computationally trivial as binary ones.

Papers in this version

Showing 60 of 69 papers.

History & citationVersion 1 · 2026-10-04

Split into other directions · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_scaling_softmax_for_extreme_classificati_2c276740,
  title = {Scaling Softmax for Extreme Classification and Recommendation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/scaling-softmax-for-extreme-classification-and-recommendation/rdr_2c2767404dbe4ddca29dff48d7bb5b51},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_scaling_softmax_for_extreme_classificati_2c276740_v1,
  title = {Scaling Softmax for Extreme Classification and Recommendation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/scaling-softmax-for-extreme-classification-and-recommendation/rdr_2c2767404dbe4ddca29dff48d7bb5b51/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}