Citation and evidence

Hierarchical softmax

23 min full readUpdated 16 references

This article's verification

Report a problem with this article

Edit article
More

Cite this article

Hierarchical softmax (often abbreviated H-softmax or HSM) is a technique for computing a probability distribution over a very large set of output classes, such as the words of a vocabulary, by arranging the classes as the leaves of a tree and expressing each class probability as a product of simpler decisions taken along the path from the root to that leaf. With a binary tree over $V$ words, scoring one word needs only about $\log_2 V$ binary decisions instead of the $V$ terms of an ordinary softmax normalization. The idea grew out of Joshua Goodman's 2001 work on word classes for maximum entropy language models and was turned into a deep binary hierarchy for neural language models by Frederic Morin and Yoshua Bengio in 2005 [1][2]. It later became one of the two training options in word2vec, alongside negative sampling, and the fast output layer of the fastText text classifier [5][6][11].

Hierarchical softmax still defines a properly normalized distribution, but it is a different model from a flat softmax: Grave and colleagues classify it among methods that compute exact probabilities for an approximate model [14]. The probability of a word depends on the parameters of the tree nodes above it, so the choice of tree affects accuracy as well as speed [6][13]. Its main advantage is that both training and scoring of a single known word take time proportional to the path length; its main weakness is that computing the full distribution over all words is no cheaper than a flat softmax [1][13].

The problem: a softmax over a large vocabulary

A binary tree branches from the top to vocabulary entries shown as leaves.
In hierarchical softmax, words are leaves of a tree. Computing a word's probability uses the binary decisions on its path from the root. Aston Zhang, Zachary C. Lipton, Mu Li and Alexander J. Smola. Image source. CC BY-SA 4.0. Copyright 2019 Amazon.com, Inc. or its affiliates. Dive into Deep Learning. SVG rendered as PNG.

A neural language model predicts the next word by producing a score for every word in the vocabulary and normalizing those scores with a softmax. In the neural probabilistic language model studied by Morin and Bengio, the cost of computing one conditional probability was on the order of $(n-1)hd + |V|h(d+1)$ multiply-add operations, where $n$ is the n-gram order, $h$ the number of hidden units, $d$ the embedding size and $|V|$ the vocabulary size [1]. With typical settings from earlier experiments ($n \approx 5$, $|V| \approx 20{,}000$, $h \approx 100$, $d \approx 30$) they estimated about 12,000 operations for the first part and about 60 million for the part that grows linearly with the vocabulary [1]. Their stated goal was to replace that $O(|V|)$ term with $O(\log |V|)$ computations [1].

The same bottleneck appears in word embedding models. Mikolov and colleagues noted in 2013 that a full softmax formulation of the skip-gram model is impractical because the cost of computing the gradient of $\log p(w_O \mid w_I)$ is proportional to the vocabulary size, which is often $10^5$ to $10^7$ terms [6].

"Deep Learning(CS7015): Lec 10.7 Hierarchical softmax", video from NPTEL-NOC IITM, published October 24, 2018. Watch on YouTube.

History

Sources differ on whom to credit. Grave et al. describe hierarchical softmax as introduced by Goodman (2001) and later extended to deeper hierarchies by Morin and Bengio and by Mnih and Hinton, while Mikolov et al. state that, in the context of neural network language models, it was "first introduced by Morin and Bengio" [6][14].

Class-based factorization (2001)

In 2001, Joshua Goodman of Microsoft Research proposed speeding up maximum entropy language models by first predicting a word's class and then predicting the word given its class, using the identity

P(w∣h)=P(class(w)∣h)×P(w∣h,class(w))P(w \mid h) = P(\text{class}(w) \mid h) \times P(w \mid h, \text{class}(w))

which holds because each word belongs to exactly one class [2]. In a hypothetical 10,000-word vocabulary split into 100 classes of 100 words each, the inner training loop shrinks from a factor proportional to 10,000 to two factors of 100, an improvement of about 10,000 / (100 + 100) = 50 [2]. Goodman reported speedups of up to a factor of 35 over one of the best previous techniques, with typically slightly lower perplexity [2]. He described extending the decomposition to three or more levels (for example a super-class, then a class, then the word) but reported no improvement beyond three levels because each level adds overhead, and he noted that the same trick could speed up neural networks or any other learner with a large number of outputs [2]. The paper appeared at ICASSP 2001 [2].

