AI GLOSSARY · AI CONCEPTS
Softmax
Definition
Softmax exponentiates and normalizes real-valued scores into nonnegative values summing to one along a specified dimension. It can produce a class or token distribution, but normalized scores alone do not establish calibrated probabilities.
Also called: softmax function, softmax activation, softmax layer, softmax classifier, softmax output.
In plain language
A classifier can assign scores to cat, dog and rabbit. Softmax converts that score vector into shares summing to one; higher scores get larger shares. For a batch, normalization may apply separately to each row. The output is not proof that the selected category is correct or that the model is well calibrated, especially on unfamiliar inputs.
Technical definition
For scores z_i in a chosen slice, softmax returns exp(z_i) divided by the sum of exp(z_j) in that slice. A tensor implementation specifies a normalization dimension. Softmax is also used inside attention, not only at classifier outputs. Temperature can scale logits before normalization; truncation and sampling are separate decoding choices.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Guide · Illustrative, not executed
What Is an LLM? The Facts Agent Users Need
- What you see
- An explanation of what a large language model is for people who run agents, written for users rather than for machine-learning engineers.
- Why it exercises the concept
- In common autoregressive language generation, a model predicts a distribution over next tokens, often using softmax. The guide covers the model rather than deriving this function.
Skill by Skill Almanac · Illustrative, not executed
llm-eval-test-sets 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- Builds and validates an eval dataset for any LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.
- Why it exercises the concept
- The linked skill helps define evaluation cases for model outputs. It does not calculate softmax or establish calibration; it is an adjacent evaluation tool.
Skill by Skill Almanac · Illustrative, not executed
split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- Checks train, validation and test files for duplicates, shared groups, time and label leakage; prints JSON.
- Why it exercises the concept
- A classifier that ends in softmax is judged on held-out data. This skill checks that the held-out files are clean. It does not compute softmax.
Coding tool · Illustrative, not executed
Claude Code
- What to try
/model- What you see
- Claude Code lets you switch the model mid-session with /model.
- Why it exercises the concept
- An agent can write code that explicitly applies softmax. A common autoregressive decoder also uses vocabulary normalization, but this is not a claim about every possible model or decoding implementation.
How it shows up when you use agents
In a common autoregressive large language model, vocabulary scores are normalized to a distribution over possible next tokens, then a decoding rule chooses a continuation. Settings such as temperature and top-p reshape or trim that distribution before the choice, which is why the same prompt can give different answers on different runs.
Softmax also appears wherever an agent depends on a classifier: a model that labels an email as spam, a request as safe or unsafe, or an image by category. Those systems usually report a score, and that score is often a softmax output.
What breaks when it is misunderstood: people read the number as certainty. A softmax output must add up to 1 across the classes it knows about, so an explicit none-of-the-above class or an external rejection rule is needed if the application requires that option. If a classifier gates an agent action, treat the score as a ranking signal, check it against labelled examples, and keep a human approval step for actions that are hard to undo. The LLM eval test sets skill is one way to build those labelled examples.
Worked example (illustrative)
Apply softmax separately to the rows [0, ln(3)] and [0, 0]. Their outputs are [0.25, 0.75] and [0.5, 0.5]. Each row sums to one, while the two-row tensor sums to two. This calculated example shows why the normalization dimension matters; the values are not measured classification probabilities or calibration results.
Common confusions
- Softmax versus a probability of being correct. The outputs form a probability distribution over the classes, but a high value does not mean the model is right. It means the model ranks that class above the others.
- Softmax versus an activation function in a hidden layer. Softmax normalizes a group of values together and is also used in attention. Element-wise activation functions act on individual values; their roles differ.
- Softmax versus cross-entropy loss. Softmax makes the probabilities. Cross-entropy is the loss function that compares them with the true class during training. CS231n pairs them in the softmax classifier.
- Softmax versus sampling. Softmax produces the distribution. Sampling settings such as temperature and top-p decide how the next token is drawn from it.
Related terms
Terms that mention Softmax
More in AI concepts
Sources
- Neural networks: Multi-class classification, Google for Developers (Machine Learning Crash Course) (accessed 2026-11-24)
- CS231n Deep Learning for Computer Vision: Linear classification, Stanford University (accessed 2026-11-24)
- Softmax (torch.nn.Softmax), PyTorch documentation (accessed 2026-11-24)
- Attention Is All You Need, sections 3.2.1 and 3.4, Vaswani et al. (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft) and Codex (automated revisions); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .
Change log (6)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : Corrected bounded independent source-review finding; affected-claim re-review pending.
- : First version.
- : Learning-method scope and counterexample corrections; independent exact-version review pending.
- : Aligned related-tool explanations with scoped definitions; no blanket claims about the full catalog.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.