Hierarchical Softmax › The Role of Node Vectors in Learned Representations

Michael BrenndoerferUpdated February 8, 20262 min read
Language AI HandbookAll chapters
Part 4 of 67Word Embeddings
Chapter 22Hierarchical Softmax › The Role of Node Vectors in Learned Representations
Reading section 11 of 16 · The Role of Node Vectors in Learned Representations · 2 minSection 11 of 16 · 2 min

Book contents

Section 11 of 16 · 2 min read

Hierarchical Softmax › The Role of Node Vectors in Learned RepresentationsOne section · Sections in this chapter11 / 16 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

An aspect of hierarchical softmax that distinguishes it from standard softmax is the nature of its learnable parameters. Standard softmax has two parameter matrices: an input embedding matrix WinW_{in} for center words and an output embedding matrix WoutW_{out} for context words. After training, you typically use WinW_{in} as the word representations, or average WinW_{in} and WoutW_{out}.

Hierarchical softmax replaces WoutW_{out} with a matrix of node vectors WnodeW_{node}, one per internal node. These node vectors are not word embeddings in the usual sense: they do not correspond to specific vocabulary words and are not typically used as word representations after training. Their role is purely to parameterize the binary decisions in the tree. Each node vector learns to represent the split between the two halves of the vocabulary it divides, which makes it a kind of "discriminative boundary" rather than a "semantic embedding."

This distinction matters for practical use. After training with hierarchical softmax, the word embeddings you extract are the input embeddings from WinW_{in}. The node vectors serve their purpose during training and are then discarded. Unlike negative sampling, which produces two embedding matrices (both of which can potentially be used as word representations), hierarchical softmax produces only one directly useful embedding matrix.

There is a subtle benefit to this design. Because WinW_{in} is the only embedding matrix updated via the center word gradient, center word embeddings receive a single clear gradient signal from each training pair. In standard softmax and negative sampling, both input and output embeddings are updated for every word involved in a training pair, which can introduce noise. The well-defined separation in hierarchical softmax between "word embeddings" and "node vectors" can lead to more stable training dynamics in some settings.