Morin and Bengio (2005)

Morin and Bengio, at the Université de Montréal, started from the class-based speedup for maximum entropy models, noted that it could use more levels, and wrote that "here we push this idea to the limit" by replacing a one-level class decomposition with a full binary tree over the vocabulary [1]. Their paper, "Hierarchical Probabilistic Neural Network Language Model", was published in the proceedings of the Tenth International Workshop on Artificial Intelligence and Statistics (AISTATS 2005) [1]. In their model each word is identified by a bit vector $(b_1(v), \dots, b_m(v))$ that encodes the path from the root to the word's leaf, and the next-word probability is the product of binary decisions along that path:

P(v∣wt−1,…,wt−n+1)=∏j=1mP(bj(v)∣b1(v),…,bj−1(v),wt−1,…,wt−n+1)P(v \mid w_{t-1}, \dots, w_{t-n+1}) = \prod_{j=1}^{m} P\big(b_j(v) \mid b_1(v), \dots, b_{j-1}(v), w_{t-1}, \dots, w_{t-n+1}\big)

Two design choices made the approach practical [1]:

  • Parameter sharing across nodes. A separate predictor for each node would need about $2|V|$ predictors, which the authors judged too large for memory and prone to overfitting. Instead, one network predicts every decision, taking the context words and the current node as inputs. Each node receives its own learned feature vector, and the probability of taking branch 1 at a node is $\text{sigmoid}(\alpha_{\text{node}} + \beta^{\top} \tanh(c + Wx + U N_{\text{node}}))$, where $x$ concatenates the context word embeddings, $N_{\text{node}}$ is the node's embedding, $\alpha_{\text{node}}$ is a per-node bias and $\beta$, $c$, $W$ and $U$ are shared parameters.
  • A tree from WordNet. The hierarchy was built from the IS-A taxonomy of WordNet. The authors manually chose a single parent for the few concepts with several parents, assigned each word its most frequent sense, and turned the non-binary taxonomy into a binary tree by recursively splitting the children of each node with k-means on TF-IDF vectors computed over paragraphs of the training corpus.

The paper observed that during training, gradients flow only through the nodes on the path to the target word, which is the main source of savings [1]. At test time, computing the probability of one observed word keeps the speedup, but computing the probabilities of all words returns to $O(|V|)$ cost [1]. The authors also pointed out that a tree built with word frequencies in mind could shorten the average path: on their corpus, $\log_2 |V| \approx 13.3$ while the unigram entropy was about 9.16, a possible additional speedup of about 31% [1].

Experiments used the Brown corpus with the 10,000 most frequent words, split into 900,000 words for training, 100,000 for validation and 105,515 for testing, and ran on 1.2 GHz Athlon processors [1]:

ModelTraining time per epoch (s)Training speedupTest time per example (ms)Test speedupTest perplexity
Interpolated trigram----268.7
Class-based n-gram----249.1
Original neural network416,3001270.71195.3
Importance sampling6,06268.7221.31.22192.6
Hierarchical model1,6092581.4193220.7

Expanded article table

The hierarchical model was more than 250 times faster in training and close to 200 times faster at test time, short of the roughly 750-fold ($|V| / \log_2 |V|$) gain expected with no overhead [1]. Its perplexity was worse than the original neural network but better than both n-gram baselines [1]. The comparison with importance sampling, a method proposed earlier by Bengio and Senécal, highlighted the difference between the two: importance sampling speeds up training only, while the hierarchical model also speeds up probability computation [1][3].

Mnih and Hinton (2008)

