Skip to content
See How AI Works
← All explainers

Plain-language explainer

Softmax, explained

What does softmax do, and where does an LLM use it?

Softmax turns a list of raw scores into percentages that add up to 100. It exaggerates gaps: a score slightly ahead becomes a share far ahead, and low scores shrink toward zero without ever quite reaching it. Language models use it in the two places that matter most: at the output, to turn word scores into the next-word probabilities you sample from, and inside attention, to decide how much each earlier word contributes to the current one.

Do not just read it. Operate the mechanism yourself in a short interactive lesson.

See it work: How attention blends meaning β†’

Free, no code, no signup.

What people get wrong

  • Softmax picks the winner. It only converts scores into shares. The picking, sampling or taking the top one, happens after.
  • The percentages are the model's confidence about facts. They describe likely text, not truth, which is why a wrong answer can carry a high share.
  • It is an obscure detail. The temperature dial you see in products works by reshaping scores right before this exact step.

Where you see it in real products

  • APIs that return logprobs are showing you the shares softmax produced.
  • The temperature setting is arithmetic applied just before softmax.
  • Attention heatmaps in AI visualizations are softmax shares drawn as color.

Related explainers

Part of See How AI Works, a free interactive course, where you learn how modern AI works by operating it, not watching videos.