Softmax
A function that turns a list of raw scores into probabilities that are all positive and add up to one.
Softmax takes any list of numbers, raises e to the power of each, and divides by the total. Large scores become large probabilities and small scores shrink towards zero, but none becomes exactly zero. Language models use softmax in two places: inside attention, to turn query-key scores into weights, and at the output, to turn the logits for every token in the vocabulary into a probability for the next token. Temperature works by dividing the logits before softmax, sharpening or flattening the result.