Andriy Mnih and Geoffrey Hinton at the University of Toronto addressed the accuracy gap in "A Scalable Hierarchical Distributed Language Model", presented at NIPS 2008 [3]. They identified the main limitation of Morin and Bengio's work as the tree-building procedure, which depended on expert knowledge from WordNet [3]. Their hierarchical log-bilinear model (HLBL) replaced the nonlinear network with the log-bilinear language model, so a predicted feature vector $\hat{r}$ is computed once per prediction rather than once per node, and each decision is $P(d_i = 1 \mid q_i, w_{1:n-1}) = \sigma(\hat{r}^{\top} q_i + b_i)$, where $q_i$ is the feature vector of the $i$-th node on the path and $b_i$ its bias [3]. The model also allowed a word to appear at several leaves, summing the probabilities of all its codes [3].

To build trees without expert knowledge, Mnih and Hinton first trained a model on a random tree, represented each word by the average predicted feature vector of the contexts that precede it, and then split the vocabulary recursively by fitting a mixture of two Gaussians with 10 steps of the EM algorithm [3]. Variants of the splitting rule produced balanced trees, unbalanced but better-supported trees, and trees in which hard-to-cluster words were assigned to both branches [3]. On the APNews dataset (about 14 million training words and a vocabulary of 17,964 words), test perplexity fell from 151.2 with a random tree to 131.3 with a balanced learned tree, and to 112.1 with the largest tree that repeated words across four clusterings, compared with 117.0 for the non-hierarchical log-bilinear model and 123.2 for a 5-gram Kneser-Ney model [3]. Training took 4 to 32 minutes per epoch for the hierarchical models against 6,420 minutes for the flat model, and the slowest hierarchical model was over 200 times faster [3]. The authors concluded that a carefully constructed hierarchy was the key to making hierarchical models perform well [3].

Frequency binning in recurrent language models (2011)

In 2011, Tomas Mikolov and colleagues at Brno University of Technology and Johns Hopkins University applied a two-level class factorization to the output layer of a recurrent neural network language model [4]. Instead of WordNet or clustering, they assigned words to classes by "frequency binning": with 20 classes, for example, the words that make up the first 5% of the unigram probability mass go to class 1, the next 5% to class 2, and so on, so the first classes may hold a single frequent word while the last cover thousands of rare words [4]. They reported around a 15 times speedup over a model with the full 10,000-word vocabulary at a small cost in accuracy, and cited the dependence of Morin's approach on WordNet as its drawback [4].

word2vec (2013)

The first word2vec paper, "Efficient Estimation of Word Representations in Vector Space" by Mikolov, Kai Chen, Greg Corrado and Jeff Dean (January 2013), used hierarchical softmax with the vocabulary represented as a Huffman binary tree [5]. Huffman coding assigns short codes to frequent words; the authors wrote that while a balanced tree requires about $\log_2 V$ outputs to be evaluated, the Huffman tree requires only about $\log_2(\text{unigram perplexity}(V))$, which for a one-million-word vocabulary gives about a two times speedup in evaluation [5]. With hierarchical softmax, the training complexity of the continuous bag-of-words (CBOW) model is $Q = N \times D + D \times \log_2 V$ and that of the continuous skip-gram model is $Q = C \times (D + D \times \log_2 V)$, where $N$ is the number of context words, $D$ the vector dimensionality and $C$ the maximum context distance [5]. Because these architectures have no hidden layer, the paper noted that their speed depends heavily on the efficiency of the softmax normalization [5].

The follow-up paper, "Distributed Representations of Words and Phrases and their Compositionality" by Mikolov, Ilya Sutskever, Chen, Corrado and Dean (NIPS 2013), stated that hierarchical softmax was "first introduced by Morin and Bengio" in the context of neural network language models, gave the formulation used in word2vec (see Formulation below), and introduced negative sampling as "a simple alternative to the hierarchical softmax" [6]. It observed that the structure of the tree "has a considerable effect on the performance" and that word2vec uses a binary Huffman tree because it "assigns short codes to the frequent words which results in fast training" [6].

The released C tool builds the Huffman tree from word counts in a function named CreateBinaryTree, and exposes hierarchical softmax through the -hs option, which defaults to 0 (off), while -negative defaults to 5 [7]. The word2vec project page advised that hierarchical softmax is "better for infrequent words" and negative sampling "better for frequent words, better with low dimensional vectors" [8]. The widely used gensim Python library, whose training routines were originally ported from the C package, follows the same defaults: hs=0 and negative=5 [10].

