Measure-Valued Forecast Martingale Regularizer
Implementation & benchmark of arXiv:2606.31621 — Calibrated Probability Forecast Sequences and Measure-Valued Martingales
Source paper: Calibrated Probability Forecast Sequences and Measure-Valued Martingales arXiv:2606.31621 ⓘ · analyzed Aug 29, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Attach predictive distributions to successive information-update steps of a recurrent, state-space, iterative, or diffusion model and penalize violations of the measure-valued martingale condition. The model may become more certain as information arrives, but its later forecasts must not exhibit systematic conditional bias relative to earlier forecasts.
Formulas
Mathematical statement
The paper defines auto-calibration as \(\mu_i=\mathcal{L}(Y\mid\mu_1,\ldots,\mu_i)\), where \(Y\) is the target, \(\mu_i\) is the probability-measure forecast at step \(i\), and \(\mathcal{L}(Y\mid\cdot)\) is the conditional law. The corresponding measure-valued martingale condition is \(\mathbb{E}[\mu_{i+1}(A)\mid\mu_1,\ldots,\mu_i]=\mu_i(A)\) for every measurable event \(A\). Here \(\mu_i(A)\) denotes the probability assigned to event \(A\), and the conditional expectation averages future information while fixing the current forecast history. For a categorical target with \(K\) classes, represent \(\mu_i\) by \(p_i\in\Delta^{K-1}\), where \(p_{i,k}=\mu_i(\{k\})\), and enforce \(\mathbb{E}[p_{i+1,k}-p_{i,k}\mid H_i]=0\), with \(H_i=(p_1,\ldots,p_i)\). A finite test-function characterization penalizes moments \(\mathbb{E}[(p_{i+1,k}-p_{i,k})h_r(H_i)]\), where \(h_r\) are bounded functions of the forecast history. The regularizer below is the squared empirical version of these conditional moment restrictions.
Implementation notes
(1) Integration point: expose a predictive distribution at every information-update step of an RNN, SSM, iterative classifier, or diffusion denoiser. For a categorical target, each head produces logits \(z_i\) and probabilities \(p_i=\operatorname{softmax}(z_i)\). Add the regularizer to cross-entropy or negative log-likelihood during training; do not force adjacent forecasts to be equal, since legitimate information can change the distribution. (2) Pseudocode: for each minibatch of size \(B\), compute \(p_1,\ldots,p_n\). For each \(i<n\), construct \(H_i=[p_1;\ldots;p_i]\), evaluate bounded history features \(h_r(H_i)\) for \(r=1,\ldots,R\), and calculate \(m_{ikr}=B^{-1}\sum_{b=1}^{B}(p^{(b)}_{i+1,k}-p^{(b)}_{i,k})h_r(H_i^{(b)})\). Use \(L=L_{\mathrm{NLL}}+\lambda\sum_{i,k,r}m_{ikr}^2\), then backpropagate. Use coordinate features, random Fourier features, or a small frozen/randomly refreshed feature MLP; standardize each feature over the batch. (3) The paper supplies the martingale condition; finite-batch moments and the selected feature family are approximations. Evaluate held-out moment norms and bootstrap confidence intervals, and include \(h=1\) plus nonlinear history features so the test is not merely unconditional mean preservation. (4) First experiment: train a 6-step GRU classifier on sequentially revealed MNIST pixels or CIFAR-10 patches. Compare cross-entropy alone with \(\lambda\in\{0.01,0.1,1\}\). Measure accuracy, NLL, expected calibration error at every step, held-out martingale moment norm, and robustness under corrupted or shifted inputs. Success means lower held-out moment violation and calibration error without accuracy degradation, with under 10% additional training FLOPs.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built a PyTorch 6-step GRU categorical forecaster with the finite-feature measure-valued martingale regularizer, plus a direct toy verification. The toy check reproduced the claimed phenomenon: a history-biased increment had a 436x larger moment norm than an unbiased increment. However, lambda values in the proposed range 0.01–1 produced essentially no change in held-out violations, while lambda=1000 gave only a modest and inconsistent reduction, without reliable calibration improvement.
- Agent confidence
- 8/10
- Baseline
- lambda=0: final NLL 0.2993, accuracy 89.45%, final ECE 0.0487, mean held-out moment norm 0.01976
- Idea
- lambda=0.1: final NLL 0.2993, accuracy 89.45%, final ECE 0.0487, mean held-out moment norm 0.01976; lambda=1: NLL 0.2993, accuracy 89.45%, ECE 0.0487, norm 0.01974; lambda=1000 primary seed: NLL 0.2875, accuracy 89.71%, ECE 0.0499, norm 0.01688
Limitations: The dataset is synthetic rather than revealed MNIST or CIFAR, training uses full-batch optimization, and only a small number of seeds was tested. Corruption or shift robustness, bootstrap confidence intervals, FLOP accounting, and larger recurrent or state-space models were not evaluated.
How to run: python3 martingale_experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- martingale_experiment.py 4.8 KB View Raw
- report.md 1.5 KB View
- results.json 3.2 KB View Raw