A math function that turns a list of raw scores into values that add up to 100%, used to decide how much attention to give each token.
Technically: Softmax maps a vector of real-valued logits to a probability distribution via exp(z_i) / sum(exp(z_j)), concentrating mass on higher-scoring elements exponentially. In attention it converts raw dot-product scores into positive weights summing to 1 over the keys; in the output head it converts hidden states into next-token probabilities. Stable computation subtracts the max logit before exponentiation; temperature scaling shifts the distribution between peaked and diffuse outputs.
Category: Attention Mechanisms