Efficient Exact Gradient Update for training Deep Networks with Very Large Sparse Targets
Not on the map. Why?
Abstract (arXiv)
An important class of problems involves training deep neural networks with sparse prediction targets of very high dimension D. These occur naturally in e.g. neural language models or the learning of word-embeddings, often posed as predicting the probability of next words among a vocabulary of size D (e.g. 200 000). Computing the equally large, but typically non-sparse D-dimensional output vector from a last hidden layer of reasonable dimension d (e.g. 500) incurs a prohibitive O(Dd) computational cost for each example, as does updating the D x d output weight matrix and computing the gradient needed for backpropagation to previous layers. While efficient handling of large sparse network inputs is trivial, the case of large sparse targets is not, and has thus so far been sidestepped with approximate alternatives such as hierarchical softmax or sampling-based approximations during training. In this work we develop an original algorithmic approach which, for a family of loss functions that includes squared error and spherical softmax, can compute the exact loss, gradient update for the output weights, and gradient for backpropagation, all in O(d^2) per example instead of O(Dd), remarkably without ever computing the D-dimensional output. The proposed algorithm yields a speedup of D/4d , i.e. two orders of magnitude for typical sizes, for that critical part of the computations that often dominates the training time in this kind of network architecture.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). First posted on arXiv 22 Dec 2014.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 3; 2022: 2; 2023: 1; 2024: 2; 2025: 2.
10 papers.
- 2022THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryptioncited by 55
- 2021Fast Variational AutoEncoder with Inverted Multi-Index for Collaborative Filteringcited by 8
- 2021Escaping the Gradient Vanishing: Periodic Alternatives of Softmax in Attention Mechanismcited by 7
- 2023Online Neural Path Guiding with Normalized Anisotropic Spherical Gaussianscited by 6
- 2024TaylorShift: Shifting the Complexity of Self-Attention from Squared to Linear (and Back) using Taylor-Softmaxcited by 6
- 2022On the Interpretability of Attention Networkscited by 5
- 2024Privacy-Preserving Diffusion Model Using Homomorphic Encryptioncited by 4
- 2021Sparse-softmax: A Simpler and Faster Alternative Softmax Transformationcited by 2
- 2025Adaptive Temperature Based on Logits Correlation in Knowledge Distillationcited by 2
- 2025Adaptive Sparse Softmax: An Effective and Efficient Softmax Variantcited by 0
- 2025Adaptive Sparse Softmax: An Effective and Efficient Softmax Variant5 Aug 2025
- 2025Adaptive Temperature Based on Logits Correlation in Knowledge Distillation12 Mar 2025
- 2024Privacy-Preserving Diffusion Model Using Homomorphic Encryption9 Mar 2024
- 2024TaylorShift: Shifting the Complexity of Self-Attention from Squared to Linear (and Back) using Taylor-Softmax5 Mar 2024
- 2023Online Neural Path Guiding with Normalized Anisotropic Spherical Gaussians11 Mar 2023
- 2022On the Interpretability of Attention Networks30 Dec 2022
- 2022THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryption1 Jun 2022
- 2021Sparse-softmax: A Simpler and Faster Alternative Softmax Transformation23 Dec 2021
- 2021Fast Variational AutoEncoder with Inverted Multi-Index for Collaborative Filtering13 Sep 2021
- 2021Escaping the Gradient Vanishing: Periodic Alternatives of Softmax in Attention Mechanism16 Aug 2021