Code and dense tables are folded away. Open any of them on demand.
What is a proper scoring rule?
A proper scoring rule grades a probabilistic forecast against the actual outcome so that reporting your true beliefs earns the best expected score; it is strictly proper when that honest report is the only best choice. Log loss, the Brier score, the spherical score and the ranked probability score are standard examples. Accuracy is not one.
A classifier that returns probabilities is making a forecast: "70% billing, 20% technical, 10% other." Once the true label is known, we want a single number that says how good that forecast was. A scoring rule S(q, y) does exactly that: it takes the reported distribution q and the observed outcome y and returns a score (higher is better, or a loss, lower is better, depending on convention).
Accuracy is the scoring rule most people reach for, and it is a bad one for probabilities. Accuracy only looks at the argmax. A forecast of 0.51 and a forecast of 0.99 on the correct label score identically, and so do 0.49 and 0.01 on the wrong one. A model optimised only for accuracy has no reason to make its probabilities mean anything.
Proper and strictly proper
Suppose the true probability of each outcome is p. If you report q, your expected score is:
Show technical detailsHide technical details· text sample
A scoring rule is proper if reporting q = p maximises that expectation, and strictly proper if q = p is the unique maximiser. In words: under a strictly proper rule, any distortion of your true belief, whether toward over-confidence or under-confidence, lowers your expected score. Honesty is the optimal strategy.
This is the key result formalised by Gneiting and Raftery (2007). It is why proper scoring rules are the standard for evaluating weather forecasts, and why they are a principled training objective for any model whose probabilities will be used downstream.
The four rules you will meet
Let q be the reported distribution over k outcomes and y the true outcome (or a one-hot vector t).
Show technical detailsHide technical details· 4 rows × 4 columns
| Rule | Formula (as a reward, higher is better) | Strictly proper? | Character |
|---|---|---|---|
| Log score | log q(y) | Yes | Unbounded below; punishes near-zero mass on the truth very hard |
| Brier score | −Σ_i (q_i − t_i)² | Yes | Bounded; quadratic; less harsh on confident mistakes |
| Spherical score | q(y) / ‖q‖₂ | Yes | Bounded in [0, 1]; rewards mass on the truth relative to the vector's length |
| Ranked probability score (RPS) | −Σ_j (Q_j − T_j)² / (k − 1), with Q, T cumulative | Yes, for ordered outcomes | Respects order: "near misses" cost less than distant ones |
Log score is the same thing as negative cross-entropy, the usual training loss for classifiers. Its unboundedness is both its strength and its weakness. A forecast that puts probability zero on what happened scores minus infinity, which is the correct verdict on a forecaster who was certain and wrong, but it also means one bad example can dominate an average.
Brier score, introduced for weather forecasting in 1950, is the mean squared error between q and the one-hot outcome. It is bounded, so it is robust to occasional confident mistakes, and it decomposes neatly into calibration and refinement terms.
Spherical score normalises the probability on the true outcome by the Euclidean norm of the forecast. It is bounded and strictly proper, and it gives a different gradient profile than log score, which makes it a useful complement in a mixture.
RPS applies to ordinal outcomes. It compares the cumulative distribution of the forecast with the cumulative distribution of the truth. If the truth is level 1 on a 0 to 3 scale, putting mass on level 2 costs less than putting it on level 3. Log score cannot express that: it only looks at q(y).
A worked example
Here are four forecasts for a three-way outcome. The truth is option A.
Show technical detailsHide technical details· 4 rows × 4 columns
| Forecast (A, B, C) | Accuracy | Log score | Brier (as loss) |
|---|---|---|---|
| (0.60, 0.30, 0.10) | 1 | −0.51 | 0.26 |
| (0.99, 0.005, 0.005) | 1 | −0.01 | 0.0002 |
| (0.40, 0.55, 0.05) | 0 | −0.92 | 0.67 |
| (0.001, 0.998, 0.001) | 0 | −6.91 | 1.99 |
Accuracy cannot distinguish rows 1 and 2, or rows 3 and 4. Both proper rules can. Notice how differently they treat row 4: the log score is roughly seven and a half times worse than row 3, while Brier is only about three times worse. Which behaviour you want depends on how costly confident mistakes are for you.
The model card for Laya gives a real example of why this matters: on DAIR Emotion, Jev "assigned zero probability to the true label on 16% of examples." Under a log score, each of those is an unbounded penalty. Under accuracy, they are ordinary errors. A model trained against a proper rule learns not to do that.
How Laya uses proper scoring rules
Laya is trained with RLCD (reinforcement learning for calibrated decisions), where the reward for each reported distribution is a mixture of strictly proper rules. From the package source (proper_reward in common.py):
Show technical detailsHide technical details· text sample
A few implementation details are worth knowing:
- The log term is floored at −9.21, which is log(0.0001). That caps how much a single catastrophic example can contribute to a batch, a practical guard against the unboundedness discussed above. The floor only bites below 0.01% probability on the truth, so it preserves the incentive everywhere that matters.
- Targets can be soft. The reward is written as Σ t_i log q_i, so the target t can be a teacher's distribution rather than a one-hot label. Positive combinations of strictly proper rules remain strictly proper.
- RPS is only added for
scorequestions, normalised by (k − 1), so ordinal questions are rewarded for putting mass near the true level.
Because the combined reward is strictly proper, the expected-reward-maximising policy reports its true belief. The model card phrases it as: "Expected reward is maximised only by reporting honest probabilities." The RL mechanics are covered in RLCD.
What proper scoring does not guarantee
A strictly proper objective makes honesty optimal in expectation. It does not make a finite model perfectly calibrated on your data. Three gaps remain, and the model card is candid about them:
- Over-confidence at shipping time. Refitting one temperature per (question type, option count) moves mean ECE from 0.466 to 0.081 on the English checkpoint and from 0.314 to 0.106 on the multilingual one. That is a large post-hoc correction, and you should do it on your own data. See temperature scaling.
- Distribution shift. A model that is honest on its training distribution can be confidently wrong elsewhere. The English checkpoint scores 0.000 accuracy at 0.952 confidence on Khmer, which is why Laya routes by language. See language routing.
- Soft-target fit. On the typed-decisions benchmark, the fine-tuned checkpoint wins on argmax accuracy (0.766 vs 0.727) but Jev achieves higher soft accuracy against the teacher distributions (0.580 vs 0.471).
Measure the result with a proper score such as Brier alongside a calibration metric such as expected calibration error. ECE on its own is not a proper scoring rule and can be gamed.
Scoring Laya Studio responses against your own labels
The practical use of all this is evaluation. Send a labelled sample through Laya Studio and score the returned distributions with a proper rule:
Show technical detailsHide technical details· bash sample
Then, for each labelled item, compute the scores from answers.department.probabilities:
Show technical detailsHide technical details· python sample
Averaged over a few hundred labelled items, these numbers tell you whether the probabilities are good enough to threshold, and whether a temperature fitted on your data improves them. Billing is per input token (1 credit = 1 input token), so a few hundred short items cost very little. Start at /signup and see /docs for batching guidance.
Frequently asked questions
Is cross-entropy loss a proper scoring rule?
Is accuracy a proper scoring rule?
Is expected calibration error a proper scoring rule?
Why does Laya use more than one scoring rule?
If training is proper, why do I still need temperature scaling?
What is the difference between a proper and a strictly proper scoring rule?
Is the Brier score a proper scoring rule?
Sources
- Gneiting & Raftery (2007), Strictly Proper Scoring Rules, Prediction, and Estimation (JASA)
- Brier (1950), Verification of Forecasts Expressed in Terms of Probability
- Laya model card: RLCD training
- Laya source code (common.py, proper_reward)
- Guo et al. (2017), On Calibration of Modern Neural Networks
Last updated . Laya Studio is an independent hosted service for the open-source Laya model (Apache-2.0, © Convai Innovations) and is not affiliated with Convai Innovations or TypeSafe.
Next articleRLCD: reinforcement learning for calibrated decisionsRLCD trains Laya with reinforcement learning whose reward is a strictly proper scoring rule, so honest probabilities score best. What it fixes and what not.