Glossary
Reward shaping
Reward shaping adjusts or combines the rewards used in reinforcement learning to steer a model toward the behaviour you want and help it learn faster.
Swiss-hosted inference. Nothing you send is ever stored. Swiss data residency
Definition
What Reward shaping means
Reward shaping is the practice of designing or augmenting the reward in reinforcement learning so a policy learns faster or learns the behaviour you actually want. Classic shaping adds intermediate rewards on the way to a sparse goal. The danger is well known: a shaped reward can change the optimal policy, and the agent learns to exploit the shaping term instead of solving the task ("reward hacking"). Potential-based shaping (Ng, Harada and Russell, 1999) is a form proven not to change the optimal policy.
Shaping with proper scoring rules
For a model that reports probabilities, there is a clean way to shape without hacking: build the reward only from strictly proper scoring rules. Each strictly proper rule is maximised in expectation by the true distribution, and a positive-weighted sum of proper rules is still proper. So you can combine rules for their different behaviour without introducing an incentive to misreport.
Laya's shaped reward
RLCD uses exactly this construction:
- Log score: sharp, heavily penalises putting near-zero probability on the true answer. Its log term is floored at −9.21 so a single catastrophic example cannot dominate an update.
- Spherical score, weight 0.5: bounded, gentler on mistakes, which stabilises learning.
- Ranked probability score, weight 1.0, subtracted only for ordinal
scorequestions: it compares cumulative distributions, so predicting level 2 when the truth is level 3 costs less than predicting level 0.
The RPS term encodes a property the log and spherical scores ignore, ordinal distance, without rewarding dishonest probabilities. Note one caveat: the log floor makes the combined reward very slightly less than strictly proper for extreme reports, a deliberate trade for stable training.
See proper scoring rules and the RLCD explainer.
Related terms
How Reward shaping connects to the rest of the vocabulary.
Go deeper
- ExplainerProper scoring rules: rewarding a model for honest probabilitiesWhat a proper scoring rule is, why accuracy is not one, and how log, Brier, spherical and RPS scores reward honest probabilities, as in Laya's training.
- ExplainerRLCD: 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.
Get started
Try it on your own text
Send any text with your own typed questions and get a calibrated probability for every answer. 6k free tokens, no card needed; then $0.0357 per 1M input tokens — 15% below Jev.
Swiss-hosted inference. Nothing you send is ever stored.