LearnBenchStart learning →

AI Research Scientist · Softmax & Cross-Entropy

Softmax function and logits

Real lesson card · Page 1 of 4

Softmax function and logits

Softmax

Softmax converts logits z1,,znz_1,\dots,z_n into a distribution: pi=ezijezjp_i=\dfrac{e^{z_i}}{\sum_j e^{z_j}}. Every pi>0p_i>0 and they sum to 1, giving valid class probabilities.
Example
Logits $[2,1,0]$ give exponentials $[7.39,2.72,1]$, sum 11.1111.11, so probabilities [0.665,0.245,0.090]\approx[0.665,0.245,0.090].

Recall check from the same lesson

Because softmax squashes each logit into a probability, its Jacobian is a diagonal matrix where entry $i$ only depends on $p_i(1-p_i)$, just like the sigmoid derivative.

Sources

· Editorial policy

One sitting · 20–30 minutes

A focused session on your AI Research Scientist interview

LearnBench starts from what you already know — skip what you have, master what you’re missing.

Start now

More Softmax & Cross-Entropy questions