Lune

ICML2021Top-tier venue

A Tale of Two Efficient and Informative Negative Sampling Distributions

Shabnam Daghaghi, Tharun Medini, Nicholas Meisburger, Beidi Chen, Mengnan Zhao, Anshumali Shrivastava

Abstract

Softmax classifiers with a very large number of classes naturally occur in many applications such as natural language processing and information retrieval. The calculation of full softmax is costly from the computational and energy perspective. There have been various sampling approaches to overcome this challenge, popularly known as negative sampling (NS). Ideally, NS should sample negative classes from a distribution that is dependent on the input data, the current parameters, and the correct positive class. Unfortunately, due to the dynamically updated parameters and data samples, there is no sampling scheme that is provably adaptive and samples the negative classes efficiently. Therefore, alternative heuristics like random sampling, static frequency-based sampling, or learning-based biased sampling, which primarily trade either the sampling cost or the adaptivity of samples per iteration are adopted. In this paper, we show two classes of distributions where the sampling scheme is truly adaptive and provably generates negative samples in near-constant time. Our implementation in C++ on CPU is significantly superior, both in terms of wall-clock time and accuracy, compared to the most optimized TensorFlow implementations of other popular negative sampling approaches on powerful NVIDIA V100 GPU.

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.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Scatterbrain: Unifying Sparse and Low-rank AttentionBeidi Chen, Tri Dao, Eric Winsor, Zhao Song et al.NeurIPS 2021 · 165 citations
  2. SignRFF: Sign Random Fourier FeaturesXiaoyun Li, Ping LiNeurIPS 2022 · 6 citations
  3. TENNOR: Trustworthy Execution for Neural Networks through Obliviousness and RetrievalsZifan Qu, Vasileios P. Kemerlis, Giuseppe Ateniese, Evgenios M. KornaropoulosCCS 2026

Builds on2

  1. Extreme Classification via Adversarial Softmax ApproximationRobert Bamler, Stephan MandtICLR 2020 · 25 citations
  2. Sub-linear Memory Sketches for Near Neighbor Search on Streaming DataBenjamin Coleman, Richard G. Baraniuk, Anshumali ShrivastavaICML 2020 · 21 citations

Related papers

  1. ANN Softmax: Acceleration of Extreme Classification TrainingKang Zhao, Liuyihan Song, Yingya Zhang, Pan Pan et al.VLDB 2022 · 8 citations
  2. Sampled Estimators For Softmax Must Be BiasedLi-Chung Lin, Yaxu Liu, Chih-Jen LinNeurIPS 2025 · 3 citations
  3. Efficient Training of Retrieval Models using Negative CacheErik Lindgren, Sashank J. Reddi, Ruiqi Guo, Sanjiv KumarNeurIPS 2021 · 30 citations
  4. Adaptive Sampling for Efficient Softmax ApproximationTavor Z. Baharav, Ryan Kang, Colin Sullivan, Mo Tiwari et al.NeurIPS 2024 · 7 citations
  5. Learning Recommenders for Implicit Feedback with Importance ResamplingJin Chen, Defu Lian, Binbin Jin, Kai Zheng et al.WWW 2022 · 39 citations
Dusk over the sea between two cliffs drawn in fine vertical lines