Softmax is the function that converts a vector of raw scores (logits) into a probability distribution, used in attention weights and output token selection. In attention, softmax ensures weights over keys sum to one; in the output layer, it produces the next-token probability distribution. Numerical stability and efficient computation of softmax are key engineering concerns at scale.