fastText (2016)

The fastText text classifier, described by Armand Joulin, Edouard Grave, Piotr Bojanowski and Mikolov in "Bag of Tricks for Efficient Text Classification" (EACL 2017), applies hierarchical softmax to class labels rather than words [11]. The paper cites Goodman (2001) for hierarchical softmax and Mikolov et al. (2013) for the Huffman coding tree, and states that the training cost of the output layer drops from $O(kh)$ to $O(h \log_2 k)$ for $k$ classes and a text representation of dimension $h$ [11]. It also used the tree at test time: because a node's probability is always lower than its parent's, a depth-first search that tracks the best leaf found so far can discard low-probability branches, and a binary heap extends the search to the top $T$ labels [11]. On a tag prediction task built from the YFCC100M dataset, with 312,116 unique tags, the paper reported a test-time speedup of 600 times over the Tagspace baseline [11]. The fastText library exposes the option as -loss hs, and its tutorial describes a Huffman tree over the labels so that frequent outputs are found faster [12].

Formulation

The following notation is from Mikolov et al. (2013) [6]. Each word $w$ is a leaf of a binary tree and is reached by a unique path from the root. Let $n(w, j)$ be the $j$-th node on that path and $L(w)$ the path length, so $n(w, 1)$ is the root and $n(w, L(w)) = w$. For each inner node $n$, let $\text{ch}(n)$ be an arbitrary fixed child, and let $[![x]!]$ be 1 if $x$ is true and $-1$ otherwise. Given an input word $w_I$ with vector $v_{w_I}$, hierarchical softmax defines

