How does softmax turn an attention score into an attention weight?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Score is the pre-softmax raw dot product (any real number). Weight is the post-softmax probability in [0, 1] that rows sum to 1. Softmax is the bridge.
Think of judges at a talent show. First, each judge writes a raw score for every act on a piece of paper. The numbers can be anything: positive, negative, all over the place, and there is no rule that they have to add up to anything. Then the host runs through the room collecting those scores, runs them through a calculator, and converts them so each act lands as a clean percentage between 0% and 100%, with all the percentages across acts adding up to exactly 100%. The raw paper numbers are what the model calls 'scores'. The final percentages are what it calls 'weights'. The host with the calculator in between is the single step that converts one into the other.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define score as the pre-softmax dot product and weight as the post-softmax probability, list which operations live at each level (masking, temperature, biases), and explain why the distinction matters for stable softmax and FlashAttention.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Using 'score' and 'weight' interchangeably. They are different objects living in different spaces; softmax is the operator that converts one to the other.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.