Allocation
Track the evidence a search gathers at each checkpoint: observed returns, purchases, and in-flight continuations.
BetaBernoulli
Section titled “BetaBernoulli”Model returns in [0, 1] with a Beta prior centered on the critic prediction. This is the default calibration model for ErrorReduction, including tasks with binary correctness rewards.
One failed and one successful continuation revise the prior mean from 0.8 to 0.6. The model estimates squared critic error as 0.10 and next-outcome variance as 0.24. Critic values or return means outside [0, 1] are clamped with a warning; choose Gaussian for unbounded returns.
Definition
BetaBernoulli.init
Section titled “BetaBernoulli.init”BetaBernoulli.posterior
Section titled “BetaBernoulli.posterior”Use the critic prediction and observed returns to form a Beta posterior. Return the posterior expected squared critic error and Bernoulli predictive variance.
CalibrationModel
Section titled “CalibrationModel”Define the statistical model that turns a critic prediction and observed returns into an estimated squared value error and the predictive variance of another return. ErrorReduction uses these two quantities to estimate the benefit of another continuation.
This example assumes normally distributed returns with known variance 0.25. The first result estimates squared critic error, including uncertainty in the return mean. The second is the predictive variance of one additional return. value is the frozen critic prediction, stats summarizes observed suffix returns, and positive kappa is the critic prior strength. ErrorReduction consumes these statistics; training targets come from a separate recursive backup over the completed tree.
Definition
CalibrationModel.posterior
Section titled “CalibrationModel.posterior”Required implementation.
Return (expected_squared_error, predictive_variance). The squared error compares the supplied critic prediction with the unknown expected return. Predictive variance includes uncertainty about that expected return as well as variation between individual outcomes. Implement this method for your return distribution; RewardConfig.value_prior_strength supplies positive kappa.
Gaussian
Section titled “Gaussian”Model real-valued returns with a normal approximation. Use the observed sample variance once two returns are available; v_prior supplies the variance before then, and var_floor bounds it away from zero.
Use this model for real-valued returns. Before two observations, v_prior=0.25 supplies the outcome variance. Afterward, the sample variance is floored at 0.001. The predictive variance also includes uncertainty in the return mean.
Definition
Gaussian.init
Section titled “Gaussian.init”Gaussian.posterior
Section titled “Gaussian.posterior”Return the squared difference between the critic and refined mean plus posterior mean variance, together with the predictive variance of the next return.
RolloutLedger
Section titled “RolloutLedger”Track the continuation outcomes observed from each checkpoint across the passes of one search. Allocation uses these observations to decide where another continuation is useful.
Definition
RolloutLedger.init
Section titled “RolloutLedger.init”RolloutLedger.bind
Section titled “RolloutLedger.bind”RolloutLedger.record
Section titled “RolloutLedger.record”EVIDENCE_KEY
Section titled “EVIDENCE_KEY”The root-metadata key under which a search stores its rollout evidence ledger.
Definition
RolloutEvidence
Section titled “RolloutEvidence”Store the suffix-return observations and reward configuration shared by allocation and training preparation.
Definition
Fields
evidence_of
Section titled “evidence_of”Read the rollout evidence ledger a search recorded on a tree. Raises ValueError for a tree without one.
Definition
retraining_gain
Section titled “retraining_gain”Compute the marginal reduction in the blended value estimate’s mean squared error from squared critic error, predictive return variance, effective evidence count, and prior strength. A nonpositive result declines the continuation.
Definition