p(w∣wI)=∏j=1L(w)−1σ([ ⁣[ n(w,j+1)=ch(n(w,j)) ] ⁣]⋅vn(w,j)′⊤vwI)p(w \mid w_I) = \prod_{j=1}^{L(w)-1} \sigma\Big([\![\, n(w, j+1) = \text{ch}(n(w, j)) \,]\!] \cdot {v'_{n(w,j)}}^{\top} v_{w_I}\Big)

where $\sigma(x) = 1 / (1 + e^{-x})$ is the logistic sigmoid and $v'_n$ is a learned vector for inner node $n$ [6]. Because $\sigma(x) + \sigma(-x) = 1$, the two branches at each node split the node's probability mass, and the probabilities of all leaves sum to 1 [6][9]. Each inner node thus acts as a binary classifier, much like a logistic regression, whose task is to predict whether the random walk should continue to the left or the right child [9].

Unlike the flat softmax formulation, which keeps an input vector and a separate output vector for every word, the hierarchical version has one vector per word plus one vector per inner node [6]. A binary tree with $V$ leaves has $V - 1$ inner nodes, so the parameter count stays roughly the same as the output matrix it replaces [9].

Training

For a training example, the loss is the negative log-probability of the target word, $E = -\sum_{j=1}^{L(w)-1} \log \sigma([![\cdot]!] , {v'_j}^{\top} h)$, where $h$ is the hidden representation (the input word vector in skip-gram, or the average of the context vectors in CBOW) [9]. Xin Rong's 2014 derivation shows that the gradient with respect to an inner node's score is the prediction error $\sigma({v'_j}^{\top} h) - t_j$, where $t_j$ is 1 if the path goes to the designated child and 0 otherwise, giving the update [9]

vj′(new)=vj′(old)−η(σ(vj′⊤h)−tj) hv'^{(\text{new})}_j = v'^{(\text{old})}_j - \eta \big(\sigma({v'_j}^{\top} h) - t_j\big)\, h

for $j = 1, \dots, L(w) - 1$, with learning rate $\eta$. Only the nodes on the target word's path are updated, so the cost per training instance and context word falls from $O(V)$ to $O(\log V)$ [9]. Mikolov et al. note that the cost of computing $\log p(w_O \mid w_I)$ and its gradient is proportional to $L(w_O)$, which on average is no greater than $\log V$ [6]. The original C implementation follows this scheme: for each node on the path, it computes the dot product of the hidden vector with the node vector, looks up the sigmoid in a precomputed table, and updates the node vector and the accumulated hidden-layer error with the gradient [7].

Inference

Scoring one known word, for example to compute the perplexity of observed text or to rescore a few candidates in speech recognition, keeps the logarithmic cost [1]. Computing the whole distribution, or finding the most likely next word without a search procedure, requires visiting every leaf and therefore costs $O(V)$, as with a flat softmax [1][13]. In a benchmark where test-time decoding scored all output words, Chen, Grangier and Auli measured the same test throughput for hierarchical softmax as for a flat softmax (510 tokens per second on their Billion Word setup), noting that it can be faster only when few words in few clusters need to be scored [13]. fastText's pruned depth-first search is one way to recover a speedup when only the best label or the top few labels are needed [11].

Building the tree

How the vocabulary is arranged matters because a word can never receive more probability than the clusters that contain it [13]. Approaches in the literature include:

Tree constructionUsed byNotes
Word classes, two or three levelsGoodman (2001) [2]Class prediction then word prediction; no gain found beyond three levels
WordNet IS-A taxonomy plus k-means splitsMorin and Bengio (2005) [1]Required manual choices for words and concepts with several parents
Recursive two-component Gaussian mixture on learned word featuresMnih and Hinton (2008) [3]Bootstrapped from a random tree; words could occupy several leaves
Frequency binning, two levelsMikolov et al. (2011) [4]Classes cover equal shares of unigram probability mass
Huffman tree on word or label frequencyword2vec (2013), fastText (2016) [5][11]Shortest codes for the most frequent outputs
Two levels with random, frequency, k-means or weighted k-means clustersChen et al. (2016) [13]Random clustering worst, weighted k-means best

Expanded article table

Chen and colleagues observed that when each cluster contains words used in similar contexts, the cluster probabilities are easier to learn, whereas an uninformative structure drives the cluster probabilities toward the uniform distribution and hurts accuracy [13]. Mnih and Hinton found that a random tree gave much worse perplexity than a learned one, although even the random-tree model beat a unigram model by a wide margin [3]. A Huffman tree, by contrast, optimizes only for speed: it uses frequency and ignores meaning [5][6].

Comparison with other methods

Hierarchical softmax is one of several families of methods for avoiding the full softmax, which are surveyed in the full softmax and candidate sampling articles. Sampling methods such as importance sampling and noise contrastive estimation avoid the full normalization during training but leave the model's output layer unchanged, so they speed up training but not exact probability computation [1][13]. Hierarchical softmax changes the model itself.

Against negative sampling in word2vec

On word2vec's analogy benchmark, using 300-dimensional skip-gram models trained on about one billion words of news text with a vocabulary of 692,000 words, Mikolov et al. reported the following accuracies [6]:

MethodTotal accuracy, no subsamplingTotal accuracy, $10^{-5}$ subsampling
Negative sampling, 5 samples59%60%
Negative sampling, 15 samples61%61%
Hierarchical softmax (Huffman)47%55%
Noise contrastive estimation, 5 samples53%-

Expanded article table

On word analogies negative sampling came out ahead [6]. On the paper's phrase analogy task, however, hierarchical softmax was the weakest method without subsampling (19%) but the best with subsampling of frequent words (47%, against 42% for negative sampling with 15 samples) [6]. The authors' best phrase model, which reached 72% accuracy, was trained on about 33 billion words with hierarchical softmax, 1,000 dimensions and the whole sentence as context, and they judged that hierarchical softmax with subsampling learned the best phrase representations [6].

Language modeling benchmarks

Chen, Grangier and Auli's systematic comparison of large-vocabulary strategies (first posted in December 2015; a version appeared at ACL 2016) found that conclusions drawn on small datasets do not always generalize to larger ones [13]. With a fixed training budget of one week on the large datasets and one day on Penn Treebank, they reported these test perplexities [13]:

MethodPenn TreebankGigawordBillion Word
Kneser-Ney n-gram141.257.170.2
Softmax123.856.5108.3
Hierarchical softmax138.257.185.2
Differentiated softmax121.152.091.2
Noise contrastive estimation143.178.4104.7

Expanded article table

Hierarchical softmax had the lowest perplexity of the neural methods on Billion Word (the Kneser-Ney baseline scored lower still) and processed the most training examples in a given time (12,650 tokens per second, against 510 for the flat softmax), but it performed poorly on the small-vocabulary Penn Treebank [13]. The authors also found it to be the best neural technique on rare words, which they attributed to its speed: it completes more passes and sees each rare word more often [13]. They concluded that differentiated softmax and hierarchical softmax were the best strategies for large vocabularies in their setting [13].

Hardware efficiency and adaptive softmax

Edouard Grave and colleagues at Facebook AI Research argued in "Efficient softmax approximation for GPUs" (ICML 2017) that matrix multiplication on a GPU is inefficient when one dimension is small, so "hierarchical organizations of words with a low number of children per node, such as binary Huffman codes, are highly suboptimal" on that hardware [14]. Their adaptive softmax, which the authors describe as inspired by the class-based hierarchical softmax, uses a short-list of frequent words at the first level and a few large clusters of rarer words below it, with cluster sizes chosen to minimize expected computation time on GPUs [14].

Recommendation

In their 2016 paper on YouTube's deep neural network recommender, Paul Covington, Jay Adams and Emre Sargin of Google treated the choice of the next video as classification over millions of classes and trained it with sampled negative classes and importance weighting [15]. They described hierarchical softmax as a popular alternative but reported that they could not reach comparable accuracy with it, explaining that each node in the tree had to discriminate between sets of classes that were often unrelated, which made the classification problem harder [15].

Multi-label extension

Hierarchical softmax is defined for multi-class problems, where each example has exactly one correct output. Tools such as fastText adapt it to multi-label tagging with a "pick-one-label" heuristic that randomly selects one of an example's labels and trains on it as a multi-class example [16]. Marek Wydmuch and colleagues (NeurIPS 2018) proved that this heuristic is not consistent in general, and showed that probabilistic label trees (PLTs) are a no-regret generalization of hierarchical softmax for precision@k [16]. In the multi-class case PLTs and hierarchical softmax are identical [16]. The authors' PLT implementation, extremeText, obtained significantly better results than hierarchical softmax with the pick-one-label heuristic [16]. The same paper notes that algorithms similar to hierarchical softmax were introduced independently in several fields, including nested dichotomies in statistics, conditional probability estimation trees in multi-class classification and multi-stage classifiers in pattern recognition [16].

Advantages and limitations

The main reported strengths of hierarchical softmax are:

  • Logarithmic cost per known output. Training and scoring one word or label touch only the nodes on one path, which gave speedups of two orders of magnitude in early neural language models [1][3].
  • A normalized model. The tree defines a proper probability distribution over all leaves, so log-likelihood and perplexity can be computed exactly for observed words [1][6].
  • Speed on large output spaces. It was the fastest method to train and the most accurate neural method on the largest benchmark in Chen et al.'s comparison and made fastText practical with hundreds of thousands of labels [11][13].

The reported weaknesses are:

  • Dependence on the tree. Accuracy depends strongly on how the vocabulary is clustered, and a poor or purely frequency-based tree can cost accuracy [3][6][13].
  • No speedup for the full distribution. Producing scores for all outputs costs as much as a flat softmax, which limits the gain in applications that must rank every candidate without a pruned search [1][13].
  • Weaker results in some settings. It trailed negative sampling on word2vec's word analogy task, underperformed the flat softmax on the small Penn Treebank vocabulary, and did not match sampled softmax accuracy in YouTube's recommender [6][13][15].
  • Poor fit to GPUs with binary trees. Small per-node computations make binary hierarchies inefficient on GPU hardware, which motivated adaptive softmax [14].

Continue reading

More from See also

More to read

Topics:AlgorithmsMachine LearningNatural Language ProcessingNeural Networks

References

  1. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17 ^18 ^19 ^20 ^21 ^22Frederic Morin, Yoshua Bengio. "Hierarchical Probabilistic Neural Network Language Model". Proceedings of the Tenth International Workshop on Artificial Intelligence and Statistics, PMLR R5:246-252, 2005. proceedings.mlr.press/...morin05a.pdf
  2. ^1 ^2 ^3 ^4 ^5 ^6 ^7Joshua Goodman. "Classes for Fast Maximum Entropy Training". 2001 IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2001 (arXiv:cs/0108006). arxiv.org/...0108006
  3. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14Andriy Mnih, Geoffrey E. Hinton. "A Scalable Hierarchical Distributed Language Model". Advances in Neural Information Processing Systems 21 (NIPS 2008). proceedings.neurips.cc/...550da6ac5d3724-Paper.pdf
  4. ^1 ^2 ^3 ^4Tomáš Mikolov, Stefan Kombrink, Lukáš Burget, Jan Černocký, Sanjeev Khudanpur. "Extensions of recurrent neural network language model". 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), May 2011, pp. 5528-5531. fit.vutbr.cz/...mikolov_icassp2011_5528.pdf
  5. ^1 ^2 ^3 ^4 ^5 ^6 ^7Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean. "Efficient Estimation of Word Representations in Vector Space". arXiv:1301.3781, January 2013. arxiv.org/...1301.3781
  6. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17 ^18 ^19Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, Jeffrey Dean. "Distributed Representations of Words and Phrases and their Compositionality". Advances in Neural Information Processing Systems 26 (NIPS 2013); arXiv:1310.4546, October 2013. arxiv.org/...1310.4546
  7. ^1 ^2"word2vec.c". tmikolov/word2vec repository (automatically exported from code.google.com/p/word2vec), GitHub. github.com/...word2vec.c
  8. ^"word2vec: Tool for computing continuous distributed representations of words". Google Code Archive. code.google.com/...word2vec
  9. ^1 ^2 ^3 ^4 ^5 ^6Xin Rong. "word2vec Parameter Learning Explained". arXiv:1411.2738, November 2014. arxiv.org/...1411.2738
  10. ^Radim Řehůřek. "models.word2vec: Word2vec embeddings". Gensim documentation. radimrehurek.com/...word2vec
  11. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8Armand Joulin, Edouard Grave, Piotr Bojanowski, Tomas Mikolov. "Bag of Tricks for Efficient Text Classification". Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics (EACL 2017), Volume 2, pp. 427-431; arXiv:1607.01759, July 2016. arxiv.org/...1607.01759
  12. ^fastText. "Text classification" (supervised tutorial). fasttext.cc. fasttext.cc/...supervised-tutorial
  13. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17Wenlin Chen, David Grangier, Michael Auli. "Strategies for Training Large Vocabulary Neural Language Models". Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL 2016), pp. 1975-1985; arXiv:1512.04906. arxiv.org/...1512.04906
  14. ^1 ^2 ^3 ^4 ^5Edouard Grave, Armand Joulin, Moustapha Cissé, David Grangier, Hervé Jégou. "Efficient softmax approximation for GPUs". ICML 2017; arXiv:1609.04309, September 2016. arxiv.org/...1609.04309
  15. ^1 ^2 ^3Paul Covington, Jay Adams, Emre Sargin. "Deep Neural Networks for YouTube Recommendations". Proceedings of the 10th ACM Conference on Recommender Systems (RecSys 2016), pp. 191-198. static.googleusercontent.com/...45530.pdf
  16. ^1 ^2 ^3 ^4 ^5Marek Wydmuch, Kalina Jasinska, Mikhail Kuznetsov, Róbert Busa-Fekete, Krzysztof Dembczyński. "A no-regret generalization of hierarchical softmax to extreme multi-label classification". NeurIPS 2018; arXiv:1810.11671, October 2018. arxiv.org/...1810.11671

Improve this article

Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.

3 revisions · v3 · 4,694 words · full history

Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify

Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here

Reviewer note: Independent fact-check before publication on November 18, 2026: 112 claims checked against 20 cited and independent sources; 0 material and 4 minor corrections applied before publication.

Cite this page: AI Wiki. "Hierarchical softmax." aiwiki.ai, updated 5 Dec 2026, fact-checked 18 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/hierarchical_softmax

Edit article