Hierarchical Softmax
Hierarchical Softmax is an approach to reduce the computational cost of high-dimensional output layers over large vocabulary sets . It decomposes probabilities hierarchically by organizing words into a tree-like structure of nested categories. Instead of requiring computations proportional to the vocabulary size and the number of hidden units , a balanced tree reduces the required computations to a depth of . The probability of selecting a specific word is calculated as the product of the conditional probabilities of choosing the correct branch at every node along the path from the root of the tree to the leaf containing that word. These conditional probabilities are often predicted using a logistic regression model with context as input. While it is possible to optimize a binary tree structure, it is often simpler to define a tree with a depth of 2 and a branching factor of to capture most of the computational benefits by creating mutually exclusive word classes.
0
1
Contributors are:
Who are from:
Tags
Data Science
Foundations of Large Language Models Course
Computing Sciences
Learn After
Hierarchical Softmax Formula
A machine learning team is training a language model with a vocabulary of over one million unique words. They decide to replace the standard output layer, which calculates a probability for every single word, with an architecture that organizes words into a binary tree. In this new setup, the probability of a target word is calculated by multiplying the probabilities of the choices made at each node along the path from the tree's root to the word's specific leaf. What is the most likely trade-off the team will face by making this change?
Computational Cost of Output Architectures
Probability Calculation in a Hierarchical Output Layer