How to use the Softmax Calculator
- 1. Enter logitsType the raw output scores of your model, separated by commas.
- 2. Set temperatureKeep 1, lower it to sharpen or raise it to flatten.
- 3. Read the probabilitiesSee each class's probability and the loss for the true class.
Formula and worked example
softmax(zᵢ) = e^(zᵢ/T) ÷ Σⱼ e^(zⱼ/T), where T is the temperature (1 by default). Every output is between 0 and 1, and they always add up to 1.
For logits 2, 1 and 0.1 (cat, dog, bird): e² = 7.3891, e¹ = 2.7183 and e⁰·¹ = 1.1052, which add up to 11.2125. So the probabilities are cat 0.659, dog 0.2424 and bird 0.0986. If cat is the true class, the cross-entropy loss is −ln(0.659) = 0.417.
Temperature and stability
- T below 1 exaggerates differences: with T = 0.5 the same logits give cat about 0.86.
- T above 1 flattens the distribution towards equal chances.
- LLMs use the same idea: a sampling temperature near 0 makes answers more predictable, higher values make them more varied.
- Knowledge distillation uses a high temperature to pass soft probabilities from a big model to a small one.
Large logits overflow e^x, so the calculator subtracts the biggest logit first. This does not change the answer, because the same factor cancels out top and bottom; PyTorch and NumPy implementations do the same. Softmax is for one-label, multi-class outputs. For several independent yes/no labels, use a sigmoid per label instead, which you can compare in the activation function plotter.
Frequently asked questions
Why do my probabilities not change when I add 10 to every logit?
Softmax only depends on differences between logits, so shifting them all by the same amount has no effect.
What is a good cross-entropy loss?
Lower is better; 0 means the true class got probability 1. Guessing evenly among k classes gives ln(k).
Is the Softmax Calculator free?
Yes, the Softmax Calculator is free. The first time you see your first result, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.