Softmax Function
A function that converts a vector of real numbers into a probability distribution by exponentiating and normalizing: σ(z)_i = e^{z_i} / Σ_j e^{z_j}.
Method
Used as the final activation for multi-class classification (cross-entropy loss) and inside attention mechanisms. Numerically stable implementations subtract the maximum before exponentiating. Temperature parameter controls sharpness.
Applications
Multi-class neural classifiers, attention weights in Transformers, reinforcement learning policy outputs, any model requiring a categorical distribution over discrete choices.
Advantages
Smooth, differentiable; outputs valid probabilities; combines naturally with cross-entropy; temperature provides control.
Limitations
Can produce overconfident predictions; sensitive to outliers in logits; computational cost of the sum in the denominator for very large vocabularies (addressed by hierarchical or sampled softmax). Boltzmann action selection approaches uniform choices at high temperature and greedy choices at low temperature. Softmax output alone does not establish real-world probability calibration.
Alternatives
Sparsemax, entmax, Gumbel-Softmax (for discrete sampling), hierarchical softmax, sigmoid for multi-label.
Editorial clarification
Boltzmann action selection approaches uniform choices at high temperature and greedy choices at low temperature. Softmax output alone does not establish real-world probability calibration.
Sources
Educational reference only, not professional advice.
All algorithms