Code and dense tables are folded away. Open any of them on demand.
What is RLCD, and what problem does it solve?
RLCD (reinforcement learning for calibrated decisions) is the training recipe Convai Innovations used for Laya. The model is treated as a policy that reports a probability distribution over the options, and its reward is a strictly proper scoring rule computed from the true outcome, so reporting honest probabilities is the reward-maximising behaviour.
A decision model is only as useful as the numbers it reports. If a router says "90% billing", downstream code will act on that 90%: auto-route above a threshold, escalate below it, or combine it with a cost. That only works if 90% means roughly nine in ten are right.
Standard training does not guarantee this. Modern neural networks trained with cross-entropy are frequently over-confident, a finding documented at length by Guo et al. (2017). Large language models add their own problem: the probability of a generated label token depends on phrasing, tokenisation and sampling settings, and verbalised confidence ("I am 95% sure") is a separate text output with no guarantee of meaning.
RLCD (reinforcement learning for calibrated decisions) is Convai Innovations' name for the training recipe used for Laya. Its central idea is simple: make the reward itself a strictly proper scoring rule, so that the policy with the highest expected reward is the one that reports its true beliefs.
Decisions as a policy that reports a distribution
In RLCD the "action" is not a label. It is a probability distribution over the options of a question. For a choice question with k options, the policy observes the state and the question, and reports q = (q_1, ..., q_k). After the true outcome is revealed, the reward is:
Show technical detailsHide technical details· text sample
Framing the report as the action has a direct consequence. Under a strictly proper rule, for any belief p the expected reward E_{y~p}[R(q, y)] is maximised uniquely at q = p. A policy that shades its report toward the favourite (over-confidence) or toward uniform (hedging) earns less on average. The theory is in proper scoring rules.
The reward Laya actually uses
The package's proper_reward function combines three strictly proper rules:
Show technical detailsHide technical details· text sample
Details from the source:
- The log term is clamped at −9.21 (log 0.0001), which bounds the damage one example can do to a batch.
- The target can be a soft distribution, not just one-hot, so a teacher's probabilities can be used as targets. The model card's typed-decisions table reports a "teacher self-agreement ceiling", which indicates teacher-labelled data in at least that benchmark.
- Masks let a single batch mix questions with different numbers of options.
Exploration and the policy-gradient update
Reinforcement learning needs exploration: the policy has to try reports other than its current best guess to learn which ones score better. The model card describes RLCD's mechanism:
- Exploration noise. Zero-mean Gaussian noise is added to the option logits, producing perturbed reports q̃ around the policy's current distribution.
- Reward. Each perturbed report is scored with the proper reward above.
- Baseline. Rewards within a group of samples for the same item are compared with the group mean. This is the group-relative baseline popularised by GRPO (Shao et al., 2024), and it reduces the variance of the gradient without a learned value network.
- Update. The policy is updated with REINFORCE (Williams, 1992): perturbations that scored above the group mean are made more likely, those below less likely.
In plain terms: "try slightly different probability reports, keep the ones that a proper scoring rule liked better." Because the scoring rule rewards honesty, the policy is pushed toward reports that match the empirical frequencies of outcomes.
Multi-turn decisions and TD(λ)
Some decisions evolve over a conversation. Whether a customer will churn is clearer at turn eight than at turn two. RLCD handles multi-turn trajectories by training on prefix slices of the conversation and using temporal-difference targets (Sutton, 1988).
The package's td_lambda_targets walks each episode backwards:
Show technical detailsHide technical details· text sample
With λ = 1.0, which the model card states is what Laya uses, every prefix is trained toward the final outcome: a Monte Carlo target. Smaller λ would bootstrap from the model's own prediction at the next step. The effect is that an early turn is rewarded for the probability it assigns to the eventual outcome, which is the right target for "how likely is this conversation to end in escalation?"
The act head: trained, but not yet useful
Alongside the option scorer, Laya's decision model has an act head: a small network that reads the pooled representation plus four summary features of the answer distribution (top probability, margin between top two, normalised entropy, and option count) and outputs whether to act or escalate. It is sized from an act_costs configuration, which suggests it was trained with per-action costs.
The model card is explicit that this output does not work yet: "action.act_probability carries no usable signal yet. It reads 1.0 for almost every input, and its raw logits run against correctness (AUROC 0.30 on 396 labelled decisions). Gate on confidence instead, which reaches an AUROC of 0.77 on the same items." See act and escalate routing for how to build that gate yourself.
What RLCD does and does not deliver
RLCD makes honesty the optimal policy in expectation. The measured results show that this is necessary but not sufficient:
| What the model card reports | Value |
|---|---|
| Mean ECE, English checkpoint, as shipped | 0.466 |
| Mean ECE, English checkpoint, after per-bucket temperature refit | 0.081 |
| Mean ECE, multilingual checkpoint, as shipped | 0.314 |
| Mean ECE, multilingual checkpoint, after refit | 0.106 |
| ECE, typed-decisions benchmark, fine-tuned checkpoint | 0.213 |
| ECE, typed-decisions benchmark, Jev 1.13.0 (published) | 0.144 |
The card summarises: the model "ships over-confident". The training objective points the right way, but the finished checkpoints still need post-hoc temperature scaling on your data before their probabilities should be trusted for thresholds. The card also does not publish an ablation comparing RLCD against plain supervised cross-entropy training with the same data, so treat RLCD as a principled design choice rather than a measured advantage over supervised training.
Using RLCD-trained probabilities through Laya Studio
Laya Studio serves the RLCD-trained checkpoints. The fields that come out of the reward design are probabilities and confidence. A good first exercise is to collect a labelled sample and check calibration before relying on a threshold:
Show technical detailsHide technical details· bash sample
A list state is serialised as JSON, so the model sees the whole conversation. The response returns answers.churn_risk.noul and answers.frustration.probabilities, plus action.act_probability, which you should ignore for now. Log the probabilities against outcomes, compute expected calibration error per question type, and fit temperatures if needed. Two questions read the state twice, billed per input token. Start with 5 free runs at /signup, and see the docs for response fields.
Frequently asked questions
Is RLCD the same as RLHF?
Why use reinforcement learning at all if the reward is differentiable?
Does RLCD make Laya calibrated out of the box?
What is GRPO-style about it?
Can I fine-tune Laya with RLCD myself?
What does RLCD stand for?
Why does calibration matter for automated decisions?
Sources
- Laya model card: Training section
- Laya source code (common.py: proper_reward, td_lambda_targets)
- Williams (1992), Simple Statistical Gradient-Following Algorithms (REINFORCE)
- Shao et al. (2024), DeepSeekMath (introduces GRPO)
- Sutton (1988), Learning to Predict by the Methods of Temporal Differences
- Gneiting & Raftery (2007), Strictly Proper Scoring Rules
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 articleEncoder vs decoder models: which architecture should make your decisions?Encoder vs decoder transformers: encoders read text in one pass, decoders write it token by token. What that means for classification cost, speed and output.