Monte Carlo estimation of generalized surprisal #
Generalized surprisal warps an expectation over the alternatives a language model samples, and
[GOC24] estimate it by warping the mean score of finitely many sampled
alternatives. The estimator is consistent when the warping is continuous: by the strong law of
large numbers the mean score converges almost surely to the expected score
(ae_tendsto_mcEstimate). With the identity warping it is also unbiased
(integral_mcEstimate_id).
Main definitions #
mcEstimate: the warped mean score of the firstNalternatives.
Main results #
ae_tendsto_mcEstimate: consistency for a warping continuous at the expected score.integral_mcEstimate_id: unbiasedness for the identity warping.
Implementation notes #
- The alternatives are random variables on a probability space, each distributed as the language model in the context; the paper draws them by ancestral sampling. Consistency assumes them pairwise independent, the hypothesis of mathlib's strong law.
- Consistency needs the warping continuous only at the expected score, where the paper assumes it continuous.
References #
The Monte Carlo estimate of generalized surprisal from the first N alternatives v: the
warping f of their mean score against the target w in the context c.
Equations
- Surprisal.mcEstimate f g c w v N = f ((↑N)⁻¹ * ∑ n ∈ Finset.range N, g (v n) w c)
Instances For
The Monte Carlo estimate is consistent: for pairwise independent alternatives distributed as the language model and a warping continuous at the expected score, it converges almost surely to the generalized surprisal.
With the identity warping, the Monte Carlo estimate from N ≠ 0 alternatives distributed as
the language model is unbiased.