Introduction
Everyone builds reasoning memories. Thought templates (Yang et al., 2024a), reasoning and workflow memories (Ouyang et al., 2026; Wang et al., 2025b; Suzgun et al., 2026), behavior handbooks (Didolkar et al., 2025), skill libraries (Wang et al., 2024a, 2025a), answer caches (Bang, 2023; Schroeder et al., 2026), and the memories that agents share (Zhang et al., 2025a) or rewrite themselves from (Zhang et al., 2026a) all do one thing: they compile a derivation of m ≥ 2 m \ge2 m ≥ 2 steps into a one-step contracted memory for later instances of the problem. We call this reasoning contraction . Trusting such a memory is a sequential test, bound by the limits of change detection and certification.
Live reasoning is costly and fragile. LLM reasoners buy accuracy with computation: voting over sampled chains (Wang et al., 2023), tree search (Yao et al., 2023a), tool calls (Yao et al., 2023b) and self-critique (Shinn et al., 2023; Madaan et al., 2023). Every step is another chance to err. On the unedited facts of our multi-hop benchmark, Qwen3-8B’s live accuracy falls from 0.63 at two hops to 0.31 at three and 0.19 at four (Appendix D). A verified contracted memory answers in one step; on our edited streams it raises Qwen3-8B’s accuracy from 0.379 to 0.648 with fewer calls (Table 3). The price is a new failure mode shared by all these systems: when the facts behind a memory change, it keeps answering, wrongly. This is the utility problem of macro learning (Minton, 1990), now for LLM memories over changing facts.
Memories are trusted by counters, which are badly tuned change detectors. ExpeL and ACE vote memories up and down (Zhao et al., 2024; Zhang et al., 2026b), and validation-gated memories clip a Hebbian strength (Singh and Yu, 2025). Every clipped counter is a cumulative-sum (CUSUM) change detector in disguise, testing an implied change that nobody chose (Section 3). A symmetric counter assumes that a stale memory is as often wrong as a fresh one was right, so counting votes equally is provably the wrong detector for partial staleness : when an edit leaves a memory failing less than half the time, the counter’s evidence drifts the wrong way, and its delay grows as a power of its false-alarm horizon, not its logarithm (Theorem 1, Figure 1b). Unclipped counters are worse: credit banked while the memory was healthy must be spent before retirement. On KQA-STREAM, multi-hop questions over controlled knowledge-base edits, ExpeL- and ACE-style counters leave about half of the same 156 stale memories in service at stream end, against 2% for a likelihood-ratio rule, and need about 60× \times × more uses to retire them (restricted mean; Figure 2 ). On five open LLMs they serve 7.0–13.5× \times × more stale answers than our certificate given the same information (no notices; Table 2); on code, larger still (§ 6 ).
Figure 2. Counters leave half the stale memories in service at stream end; likelihood ratios retire them about 60× sooner (restricted mean). Kaplan–Meier share of the 156 stale memories not yet retired (same audits for all rules; counters start at the fold without credit). Legend: share still in service when the stream ends (open episodes, so it differs from the curve’s tail at 10 4 10^4 1 0 4 uses) / restricted mean delay (≤ 10 4 \leq10^4 ≤ 1 0 4 uses). Bands: 95% template bootstrap.
Safety has a price. Can a memory be safe and still skip most reasoning? One number decides: the certification load Θ = ν ln ( 1 / δ ) / ( p K L ) \Theta= \nu\ln(1/\delta)/(p\mathrm{KL}) Θ = ν ln ( 1/ δ ) / ( p KL ) , which combines the rate of change (ν \nu ν ), the risk tolerated (δ \delta δ ), the audit rate (p p p ) and how much one verified outcome reveals (K L \mathrm{KL} KL ). Whatever its algorithm, every safe memory must, in the worst case and as δ → 0 \delta\to0 δ → 0 , leave a share F π ( Θ ) F_{\pi}(\Theta) F π ( Θ ) of queries to multi-step reasoning, and a restarted test achieves it (Theorem 3, Figure 1 c). Under Zipf demand it scales as κ s Θ 1 − 1 / s \kappa_s\Theta^{1-1/s} κ s Θ 1 − 1/ s (Corollary 4): popular problems can be contracted; rare ones change before they can be trusted.
Figure 1. Trusting a contracted memory is a sequential test. (a ) Top: the lifecycle of a contracted memory (a macro ). In shadow mode a betting certificate scores the macro’s verified answers and folds it (one-step answers) once its wealth reaches 1 / δ 1/\delta 1/ δ ; a likelihood-ratio CUSUM (LR-CUSUM) alarm or an edit notice retires it, and the next candidate restarts the test. Middle: both tests on one real macro (Qwen3-8B, KQA-STREAM; per candidate, no notices). Its log-wealth reaches ln 20 \ln20 ln 20 (δ = 0.05 \delta= 0.05 δ = 0.05 ) after 33 labels; an edit then drops its reliability from 1.00 to 0.37, below break-even (r ⋆ = 0.49 r^\star= 0.49 r ⋆ = 0.49 ), and the LR-CUSUM crosses h = 7 h = 7 h = 7 on the fourth label. Bottom: its timeline (hatched: certification); ExpeL- and ACE-style counters have not retired it by stream end (2,427 stale answers, against 29). (b ) Exact detection delay D D D against uses to a false retirement A A A for three clipped counters (score per failure/success), failure rate 0.05 → \to → 0.25: the symmetric ± 1 \pm1 ± 1 rule is slow by a power of A A A ; likelihood-ratio weights (+ 7 / − 1 +7/-1 + 7/ − 1 ) track the optimum. q ~ \tilde{q} q ~ : the failure rate a rule implicitly tests (Remark 1). (c ) The exact coverage gap M M M (share not answered in one step) of a restarted test for 2,520 settings (dots) lies on the limit F π ( Θ ) F_{\pi}(\Theta) F π ( Θ ) (lines).
The recipe. Three changes turn a counter into a certificate , a rule that lets a memory answer in one step only while the risk of trusting a bad one stays below δ \delta δ (§ 5 ). (i) Weigh each memory’s failures against its successes by its own likelihood ratio, set by its healthy and stale fail-ure rates; on KQA-STREAM this detects staleness in 1.3–5.9× \times × fewer uses than the best tested fixed weighting. (ii) Certify utility, not accuracy, by betting on the paired difference with live reasoning on the same query, with no estimate of live accuracy. (iii) Restart a memory’s certificate whenever its answers or the live reasoning it competes with change, so every trust decision rests on current evidence. Where edits are substantial, our deployment also invalidates memories an edit announces, and the likelihood-ratio detector is the safety net for unannounced edits; it cuts stale answers 9–12× \times × against invalidation alone. On five models it trusts under one below-break-even memory per stream (with notices; counters: 111–595) and, scoring answers alone, makes no false certification at δ ≤ 0.1 \delta\le0.1 δ ≤ 0.1 .
Agent memories and skill libraries with a verifier should therefore adopt these changes, and memory benchmarks should edit facts.
Contributions and what is new. Our results apply when facts can change and each memory can be judged only by its own verified outcomes. (1) A concept : reasoning contraction, one lens on templates, skills, memories and caches, whose two risky decisions, trust and retirement, are sequential tests bound by the limits of change detection and certification (Figure 1 a); done safely, KQA-STREAM’s symbolic macros add 14–33 points over live reasoning. (2) Two theorems : the phase diagram of counter maintenance (equal votes: delay ≍ A 0.373 \asymp A^{0.373} ≍ A 0.373 , not ln A \ln A ln A , at failure rate 0.05 → \to → 0.25), with the learning rates that fix it (Theorem 1 and Corollary 2), and the certification-load limit with its scaling law κ s Θ 1 − 1 / s \kappa_s\Theta^{1-1/s} κ s Θ 1 − 1/ s , matched within 0.945–1.025× by a restarted test (Theorem 3 and Corollary 4). (3) A certificate : a per-template certify–retire–restart lifecycle from standard anytime-valid tools (Yu et al., 2026b), tested on KQA-STREAM (with invalidation, no stale answers under notices; 7.0–13.5× fewer than counters without), natural Wikidata edits and code. Where memory systems vote and anytime-valid routing certifies one global threshold, we test each memory’s trust over its lifecycle: memory systems with a verifier should give each memory its own weight and certificate, and price skipped reasoning by Θ \Theta Θ .
Contraction as a memory lifecycle
Queries, templates, macros. A reasoner serves a stream of queries. Each query instantiates a template i i i , a canonical derivation skeleton such as a relation path in a knowledge base, a lemma chain, or a tool-call sequence. Template i i i is drawn with probability π i \pi_i π i and has a live derivation of m i ≥ 2 m_i \ge2 m i ≥ 2 steps (LLM calls). A macro for template i i i is a one-step operator formed from a verified derivation: a materialized composed relation, a stored lemma, or a distilled direct-answer note. Its reliability r r r is the probability that it answers a random instance of i i i correctly. On each query the system answers live (cost m m m , correct with probability a a a ), folded (cost 1, answer from the trusted macro), or in shadow mode (live answer, macro evaluated alongside). A verifier (exact match, execution, or a unit test) labels the macro’s answer on audited queries , a fraction p ∈ ( 0 , 1 ] p \in(0, 1] p ∈ ( 0 , 1 ] of the template’s shadow or folded queries. With error price L L L (in steps), a folded query costs 1 + L ( 1 − r ) 1 + L(1-r) 1 + L ( 1 − r ) and a live one m + L ( 1 − a ) m + L(1-a) m + L ( 1 − a ) , so folding pays if and only if
r > r ⋆ : = a − ( m − 1 ) / L . (1) r > r^\star:= a - (m-1)/L. \tag*{(1)} r > r ⋆ := a − ( m − 1 ) / L . (1)
The lifecycle. Contraction is a memory lifecycle (Figure 1 a): form a candidate from a verified trace, certify it in shadow mode, fold it, monitor it, retire it when it goes stale, and re-form . Two decisions carry all the risk: when may a candidate be trusted (certification) and when has a trusted macro gone stale (retirement). Verifier outcomes Y ∈ { 0 , 1 } Y \in\{0,1\} Y ∈ { 0 , 1 } of a macro are conditionally Bernoulli given the past, with mean equal to its current reliability; this allows adaptive usage and drift. A macro is stale once an edit has raised its failure rate: healthy macros fail with probability q 0 q_0 q 0 , stale ones with q 1 > q 0 q_1 > q_0 q 1 > q 0 .
Maintenance rules in current systems. Expel gives a new insight importance 2, adds 1 per up-vote or edit, subtracts 1 per down-vote and deletes it at 0 (Zhao et al., 2024). ACE keeps unbounded helpful/harmful counts, and its released code flags a bullet when harmful ≥ \ge ≥ helpful and harmful > 0 > 0 > 0 (Zhang et al., 2026b); our ACE-style baseline treats a flag as retirement. We idealize their LLM-issued votes as one vote per verified use. Validation-gated Hebbian memories clip a strength to [ 0 , 1 ] [0,1] [ 0 , 1 ] with time decay (Singh and Yu, 2025); we analyze the symmetric variant c ← min { 1 , c + η + } c \leftarrow\min\{1,c+\eta_+\} c ← min { 1 , c + η + } on success and c ← c − η − c \leftarrow c-\eta_- c ← c − η − on failure, retiring below τ \tau τ .
Memory counters are change detectors
A score rule assigns a bounded score f ( Y ) f(Y) f ( Y ) to each verifier outcome, keeps
S n = max { 0 , S n − 1 + f ( Y n ) } , (2) S_n = \max\{0, S_{n-1} + f(Y_n)\}, \tag*{(2)} S n = max { 0 , S n − 1 + f ( Y n )} , (2)
and retires the macro at the first n n n with S n ≥ h S_n \ge h S n ≥ h . Clipped Hebbian confidence has this form. With S = ( 1 − c ) / η − S=(1-c)/\eta_- S = ( 1 − c ) / η − the score is + 1 +1 + 1 on a failure and − ρ -\rho − ρ on a success, ρ = η + / η − \rho=\eta_+/\eta_- ρ = η + / η − , and the clip at full confidence is the reflection at 0 (Appendix A). Let P 0 , P 1 P_0, P_1 P 0 , P 1 be the outcome laws of a healthy and a stale macro, with E 0 f < 0 < P 0 ( f > 0 ) \mathbb{E}_0 f<0<P_0(f>0) E 0 f < 0 < P 0 ( f > 0 ) , and let θ j > 0 \theta_j>0 θ j > 0 solve E j e θ j f = 1 \mathbb{E}_j e^{\theta_j f}=1 E j e θ j f = 1 (the Cramér–Lundberg adjustment coefficient under P j P_j P j ). We measure a rule by A A A , the mean number of healthy uses before it falsely retires a macro, and by D D D , its worst-case number of uses to detect a change (Lorden, 1971).
Remark 1 (Implied alternative). Every score rule ((2) ) is exactly Page’s CUSUM (Page, 1954) for the change P 0 → P ~ 0 : = e θ 0 f P 0 P_0 \to\widetilde{P}_0 := e^{\theta_0 f}P_0 P 0 → P 0 := e θ 0 f P 0 and for no other change, as for quality-control charts (Munford, 1980; Brook and Evans, 1972). The symmetric Hebbian rule (ρ = 1 \rho= 1 ρ = 1 ) thus tests failure rate q 0 q_0 q 0 against its mirror 1 − q 0 1-q_0 1 − q 0 : it assumes that a stale memory is as wrong as a fresh one was right (reliability 0.95 → \to → 0.05), whereas a fact edit may corrupt only part of a template’s instances (reliability 0.95 → \to → 0.75).
Theorem 1 (Phase diagram of maintenance rules). Let μ 1 = E 1 f \mu_1 = \mathbb{E}_1 f μ 1 = E 1 f and γ = θ 1 / θ 0 \gamma= \theta_1/\theta_0 γ = θ 1 / θ 0 . As A → ∞ A \to\infty A → ∞ ,
μ 1 > 0 : D = ln A θ 0 μ 1 + O ( 1 ) ; μ 1 = 0 : D = ( ln A ) 2 ( θ 0 σ 1 ) 2 + O ( ln A ) , σ 1 2 = Var 1 f ; μ 1 < 0 : D ≍ A γ if P 1 ( f > 0 ) > 0 , \begin{aligned}
\mu_1 > 0 &: \quad D = \frac{\ln A}{\theta_0\mu_1} + O(1);\\
\mu_1 = 0 &: \quad D = \frac{(\ln A)^2}{(\theta_0\sigma_1)^2} + O(\ln A), \quad\sigma_1^2 = \operatorname{Var}_1 f;\\
\mu_1 < 0 &: \quad D \asymp A^\gamma\quad\text{if } P_1(f > 0) > 0,
\end{aligned} μ 1 > 0 μ 1 = 0 μ 1 < 0 : D = θ 0 μ 1 ln A + O ( 1 ) ; : D = ( θ 0 σ 1 ) 2 ( ln A ) 2 + O ( ln A ) , σ 1 2 = Var 1 f ; : D ≍ A γ if P 1 ( f > 0 ) > 0 , where γ < 1 \gamma< 1 γ < 1 if and only if E 1 e θ 0 f > 1 \mathbb{E}_1 e^{\theta_0 f} > 1 E 1 e θ 0 f > 1 , e.g. whenever q 1 > q 0 q_1 > q_0 q 1 > q 0 for Bernoulli rules. In the first regime the efficiency relative to the optimal delay ln A / KL ( P 1 ∥ P 0 ) \ln A/\operatorname{KL}(P_1\Vert P_0) ln A / KL ( P 1 ∥ P 0 ) (Lorden, 1971) is
Eff = θ 0 μ 1 KL ( P 1 ∥ P 0 ) = 1 − KL ( P 1 ∥ P ~ 0 ) KL ( P 1 ∥ P 0 ) , (3) \operatorname{Eff} = \frac{\theta_0\mu_1}{\operatorname{KL}(P_1\Vert P_0)} = 1 - \frac{\operatorname{KL}(P_1\Vert\widetilde{P}_0)}{\operatorname{KL}(P_1\Vert P_0)}, \tag*{(3)} Eff = KL ( P 1 ∥ P 0 ) θ 0 μ 1 = 1 − KL ( P 1 ∥ P 0 ) KL ( P 1 ∥ P 0 ) , (3) so Eff ≤ 1 \operatorname{Eff} \le1 Eff ≤ 1 , with equality if and only if f f f is proportional to the log-likelihood ratio. When it applies: any clipped counter with a bounded score per verified outcome, when outcomes are i.i.d. before and after one change (constants in Appendix A).
Why three regimes. After a change the score drifts at rate μ 1 \mu_1 μ 1 . With positive drift it climbs to the threshold h ≈ ln A / θ 0 h \approx\ln A/\theta_0 h ≈ ln A / θ 0 in linear time, hence ln A \ln A ln A . With zero drift it diffuses and needs time h 2 h^2 h 2 . With negative drift it must make a rare excursion, like a false alarm but at the post-change exponent θ 1 < θ 0 \theta_1 < \theta_0 θ 1 < θ 0 , hence e θ 1 h = A γ e^{\theta_1 h} = A^\gamma e θ 1 h = A γ . The sign is that of θ 0 μ 1 = KL ( P 1 ∥ P 0 ) − KL ( P 1 ∥ P ~ 0 ) \theta_0\mu_1 = \operatorname{KL}(P_1\Vert P_0)-\operatorname{KL}(P_1\Vert\widetilde{P}_0) θ 0 μ 1 = KL ( P 1 ∥ P 0 ) − KL ( P 1 ∥ P 0 ) : a rule detects a change quickly only if the change moves the outcome law closer to the rule’s implied alternative than to the healthy law. For the symmetric rule this requires q 1 > 1 2 q_1 > \frac{1}{2} q 1 > 2 1 . Partial staleness (reliability 0.95 → \to → 0.75) gives γ = ln 3 / ln 19 = 0.373 \gamma= \ln3/\ln19 = 0.373 γ = ln 3/ ln 19 = 0.373 (Figure 1b). The logarithmic regime is known (Section 7); the power-law regime and the unified diagram are new. Why it matters: under partial staleness, equal votes wait A γ A^\gamma A γ uses when clipped, not ln A \ln A ln A , and with positive probability forever when unclipped (Remark 2).
Corollary 2 (Likelihood-ratio learning rates). A clipped Hebbian rule is the likelihood-ratio CUSUM for q 0 → q 1 q_0 \to q_1 q 0 → q 1 , optimal at the false-alarm horizons its thresholds attain, if and only if
η + η − = ρ ( q 0 , q 1 ) : = ln 1 − q 0 1 − q 1 ln q 1 q 0 . (4) \frac{\eta_+}{\eta_-} = \rho(q_0,q_1) := \frac{\ln\frac{1-q_0}{1-q_1}}{\ln\frac{q_1}{q_0}}. \tag*{(4)} η − η + = ρ ( q 0 , q 1 ) := ln q 0 q 1 ln 1 − q 1 1 − q 0 . (4) When it applies: a memory whose healthy and stale failure rates q 0 < q 1 q_0 < q_1 q 0 < q 1 can be estimated (if only an interval for q 1 q_1 q 1 is known, tuning at its lower end is first-order minimax; Appendix A).
We use the Bernoulli likelihood-ratio CUSUM (LR-CUSUM ) of Reynolds and Stoumbos (1999) to set memory learning rates. Under partial staleness (q 0 = 0.05 q_0 = 0.05 q 0 = 0.05 , q 1 = 0.25 q_1 = 0.25 q 1 = 0.25 , ρ = 0.147 \rho= 0.147 ρ = 0.147 ): a failure must weigh about 7 successes, not 1 as in ExpeL and ACE. Scores + 7 / − 1 +7/-1 + 7/ − 1 detect in 41 and 54 uses at A ≈ 1.6 × 10 5 A \approx1.6 \times10^5 A ≈ 1.6 × 1 0 5 and 3 × 10 6 3 \times10^6 3 × 1 0 6 , 5.7× \times × and 13× \times × faster than the symmetric rule (Figure 1b). Why it matters: weighting each memory by its own ρ \rho ρ makes it the optimal detector of its q 0 → q 1 q_0 \to q_1 q 0 → q 1 ; if memories’ ρ \rho ρ differ, no global weight is optimal for all.
Remark 2 (Unclipped counters). An unclipped counter such as ExpeL’s or ACE’s (Section 2) rarely retires a healthy memory (A = ∞ A = \infty A = ∞ ) but has no finite worst-case delay: credit banked before a change must be spent first, at rate 2 q 1 − 1 2q_1 - 1 2 q 1 − 1 . Under partial staleness (q 1 < 1 2 q_1 < \frac{1}{2} q 1 < 2 1 ) the stale memory is never retired with probability at least 1 − 2 q 1 1 - 2q_1 1 − 2 q 1 (ACE) or 1 − ( q 1 / ( 1 − q 1 ) ) 2 1 - (q_1/(1-q_1))^2 1 − ( q 1 / ( 1 − q 1 ) ) 2 (ExpeL), i.e. 0.50 and 0.89 for reliability 0.95 → \to → 0.75 (Proposition 9 in Appendix A).
The price of safety: how far can reasoning contract?
How large a share of queries can any safe system answer in one step when facts keep changing?
Model. Queries of template i i i arrive at rate π i \pi_i π i (∑ i π i = 1 \sum_i \pi_i = 1 ∑ i π i = 1 ), and each is audited with probability p p p ; an audit reveals one verifier outcome of the candidate it evaluates. Each template’s facts change at rate ν \nu ν . After a change the current macro is invalid, and a candidate must earn trust in the new epoch. A candidate is good if its reliability is ≥ r 1 \ge r_1 ≥ r 1 and bad if it is ≤ r 0 < r 1 \le r_0 < r_1 ≤ r 0 < r 1 (e.g. r 0 = r ⋆ r_0 = r^\star r 0 = r ⋆ of (1) ). A fold event is a time when the system starts answering a template in one step with some candidate, formed in this or an earlier epoch. The coverage gap M M M is the long-run fraction of queries not answered in one step by a valid, certified macro.
Definition 1 (δ \delta δ -safety). A policy is δ \delta δ -safe if, for every epoch, every history before it and every outcome law within it, the probability that the epoch contains a fold event of a candidate that is bad in that epoch is at most δ \delta δ .
Safety is per epoch, not per candidate: folding each of many candidates blindly with probability δ \delta δ is safe per candidate but eventually folds a bad one. A sequential probability ratio test (SPRT), Λ n = ∑ k ≤ n ln Pr 1 ( Y k ) Pr 0 ( Y k ) \Lambda_n = \sum_{k\le n}\ln\frac{\Pr_1(Y_k)}{\Pr_0(Y_k)} Λ n = ∑ k ≤ n ln P r 0 ( Y k ) P r 1 ( Y k ) , that folds when Λ n ≥ ln ( 1 / δ ) \Lambda_n \ge\ln(1/\delta) Λ n ≥ ln ( 1/ δ ) and restarts at each change is δ \delta δ -safe by Ville’s inequality (Wald, 1945; Ville, 1939).
Theorem 3 (Fundamental limit of safe contraction). Let K L = K L ( r 1 ∥ r 0 ) \mathrm{KL}=\mathrm{KL}(r_1\Vert r_0) KL = KL ( r 1 ∥ r 0 ) (Bernoulli ), define the certification load
Θ : = ν ln ( 1 / δ ) p K L , (5) \Theta:= \frac{\nu\ln(1/\delta)}{p\,\mathrm{KL}}, \tag*{(5)} Θ := p KL ν ln ( 1/ δ ) , (5) and let F π ( Θ ) : = ∑ i π i ( 1 − e − Θ / π i ) F_\pi(\Theta):=\sum_i\pi_i(1-e^{-\Theta/\pi_i}) F π ( Θ ) := ∑ i π i ( 1 − e − Θ/ π i ) . (i) No safe policy does better: every δ \delta δ -safe policy has M ≥ ( 1 − ϵ δ ) F π ( Θ ) M\ge(1-\epsilon_\delta)F_\pi(\Theta) M ≥ ( 1 − ϵ δ ) F π ( Θ ) , where ϵ δ → 0 \epsilon_\delta\to0 ϵ δ → 0 as δ → 0 \delta\to0 δ → 0 , whether or not changes are announced and however many candidates it forms. (ii) A restarted test achieves it: the SPRT restarted at each change is δ \delta δ -safe and has M ≤ ( 1 + ln ( r 1 / r 0 ) / ln ( 1 / δ ) ) F π ( Θ ) M\le(1+\ln(r_1/r_0)/\ln(1/\delta))F_\pi(\Theta) M ≤ ( 1 + ln ( r 1 / r 0 ) / ln ( 1/ δ )) F π ( Θ ) . When it applies: facts change at random times, each audit reveals one outcome, only audited outcomes are informative (shadow agreement excluded; Theorem 22 ), and good memories have reliability only r 1 r_1 r 1 (the worst case; exact model in Appendix B).
Why F π ( Θ ) F_\pi(\Theta) F π ( Θ ) . A good candidate cannot be told apart from a bad one before its log-likelihood ratio reaches ln ( 1 / δ ) \ln(1/\delta) ln ( 1/ δ ) , which takes n ⋆ = ln ( 1 / δ ) / K L n^\star=\ln(1/\delta)/\mathrm{KL} n ⋆ = ln ( 1/ δ ) / KL audited uses, i.e. time n ⋆ / ( p π i ) n^\star/(p\pi_i) n ⋆ / ( p π i ) . A query is folded only if its epoch is older than that. Epoch ages are exponential with rate ν \nu ν , so this happens with probability e − Θ / π i e^{-\Theta/\pi_i} e − Θ/ π i . Popular templates certify quickly and are almost always covered; templates with π i ≲ Θ \pi_i\lesssim\Theta π i ≲ Θ change before certification. A change of measure makes this rigorous (Lai, 1981; Tartakovsky et al., 2014; Kaufmann et al., 2016). Under Zipf demand it becomes a scaling law:
Corollary 4 (Scaling law of one-step reasoning). If π i = i − s / ζ ( s ) \pi_i=i^{-s}/\zeta(s) π i = i − s / ζ ( s ) with s > 1 s>1 s > 1 , then for all Θ > 0 \Theta>0 Θ > 0
1 − 1 s − Θ ≤ F π ( Θ ) ≤ κ s Θ 1 − 1 / s , (6) 1-\frac{1}{s}-\Theta\le F_\pi(\Theta)\le\kappa_s\Theta^{1-1/s}, \tag*{(6)} 1 − s 1 − Θ ≤ F π ( Θ ) ≤ κ s Θ 1 − 1/ s , (6) with κ s = Γ ( 1 / s ) ( s − 1 ) ζ ( s ) 1 / s \kappa_s=\frac{\Gamma(1/s)}{(s-1)\zeta(s)^{1/s}} κ s = ( s − 1 ) ζ ( s ) 1/ s Γ ( 1/ s ) (κ 2 ≈ 1.38 \kappa_2\approx1.38 κ 2 ≈ 1.38 ). Hence the optimal gap is κ s Θ 1 − 1 / s ( 1 + o ( 1 ) ) \kappa_s\Theta^{1-1/s}(1+o(1)) κ s Θ 1 − 1/ s ( 1 + o ( 1 )) for small δ \delta δ and small load.
Reading the law. Drift, risk, audit rate, reliability gap and verifier noise (through the KL of the observed channel) enter only through Θ \Theta Θ , and the exponent 1 − 1 / s 1-1/s 1 − 1/ s is set by the demand tail alone. Why it matters: in this model no safe algorithm, candidate supply or notice beats the limit as δ → 0 \delta\to0 δ → 0 ; for given demand only a lower load contracts more. Figure 1 c checks the law exactly: the gap of the restarted SPRT, computed by dynamic programming for 2,520 settings of reliabilities, verifier noise, δ ∈ [ 10 − 32 , 0.03 ] \delta\in[10^{-32},0.03] δ ∈ [ 1 0 − 32 , 0.03 ] , audit and drift rates, has M S P R T / F π ( Θ ) ∈ [ 0.945 , 1.025 ] M_{\mathrm{SPRT}}/F_\pi(\Theta)\in[0.945,1.025] M SPRT / F π ( Θ ) ∈ [ 0.945 , 1.025 ] , and the fitted log-log slopes are within 0.008 of 1 − 1 / s 1-1/s 1 − 1/ s (finite-δ \delta δ bounds: Appendix B).
The recipe: a certificate that needs no live accuracy
The SPRT of Theorem 3 tests r ≤ r ⋆ r\le r^\star r ≤ r ⋆ , but r ⋆ r^\star r ⋆ involves the unknown live accuracy a a a (Equation (1) ), and plugging in an estimate breaks the guarantee.
Proposition 5 (Plug-in tests are not level δ \delta δ ). If the SPRT uses r 0 = a ^ − m − 1 L r_0=\hat a-\frac{m-1}{L} r 0 = a ^ − L m − 1 and r 1 = a ^ r_1=\hat a r 1 = a ^ with a ^ \hat a a ^ estimated from n a n_a n a live runs, its false-fold probability at break-even can exceed δ \delta δ . At a = 0.9 a=0.9 a = 0.9 and m − 1 L = δ = 0.05 \frac{m-1}{L}=\delta=0.05 L m − 1 = δ = 0.05 it is 0.34 0.34 0.34 , 0.25 0.25 0.25 and 0.08 0.08 0.08 for n a = 20 n_a=20 n a = 20 , 100 100 100 and 1000 1000 1000 (exact; Proposition 18 ).
Following testing by betting (Shafer, 2021; Waudby-Smith and Ramdas, 2024), with inverse-propensity weights as in B-PAC (Yu et al., 2026b), we bet on the paired utility of each shadow evaluation, with live reasoning on the same instance as control: U t = C t L − C t M + L ( Y t M − Y t L ) U_t=C_t^L-C_t^M+L(Y_t^M-Y_t^L) U t = C t L − C t M + L ( Y t M − Y t L ) , the steps saved plus L L L times the correctness gained, where C t L , C t M C_t^L,C_t^M C t L , C t M are the costs and Y t L , Y t M ∈ { 0 , 1 } Y_t^L,Y_t^M\in\{0,1\} Y t L , Y t M ∈ { 0 , 1 } the verified correctness of the live and macro answers; Z t = U t / B ≥ − 1 Z_t=U_t/B\ge-1 Z t = U t / B ≥ − 1 for a known bound B B B .
Theorem 6 (Betting certificate). Fold when the wealth of predictable bets on the inverse-propensity-weighted Z t Z_t Z t reaches 1 / δ 1/\delta 1/ δ . (i) Validity. A macro that is never more useful than live reasoning is folded with probability at most δ \delta δ , whatever the live accuracy and however live and macro errors are correlated. (ii) Rate. If the unweighted Z t Z_t Z t are i.i.d. with law P Z P_Z P Z and audits have rate p p p , certification takes ( 1 + o ( 1 ) ) ln ( 1 / δ ) / ( p K L inf ( P Z ) ) (1+o(1))\ln(1/\delta)/(p\mathrm{KL}_{\inf}(P_Z)) ( 1 + o ( 1 )) ln ( 1/ δ ) / ( p KL i n f ( P Z )) uses, and no δ \delta δ -safe rule that sees only audited utilities is faster (Kaufmann et al., 2016; Garivier and Kaufmann, 2016). Here K L inf ( P ) : = inf { K L ( P ∥ Q ) : E Q Z ≤ 0 } \mathrm{KL}_{\inf}(P):=\inf\{\mathrm{KL}(P\Vert Q):\mathbb{E}_QZ\le0\} KL i n f ( P ) := inf { KL ( P ∥ Q ) : E Q Z ≤ 0 } over laws Q Q Q on the same bounded range: the divergence from P Z P_Z P Z to the nearest useless macro. When it applies: audits have known probabilities, bounded below, independent of the hidden outcome (exact conditions in Appendix § 13 ).
Under the null, reaching 1 / δ 1/\delta 1/ δ is rare (Ville’s inequality); a useful macro grows log-wealth by K L inf ( P Z ) \mathrm{KL}_{\inf}(P_Z) KL i n f ( P Z ) per audited pair (Honda and Takemura, 2010). For a certificate restarted at each change, Theorem 3 holds with K L inf ( P Z ) \mathrm{KL}_{\inf}(P_Z) KL i n f ( P Z ) for KL and unknown a a a (Corollary 20). Unlike a discordant-pair Table 1 : Restarting at each notice makes certification safe per epoch. Bold: ours. All retire folded macros by LR-CUSUM (Corollary 2). The optimum , an SPRT or grid bet restarted at known change times, attains F π ( Θ ) F_{\pi}(\Theta) F π ( Θ ) (Theorem 3 and Corollary 20); as run is a rule’s own growth rate; measured rates are in § 6 .1
Table 1.
test (Shawn, 2026), it can certify macros less accurate than live but above break-even (Theorem 19 ).
From certificate to deployment. The restart-only certificate (Table 1 ) runs a template’s j j j -th test at level δ j = 6 δ / ( π 2 j 2 ) \delta_j = 6\delta/(\pi^2j^2) δ j = 6 δ / ( π 2 j 2 ) , so that all its tests together spend at most δ \delta δ ; it restarts , at the next level, at each notice that the template’s answers changed, and retires a folded macro by its own LR-CUSUM (Corollary 2). Our recommended deployment (“ours”) also invalidates and re-forms folded macros at each notice, so the LR-CUSUM is the safety net for missed notices. When it applies: both are δ \delta δ -safe per epoch for their own null, paired utility ≤ 0 \le0 ≤ 0 , when notices cover every change of that null, including changes of live reasoning (Proposition 23). So one δ \delta δ bounds false certification , a fold of a candidate whose expected paired utility is ≤ 0 \le0 ≤ 0 at the fold, in every epoch, however many successive candidates and edits; later staleness is left to retirement (§ 3 ).
Experiments
Benchmark. KQA-STREAM is built from the KQA Pro knowledge base (Cao et al., 2022): 300 templates of 2–4 relation hops with 60 instances each (18k LLM-verbalized questions) and three sequences of 24 fact edits (Appendix § 14 ). The live reasoner is a hop-by-hop agent that chooses one relation per LLM call. A macro materializes a verified trace’s relation path as an anchor-to-answer table, reached through one routing call; it goes stale when edits change the facts it cached. A compiled plan stores the path and re-executes it
tbl:2 : Counters serve 7.0–13.5× more stale answers on every model, even when ours gets no edit notice. ∘ ^\circ ∘ Ours with every notice missed, i.e. the counters’ information; with notices it serves none. Unretired: share of stale episodes of Figure 2 (66, 53, 18, 8 and 11) still in service at stream end. Bad folds: per stream (ours: with notices). Bold: ours.
on the current knowledge base. Every LLM call is recorded once per model, with exact selective re-runs after edits, and policies are replayed on 200k-query Zipf streams (s = 1.2 s = 1.2 s = 1.2 ; 10 seeds × \times × 3 edit sequences; 10% random audits), so all policies see identical queries, edits and audit coins. We use five open models: Qwen3-8B and Qwen3-4B (Yang et al., 2025) (thinking disabled), Granite-3.3-8B (IBM Granite Team, 2025), Mistral-7B (Jiang et al., 2023) and OLMo-3-7B (Team OLMo, 2025). Prompts, seeds and scripts are in our code release.
Policies. Fold once folds a verified candidate at formation and never retires it, like a semantic cache. ExpeL- and ACE-style baselines transplant each system’s retention rule onto our macros, one vote per audited outcome. Detector baselines certify with the plug-in SPRT and retire with an LR-CUSUM; the optimistic one folds at formation. The certificates of Table 1 run at δ = 0.05 \delta= 0.05 δ = 0.05 ; a notice is an edit that changes the gold answer of a query routed to the template; a vCache-style cache re-implements Schroeder et al. (2026) (Appendix § 14 .2.4; more variants: Table 5 ). Metrics: stale answers are wrong one-step answers that were right when the macro was formed; a bad fold trusts a candidate below break-even; a stale episode runs from the edit that makes a folded macro stale to its retirement or the stream end; J 20 J_{20} J 20 is LLM calls per query plus 20 m ˉ 20\bar{m} 20 m ˉ times the error rate (m ˉ \bar{m} m ˉ : mean live cost; L = 20 m ˉ L = 20\bar{m} L = 20 m ˉ in Equation (1) ; lower is better). Audits query the knowledge base at no LLM-call cost.
Table 5. Further Qwen3-8B rows for Table 3 (same setting and columns; SpF counts the bad folds of the main text). Loss-tuned: fold and retire thresholds set from a renewal-reward approximation of the loss. Per candidate : a fresh level δ \delta δ for each candidate. The last row drops and re-forms every macro an edit announces, with perfect notices (Appendix § 14 .4.2). Bold: ours.
Counters leave stale memories in service. As Remark 2 predicts, counters serve 7.0–13.5× more stale answers than ours on every model, even with every notice missed (Table 2). To isolate detection, we replay every macro that restart only folds, which only detection retires, under each rule with the same audits: 156 stale episodes (Appendix § 14 .3.2). Counters leave 50% and 47% in service at stream end against 2% for the LR-CUSUM, with restricted mean delays of 4,069 and 3,949 uses against 67 (Figure 2 ); each episode costs counters about 1,350 stale answers, against 38.5. Loss hides this: their J 20 J_{20} J 20 is close to ours because, skipping certification, they answer 28–76% of queries in one step (ours: 20–53%), so benchmarks must count stale answers.
Detection follows the phase diagram. A false retirement (FR) retires a macro still above break-even. Staleness here is nearly total (mean q 1 = 0.75 q_1 = 0.75 q 1 = 0.75 –0.90 0.90 0.90 , q 0 = 0.04 q_0 = 0.04 q 0 = 0.04 –0.24 0.24 0.24 ), and Theorem 1 and Corollary 2 predict three things, all observed. (i) The symmetric rule detects, but slowly: with q 1 > 1 2 q_1 > \frac{1}{2} q 1 > 2 1 its delay is logarithmic, but the LR-CUSUM needs 3.7–6.1× fewer uses at 0.8–5 FR per 10 4 10^4 1 0 4 healthy uses (Figure 6 ). (ii) Per-memory weights beat the best tested global one, as q 0 q_0 q 0 varies: 1.3–5.9× fewer uses (significant on three of five models; Appendix § 14 .§ 14.4.6 ); that best ratio is itself small (below 1:1 on four models; predicted 1 / ρ 1/\rho 1/ ρ : 0.67–2.14; Figure 5 ). (iii) Partial staleness moves the optimum up: on 217 real partially stale episodes (predicted 1 / ρ = 4.8 1/\rho= 4.8 1/ ρ = 4.8 ) the best tested weight is 5–7, and the symmetric rule needs 1.2–1.5× more uses (Appendix § 14 .§ 14.4.5 ). The theory thus ranks the rules on real LLM errors.
Figure 5. Per-memory likelihood ratios beat every tested global counter ratio. Mean uses to detect staleness for a clipped counter that weighs a failure k k k times a success (orange; circle: best tested k k k ) and for the per-memory LR-CUSUM (blue dotted), at the false-retirement rate of the latter (1.9–3.4 per 10 4 10^4 1 0 4 healthy uses). Purple: the weight 1 / ρ 1/\rho 1/ ρ that Corollary 2 predicts from the mean failure rates (q ˉ 0 , q ˉ 1 \bar{q}_0,\bar{q}_1 q ˉ 0 , q ˉ 1 ); dashed: its first-order delay, an optimum -level rate that the measured delays exceed (by 2.3–17× at k = 1 k=1 k = 1 ; see the results below). On four of five models the delay is flat or lowest up to the predicted weight and grows beyond it; the per-memory gain is significant on Qwen3-8B, Qwen3-4B and OLMo-3-7B. 30 streams per model, per-candidate certificate; bands: 95% template bootstrap; naive means, which favour the slower rules (Appendix § 14 .2.1).
Figure 6. Detection frontier on real streams (five models, 30 streams each; SPRT certification): naive mean delay after an edit against false retirements of healthy macros, as frontiers over each rule’s thresholds. The naive mean counts an episode that is still open at the end of the stream with its uses so far, so it is a lower bound; the counters’ censoring-aware delays are 7–8× longer (Table 11 ). Legend: share of each counter’s stale episodes not retired by stream end.
Restarted certificates are safe in every epoch. Scoring answers alone, as the certificate’s paired
test does (Appendix § 14 .4.1), ours makes no false certification (§ 5 ) at δ ≤ 0.1 \delta\leq0.1 δ ≤ 0.1 (0 of 5,779 at-risk epochs at δ = 0.05 \delta= 0.05 δ = 0.05 ) and stays far below δ \delta δ up to 0.5, whether “bad” means null at the fold or below break-even (Figure 3 ); counting routing errors as wrong, 0.26% of at-risk epochs have a bad fold at δ = 0.05 \delta= 0.05 δ = 0.05 (Appendix § 14 .4.2). Restarts remove the 11 bad folds that candidates good at formation carry across edits without them (standard scoring; Appendix § 14 .3.3). Although 16% of template-versions change live reasoning unannounced, none of the 9,835 answer-scored folds (2 of 8,294 under standard scoring) rests on a test spanning such a change (Appendix § 14 .5.1). δ \delta δ controls which memories are trusted; how often a trusted memory errs is set by r ⋆ r^\star r ⋆ (10–11% of one-step answers, mostly from macros above break-even).
Figure 3. False certifications stay far below δ \delta δ . At-risk epochs with a fold that violates (a) the certificate’s own null, the event of bounds, or (b) break-even r ⋆ r^\star r ⋆ ; answers scored alone; five models. Without notices, folds on null evidence stay at zero up to δ = 0.1 \delta= 0.1 δ = 0.1 , and all folds more than 10× below δ \delta δ . Bars: 95% template bootstrap.
Certified contraction pays. On Qwen3-8B, ours raises accuracy from 0.379 (live) to 0.648 with 21% fewer LLM calls, and certified compiled plans to 0.668 (Table 3 ), because a macro executes a verified path that live reasoning re-derives with errors. Uncertified reuse (fold once) serves 1,290 stale answers per 10 4 10^4 1 0 4 queries; certification cuts this 20×, invalidation to zero. Across models ours adds 14–33 points over live reasoning (Table 6 ).
Table 3. Certification removes bad folds and invalidation removes stale answers, with fewer calls than live reasoning (Qwen3-8B, 30 streams of 200k queries). Calls: LLM calls per query. Stale: per 10 4 10^4 1 0 4 queries. Bad: bad folds per stream (–: no macros). J 20 J_{20} J 20 : loss, lower is better (m ˉ = 3.26 \bar{m} = 3.26 m ˉ = 3.26 ). Bold: ours. ⋆Perfect notices; with every notice missed it serves 72 stale answers per 10 4 10^4 1 0 4 queries. Compiled plans (with restarts) gain +2.6 points [1.7, 3.8] over restart-only macros (paired 95% template bootstrap).
Table 6. All five models in the main setting (30 streams of 200k queries each). Stale: stale wrong answers per 10 4 10^{4} 1 0 4 queries. Ours: invalidate on notice + LR-CUSUM, perfect notices (it serves no stale answers). Calls and J 20 J_{20} J 20 of the other groups are for the first variant listed: the restart-only certificate with restarts (restart only), for macros and for compiled plans (compiled plan, Appendix § 14 .4.2). Entries are descriptive means; calls are reconstructed from recorded requests. Bold: ours.
The detector matters exactly where notices fail. With perfect notices ours serves no stale answers and matches restart only in accuracy (+0.24 points [−0.24, +0.81], pooled). With 80%, 50% or no edits announced, invalidation alone serves 125, 325 and 810 stale answers per 10 4 10^4 1 0 4 queries, ours 13, 28 and 66 (Appendix § 14 .4.2), 9–12× fewer: invalidation needs the detector wherever notices can missed.
Natural edits: safety holds, and mild staleness shows its price. On a 1992–2016 timeline of Wikidata temporal qualifiers (four models), where changes are small and partial (median 3.3% of a template’s answers per year), ours keeps bad-fold epochs below δ \delta δ at every level, the LR-CUSUM detects in 1.1–1.6× fewer uses than the best tested fixed weight, and counters leave 84% of the same stale memories in service against 37% (Appendices § 14 .4.4 and § 14 .5.3). The price of safety (Section 4) shows: counters make 149–207 bad folds per stream against 0.1 and serve 3× more stale answers than restart only, yet are 3.5 points more accurate because folding pays when staleness is mild; for the same reason invalidation costs ours 1.9 points against restart only.
On code, counters serve 35–73× more stale answers. On 521 EvalPlus tasks (Liu et al., 2023) (five models), live reasoning writes, tests and re-pairs a program; a memory is a verified program rerun on its task’s later queries; cost counts steps, an execution being one. Memories go stale under announced requirement revisions and unannounced Python API changes, which also change live reasoning and so exercise the safety net. Ratios are per query, against our certificate given the counters’ information (per candidate, no notices), on all five models (38–86× in LLM-call accounting). Here most stale memories never failed before (q 0 = 0 q_0 = 0 q 0 = 0 , so ρ → 0 \rho\to0 ρ → 0 ), and the per-memory LR-CUSUM leaves them folded for 10× fewer uses than the best fixed weight at matched false retirements (7.6–11.4× per model, weights up to 5000:1; Appendix § 14 .§ 6 ). Ours folds a below-break-even candidate in 12 of 946,678 epochs under test (counters: 4.8–5.4%) and gains 8.7 accuracy points [7.1, 10.5] over live reasoning, with lower J 20 J_{20} J 20 in both units: it uses 23% fewer steps, while its shadow tests add 17% LLM calls. Zero-utility ties (84–86% of audited pairs in LLM-call accounting) make audits nearly uninformative and halve one-step coverage (0.61 → 0.32), as Theorem 6 (ii) predicts: ties shrink K L inf \mathrm{KL}_{\inf} KL i n f and slow certification.
Related work and what is new
Detection. A mismatched CUSUM with positive drift, our first regime and (3) , has the known delay ln A / ( θ 0 μ 1 ) \ln A/(\theta_0\mu_1) ln A / ( θ 0 μ 1 ) ((Molloy and Ford, 2017; Cooper and Meyn, 2024)). We add the zero- and negative-drift regimes, including the finite power law A θ 1 / θ 0 A^{\theta_1/\theta_0} A θ 1 / θ 0 where Wu and Yang (2016, Thm. 2) state an infinite delay (counterexample: Appendix A), read deployed counters’ implied alternative and set learning rates by it. Limit. Ours extends crawler freshness ((Azar et al., 2018)), where one refresh restores a page, to items whose trust needs ln ( 1 / δ ) \ln(1/\delta) ln ( 1/ δ ) /KL audited uses; the Zipf law is an occupancy sum ((Karlin, 1967)) at the load Θ \Theta Θ . Certificate. With standard betting, inverse-propensity weights and anytime validity, B-PAC ((Yu et al., 2026b)) certifies one global routing threshold; new is a per-template lifecycle that certifies, and restarts. Concurrent work extends reasoning contraction to self-modification ((Zhou et al., 2026a)) and shared multi-agent memory ((Zhou et al., 2026b)). More: Appendix § 16 .
Conclusion
Reusing a reasoning memory safely is a sequential test, and vote counters (ExpeL, ACE) are change detectors tuned to the wrong change. Three rules follow. (1) Weigh a memory’s failures by its own likelihood ratio: at failure rate 0.05 → 0.25 a failure weighs about 7 successes, not 1. (2) Certify utility against live reasoning; the load Θ \Theta Θ prices skipped reasoning in the worst case. (3) Restart at every notice (0 false certifications in 5,779 at-risk epochs at δ = 0.05 \delta= 0.05 δ = 0.05 , answers scored alone) and, for substantial edits, invalidate too, with the detector as safety net (9–12× fewer stale answers when notices are missed). Memory benchmarks should edit facts and count stale answers.
Limitations
Scope. Our results concern memories whose answers an exact verifier checks, such as knowledge-base execution or unit tests. The evidence comes from three domains and five open models of up to 8B parameters: multi-hop reasoning over a knowledge graph with controlled fact edits, a natural timeline of Wikidata temporal qualifiers (four models; Appendix § 14 .4.4), and EvalPlus code tasks, whose memories go stale under requirement revisions and re-enacted Python API changes (Appendix § 14 .§ 6 ). Each instance–version is decoded once; seed variance is measured on a subset (Appendix § 14 .4.3). The theorems assume that each audit reveals one verified outcome whose law is set by the memory’s current reliability, and that facts change at random times; Appendices A to § 13 state the exact conditions and Appendix § 14 the replay setting. Per-epoch safety needs change notices that cover every change of the certificate’s paired-utility null, including changes of live reasoning; our notices cover answer changes (Appendix § 14 .5.1). Some change information is necessary on every template whose epochs contain an audit with probability above δ / r 0 \delta/r_0 δ / r 0 (Proposition 24 ); without an edit log, restarts triggered by the memory’s own detector keep every decision that rests on post-change evidence safe (Proposition 25 ).
Future work. Five directions extend this scope. (i) A formation-aware limit: on real streams, coverage also depends on how often the live agent produces a verified trace from which a candidate can form, and a limit that models formation would predict real-system coverage. (ii) Noisy and LLM-judge verifiers, which would bring text memories into reach; the certification load already prices noise through the observed channel, and a certificate built for noisy paired labels is the next step (Appendix § 14 .2.3). (iii) Longer and denser natural edit histories, such as full knowledge-base revision logs, where change notices arrive with their own delays and errors, and real library drift on benchmarks with version-specific APIs, where staleness reaches more programs than re-enacted deprecations do. (iv) Larger models. (v) Open problems in the theory: a square-root law for adaptive audit budgets, a joint detection–certification limit that prices stale answers, the exact optimal certifier for one template, near-optimal retirement for an unknown post-change rate by parallel or GLR rules, and the agreement-aware version of the limit.
Ethical considerations
This work analyzes when stored reasoning may be trusted, and its main practical implication is safety-positive: it bounds how often a memory-augmented reasoner serves stale or spurious shortcuts, and it shows that common counter rules may never retire a stale memory. The datasets we use (KQA Pro, CC BY-SA 4.0; MuSiQue, CC BY 4.0; Wikidata, CC0; EvalPlus, Apache-2.0, with MBPP, CC BY 4.0, and HumanEval, MIT) are public and contain no personal data beyond public facts about notable entities; our synthetic knowledge-base edits, natural-edit timeline and code requirement revisions are released as edit logs for research (under CC BY-SA 4.0 where derived from KQA Pro; our code is MIT-licensed). All questions and tasks are in English or Python. All models are open-weight and were run locally without paid APIs. AI assistants were used to draft proofs, code and text and to run experiments, and independent AI referee agents checked them; the authors take responsibility for all content. The guarantees hold only under the stated assumptions, and deploying certified memory in high-stakes settings still requires a verifier whose errors are understood.
Proofs
Setting. Outcomes Y 1 , Y 2 , … Y_1,Y_2,\ldots Y 1 , Y 2 , … are independent, with law P 0 P_0 P 0 before an unknown change time t c t_c t c and P 1 P_1 P 1 from t c t_c t c on. A score rule uses a bounded score X = f ( Y ) X=f(Y) X = f ( Y ) with x ˉ = ess sup X \bar{x}=\operatorname{ess\,sup}X x ˉ = ess sup X and b ˉ = ess sup ( − X ) \bar{b}=\operatorname{ess\,sup}(-X) b ˉ = ess sup ( − X ) , and runs S 0 = 0 S_0=0 S 0 = 0 , S n = max { 0 , S n − 1 + X n } S_n=\max\{0,S_{n-1}+X_n\} S n = max { 0 , S n − 1 + X n } , τ h = inf { n : S n ≥ h } \tau_h=\inf\{n:S_n\ge h\} τ h = inf { n : S n ≥ h } . We assume μ 0 : = E 0 X < 0 < P 0 ( X > 0 ) \mu_0:=\mathbb{E}_0X<0<P_0(X>0) μ 0 := E 0 X < 0 < P 0 ( X > 0 ) . The ARL is A ( h ) = E ∞ τ h A(h)=\mathbb{E}_\infty\tau_h A ( h ) = E ∞ τ h . Lorden’s worst-case delay D ˉ ( h ) = sup t c ess sup E t c [ ( τ h − t c + 1 ) + ∣ Y < t c ] \bar{D}(h)=\sup_{t_c}\operatorname{ess\,sup}\mathbb{E}_{t_c}[(\tau_h-t_c+1)^+\mid Y_{<t_c}] D ˉ ( h ) = sup t c ess sup E t c [( τ h − t c + 1 ) + ∣ Y < t c ] equals the zero-start delay D ( h ) = E 1 τ h D(h)=\mathbb{E}_1\tau_h D ( h ) = E 1 τ h . The reason is that s ↦ S n ( s ) s\mapsto S_n(s) s ↦ S n ( s ) is monotone, so the worst pre-change state is S = 0 S=0 S = 0 . We write W n = ∑ k ≤ n X k W_n=\sum_{k\le n}X_k W n = ∑ k ≤ n X k , φ j ( θ ) = ln E j e θ X \varphi_j(\theta)=\ln\mathbb{E}_je^{\theta X} φ j ( θ ) = ln E j e θ X , and θ j > 0 \theta_j>0 θ j > 0 for the positive root of φ j \varphi_j φ j .
Hebbian rules and the exact level. Start from c 0 = 1 c_0=1 c 0 = 1 , update c ← clip [ 0 , 1 ] ( c + η + 1 { Y = 1 } − η − 1 { Y = 0 } ) c\leftarrow\operatorname{clip}_{[0,1]}(c+\eta_+\mathbf{1}\{Y=1\}-\eta_-\mathbf{1}\{Y=0\}) c ← clip [ 0 , 1 ] ( c + η + 1 { Y = 1 } − η − 1 { Y = 0 }) , and retire at c < τ c<\tau c < τ . With S = ( 1 − c ) / η − S=(1-c)/\eta_- S = ( 1 − c ) / η − and ρ = η + / η − \rho=\eta_+/\eta_- ρ = η + / η − , the upper clip is the reflection at 0. The lower clip can bind only on a step that retires under both descriptions. So the rule is (2) with score + 1 +1 + 1 on failure, − ρ -\rho − ρ on success, and retirement at S > ( 1 − τ ) / η − S>(1-\tau)/\eta_- S > ( 1 − τ ) / η − . For η + = η − = η \eta_+=\eta_-=\eta η + = η − = η (ρ = 1 \rho=1 ρ = 1 ), S S S is integer and the retirement time is τ H \tau_H τ H with H = ⌈ ( 1 − τ ) / η ⌉ + 1 H=\lceil(1-\tau)/\eta\rceil+1 H = ⌈( 1 − τ ) / η ⌉ + 1 . A first-passage recursion (t 0 = 1 / q t_0=1/q t 0 = 1/ q , t k = 1 / q + λ t k − 1 t_k=1/q+\lambda t_{k-1} t k = 1/ q + λ t k − 1 , λ = ( 1 − q ) / q \lambda=(1-q)/q λ = ( 1 − q ) / q ) gives the exact run length
E q τ H = 1 q ( λ − 1 ) [ λ ( λ H − 1 ) λ − 1 − H ] \mathbb{E}_q\tau_H=\frac{1}{q(\lambda-1)}\left[\frac{\lambda(\lambda^H-1)}{\lambda-1}-H\right] E q τ H = q ( λ − 1 ) 1 [ λ − 1 λ ( λ H − 1 ) − H ]
for q ≠ 1 2 q \ne\frac{1}{2} q = 2 1 , and E 1 / 2 τ H = H ( H + 1 ) \mathbb{E}_{1/2}\tau_H = H(H+1) E 1/2 τ H = H ( H + 1 ) . This agrees with an exact Markov-chain solve to 10 − 46 10^{-46} 1 0 − 46 relative error. Floating-point implementations of “c < τ c < \tau c < τ ” can retire one failure early (e.g. η = 0.05 \eta= 0.05 η = 0.05 , τ = 0.9 \tau= 0.9 τ = 0.9 ), so we recommend an integer counter.
Proof of Remark 1. By convexity, φ 0 \varphi_0 φ 0 has a unique positive root θ 0 \theta_0 θ 0 and φ 0 ′ ( θ 0 ) > 0 \varphi_0'(\theta_0)>0 φ 0 ′ ( θ 0 ) > 0 . Then P ~ 0 ( d y ) = e θ 0 f ( y ) P 0 ( d y ) \widetilde{P}_0(dy)=e^{\theta_0 f(y)}P_0(dy) P 0 ( d y ) = e θ 0 f ( y ) P 0 ( d y ) is a probability measure with ln ( d P ~ 0 / d P 0 ) = θ 0 f \ln(d\widetilde{P}_0/dP_0)=\theta_0f ln ( d P 0 / d P 0 ) = θ 0 f . Multiplying by θ 0 > 0 \theta_0>0 θ 0 > 0 commutes with max { 0 , ⋅ } \max\{0,\cdot\} max { 0 , ⋅ } , so θ 0 S n \theta_0S_n θ 0 S n is Page’s log-likelihood CUSUM for P 0 → P ~ 0 P_0\to\widetilde{P}_0 P 0 → P 0 with threshold θ 0 h \theta_0h θ 0 h . Its Lorden optimality for that change is due to Moustakides (1986). It is the likelihood-ratio CUSUM of no other alternative because ln ( d Q / d P 0 ) = κ f \ln(dQ/dP_0)=\kappa f ln ( d Q / d P 0 ) = κ f with E 0 e κ f = 1 \mathbb{E}_0e^{\kappa f}=1 E 0 e κ f = 1 forces κ = θ 0 \kappa=\theta_0 κ = θ 0 . For the ± 1 \pm1 ± 1 rule e θ 0 = ( 1 − q 0 ) / q 0 e^{\theta_0}=(1-q_0)/q_0 e θ 0 = ( 1 − q 0 ) / q 0 , so q ~ = q 0 e θ 0 = 1 − q 0 \widetilde{q}=q_0e^{\theta_0}=1-q_0 q = q 0 e θ 0 = 1 − q 0 . More generally, the rule “+ a +a + a on failure, − b -b − b on success” is the exact CUSUM along the curve { ( q 0 , q 1 ) : ρ ( q 0 , q 1 ) = b / a } \{(q_0,q_1):\rho(q_0,q_1)=b/a\} {( q 0 , q 1 ) : ρ ( q 0 , q 1 ) = b / a } .
Lemma 7 (Page cycles and Lundberg bounds). Let N h = inf { n ≥ 1 : W n ≤ 0 or W n ≥ h } N_h=\inf\{n\ge1:W_n\le0\text{ or }W_n\ge h\} N h = inf { n ≥ 1 : W n ≤ 0 or W n ≥ h } , p h = P ( W N h ≥ h ) p_h=\mathbb{P}(W_{N_h}\ge h) p h = P ( W N h ≥ h ) and N − = inf { n ≥ 1 : W n ≤ 0 } N_-=\inf\{n\ge1:W_n\le0\} N − = inf { n ≥ 1 : W n ≤ 0 } .
(a) If E N h < ∞ \mathbb{E}N_h<\infty E N h < ∞ and p h > 0 p_h>0 p h > 0 , then E τ h = E N h / p h \mathbb{E}\tau_h=\mathbb{E}N_h/p_h E τ h = E N h / p h .
(b) If E X < 0 \mathbb{E}X<0 E X < 0 with adjustment coefficient θ \theta θ , and c θ = E [ 1 − e θ X ; X < 0 ] c_\theta=\mathbb{E}[1-e^{\theta X};X<0] c θ = E [ 1 − e θ X ; X < 0 ] , then c θ e − θ ( h + x ˉ ) ≤ p h ≤ e − θ h c_\theta e^{-\theta(h+\bar{x})}\le p_h\le e^{-\theta h} c θ e − θ ( h + x ˉ ) ≤ p h ≤ e − θ h and P ( sup n W n ≥ x ) ≤ e − θ x \mathbb{P}(\sup_nW_n\ge x)\le e^{-\theta x} P ( sup n W n ≥ x ) ≤ e − θ x .
(c) If E X < 0 \mathbb{E}X<0 E X < 0 , then E N − = 1 / P ( sup n W n = 0 ) < ∞ \mathbb{E}N_-=1/\mathbb{P}(\sup_nW_n=0)<\infty E N − = 1/ P ( sup n W n = 0 ) < ∞ .
Proof. (a) Until N h N_h N h the walk and S S S coincide. On a downward exit S S S restarts at 0 0 0 , so τ h \tau_h τ h is a geometric(p h p_h p h ) sum of i.i.d. cycle lengths, and Wald’s identity applies (Page, 1954; Siegmund, 1985). (b) e θ W n e^{\theta W_n} e θ W n is a martingale bounded up to N h N_h N h , so 1 = E e θ W N h 1=\mathbb{E}e^{\theta W_{N_h}} 1 = E e θ W N h . Split into upward exits (value in [ e θ h , e θ ( h + x ˉ ) ) [e^{\theta h},e^{\theta(h+\bar{x})}) [ e θ h , e θ ( h + x ˉ ) ) ) and downward exits (value ≤ 1 \le1 ≤ 1 , and = e θ X 1 =e^{\theta X_1} = e θ X 1 on { X 1 < 0 } \{X_1<0\} { X 1 < 0 } ). The maximal inequality follows from optional stopping at the first passage above x x x . (c) Duality: { W 1 > 0 , … , W n > 0 } \{W_1>0,\ldots,W_n>0\} { W 1 > 0 , … , W n > 0 } is the event that n n n is a strict ascending ladder epoch of the reversed walk. The number of such epochs is geometric with mean 1 / P ( sup W = 0 ) 1/\mathbb{P}(\sup W=0) 1/ P ( sup W = 0 ) .
Proof of Theorem 1. ARL. By Lemma 7(a)–(c) under P 0 P_0 P 0 , e θ 0 h ≤ A ( h ) ≤ ( E 0 N − / c 0 ) e θ 0 ( h + x ˉ ) e^{\theta_0h}\le A(h)\le(\mathbb{E}_0N_-/c_0)e^{\theta_0(h+\bar{x})} e θ 0 h ≤ A ( h ) ≤ ( E 0 N − / c 0 ) e θ 0 ( h + x ˉ ) , so θ 0 h ≤ ln A ≤ θ 0 h + Δ 0 \theta_0h\le\ln A\le\theta_0h+\Delta_0 θ 0 h ≤ ln A ≤ θ 0 h + Δ 0 with an explicit constant Δ 0 \Delta_0 Δ 0 . (i) μ 1 > 0 \mu_1>0 μ 1 > 0 . Since S n ≥ W n S_n\ge W_n S n ≥ W n , τ h \tau_h τ h is at most the first passage of W W W above h h h , and Wald gives D ≤ ( h + x ˉ ) / μ 1 D\le(h+\bar{x})/\mu_1 D ≤ ( h + x ˉ ) / μ 1 . Conversely μ 1 D = E 1 W τ h ≥ h − E 1 ∣ inf n W n ∣ ≥ h − 1 / β 1 \mu_1D=\mathbb{E}_1W_{\tau_h}\ge h-\mathbb{E}_1|\inf_nW_n|\ge h-1/\beta_1 μ 1 D = E 1 W τ h ≥ h − E 1 ∣ inf n W n ∣ ≥ h − 1/ β 1 , where β 1 > 0 \beta_1>0 β 1 > 0 solves E 1 e − β 1 X = 1 \mathbb{E}_1e^{-\beta_1X}=1 E 1 e − β 1 X = 1 (maximal inequality for − W -W − W ). Substituting h = ( ln A + O ( 1 ) ) / θ 0 h=(\ln A+O(1))/\theta_0 h = ( ln A + O ( 1 )) / θ 0 gives D = ln A / ( θ 0 μ 1 ) + O ( 1 ) D=\ln A/(\theta_0\mu_1)+O(1) D = ln A / ( θ 0 μ 1 ) + O ( 1 ) . (ii) μ 1 = 0 \mu_1=0 μ 1 = 0 . S n 2 − n σ 1 2 S_n^2-n\sigma_1^2 S n 2 − n σ 1 2 is a supermartingale, because E [ max ( 0 , s + X ) 2 ] ≤ s 2 + σ 1 2 \mathbb{E}[\max(0,s+X)^2]\le s^2+\sigma_1^2 E [ max ( 0 , s + X ) 2 ] ≤ s 2 + σ 1 2 . Hence D ≥ h 2 / σ 1 2 D\ge h^2/\sigma_1^2 D ≥ h 2 / σ 1 2 . Wald’s second identity on a Page cycle, together with p h ≥ E 1 X − / ( h + x ˉ ) p_h\ge\mathbb{E}_1X^-/ (h+\bar{x}) p h ≥ E 1 X − / ( h + x ˉ ) , gives D ≤ [ ( h + x ˉ ) 2 + b ˉ 2 ( h + x ˉ ) / E 1 X − ] / σ 1 2 D\le[(h+\bar{x})^2+\bar{b}^2(h+\bar{x})/\mathbb{E}_1X^-]/\sigma_1^2 D ≤ [( h + x ˉ ) 2 + b ˉ 2 ( h + x ˉ ) / E 1 X − ] / σ 1 2 . (iii) μ 1 < 0 \mu_1<0 μ 1 < 0 . Apply the ARL argument under P 1 P_1 P 1 with θ 1 \theta_1 θ 1 : e θ 1 h ≤ D ≤ ( E 1 N − / c 1 ) e θ 1 ( h + x ˉ ) e^{\theta_1h}\le D\le(\mathbb{E}_1N_-/c_1)e^{\theta_1(h+\bar{x})} e θ 1 h ≤ D ≤ ( E 1 N − / c 1 ) e θ 1 ( h + x ˉ ) . Since e θ 1 h = ( e θ 0 h ) γ e^{\theta_1h}=(e^{\theta_0h})^\gamma e θ 1 h = ( e θ 0 h ) γ , this gives D ≳ A γ D\gtrsim A^\gamma D ≳ A γ . Moreover γ < 1 \gamma<1 γ < 1 iff φ 1 ( θ 0 ) > 0 \varphi_1(\theta_0)>0 φ 1 ( θ 0 ) > 0 , which holds when the score law under P 1 P_1 P 1 stochastically dominates that under P 0 P_0 P 0 . For Bernoulli rules this is equivalent to q 1 > q 0 q_1>q_0 q 1 > q 0 . If P 1 ( X > 0 ) = 0 P_1(X>0)=0 P 1 ( X > 0 ) = 0 the rule never alarms after the change. Efficiency. Because ln ( d P ~ 0 / d P 0 ) = θ 0 f \ln(d\widetilde{P}_0/dP_0)=\theta_0f ln ( d P 0 / d P 0 ) = θ 0 f ,
θ 0 μ 1 = E 1 ln d P ~ 0 d P 0 = E 1 ln d P 1 d P 0 − E 1 ln d P 1 d P ~ 0 = KL ( P 1 ∥ P 0 ) − KL ( P 1 ∥ P ~ 0 ) . \theta_0\mu_1=\mathbb{E}_1\ln\frac{d\widetilde{P}_0}{dP_0}
=\mathbb{E}_1\ln\frac{dP_1}{dP_0}-\mathbb{E}_1\ln\frac{dP_1}{d\widetilde{P}_0}
=\operatorname{KL}(P_1\Vert P_0)-\operatorname{KL}(P_1\Vert\widetilde{P}_0). θ 0 μ 1 = E 1 ln d P 0 d P 0 = E 1 ln d P 0 d P 1 − E 1 ln d P 0 d P 1 = KL ( P 1 ∥ P 0 ) − KL ( P 1 ∥ P 0 ) .
Dividing the optimal delay ln A / KL ( P 1 ∥ P 0 ) \ln A/\operatorname{KL}(P_1\Vert P_0) ln A / KL ( P 1 ∥ P 0 ) (Lorden, 1971) by ln A / ( θ 0 μ 1 ) \ln A/(\theta_0\mu_1) ln A / ( θ 0 μ 1 ) gives (3) . Equality holds iff P ~ 0 = P 1 \widetilde{P}_0=P_1 P 0 = P 1 , i.e. θ 0 f = ln d P 1 / d P 0 \theta_0f=\ln dP_1/dP_0 θ 0 f = ln d P 1 / d P 0 . □
Proof of Corollary 2. The Bernoulli log-likelihood ratio is ln ( q 1 / q 0 ) > 0 \ln(q_1/q_0)>0 ln ( q 1 / q 0 ) > 0 on a failure and ln ( ( 1 − q 1 ) / ( 1 − q 0 ) ) < 0 \ln((1-q_1)/(1-q_0))<0 ln (( 1 − q 1 ) / ( 1 − q 0 )) < 0 on a success. A rule with scores ( + 1 , − ρ ) (+1,-\rho) ( + 1 , − ρ ) is proportional to it iff ρ = ρ ( q 0 , q 1 ) \rho=\rho(q_0,q_1) ρ = ρ ( q 0 , q 1 ) , and the retirement threshold in log-likelihood units is ln ( q 1 / q 0 ) ( 1 − τ ) / η − \ln(q_1/q_0)(1-\tau)/\eta_- ln ( q 1 / q 0 ) ( 1 − τ ) / η − . The symmetric rule is optimal iff q 1 = 1 − q 0 q_1=1-q_0 q 1 = 1 − q 0 .
Unknown degradation.
Proposition 8 (First-order minimax tuning). Let q 1 ∈ [ q − , q + ] q_1\in[q_-,q_+] q 1 ∈ [ q − , q + ] with q 0 < q − q_0<q_- q 0 < q − . For every detector with ARL ≥ A \operatorname{ARL}\ge A ARL ≥ A , the worst-case delay over this interval is at least ( 1 + o ( 1 ) ) ln A / KL ( q − ∥ q 0 ) (1+o(1))\ln A/\operatorname{KL}(q_-\Vert q_0) ( 1 + o ( 1 )) ln A / KL ( q − ∥ q 0 ) , and the likelihood-ratio rule tuned at q − q_- q − attains it.
Proof. The lower bound is Lorden’s bound at q 1 = q − q_1=q_- q 1 = q − (Lorden, 1971). The rule tuned at q − q_- q − has scores equal to the log-likelihood ratio of q − q_- q − against q 0 q_0 q 0 , so θ 0 = 1 \theta_0=1 θ 0 = 1 , and its post-change drift μ 1 ( q 1 ) \mu_1(q_1) μ 1 ( q 1 ) increases in q 1 q_1 q 1 because the failure score is positive and the success score negative. By Theorem 1(i) its delay is ln A / μ 1 ( q 1 ) + O ( 1 ) ≤ ln A / μ 1 ( q − ) + O ( 1 ) \ln A/\mu_1(q_1)+O(1)\le\ln A/\mu_1(q_-)+O(1) ln A / μ 1 ( q 1 ) + O ( 1 ) ≤ ln A / μ 1 ( q − ) + O ( 1 ) , and μ 1 ( q − ) = KL ( q − ∥ q 0 ) \mu_1(q_-)=\operatorname{KL}(q_-\Vert q_0) μ 1 ( q − ) = KL ( q − ∥ q 0 ) . □
Proposition 9 (Unclipped counters; restates Remark 2). Consider an unclipped counter C n = C n − 1 + 1 { Y n = 1 } − 1 { Y n = 0 } C_n=C_{n-1}+1\{Y_n=1\}-1\{Y_n=0\} C n = C n − 1 + 1 { Y n = 1 } − 1 { Y n = 0 } started at c 0 c_0 c 0 and deleted at C ≤ 0 ( E x p e L : C\le0 (ExpeL: C ≤ 0 ( E x p e L : c_0=2$), or the majority rule “flag when harmful ≥ \ge ≥ helpful” (ACE’s released code). (a) A = ∞ A=\infty A = ∞ , since false deletion has probability ( q 0 / ( 1 − q 0 ) ) c 0 < 1 (q_0/(1-q_0))^{c_0}<1 ( q 0 / ( 1 − q 0 ) ) c 0 < 1 , but no worst-case delay is finite: for q 1 > 1 2 q_1>\frac{1}{2} q 1 > 2 1 the delay after a change equals the credit banked before it divided by 2 q 1 − 1 2q_1-1 2 q 1 − 1 . (b) Under partial staleness (q 1 < 1 2 q_1<\frac{1}{2} q 1 < 2 1 ) the stale macro is never flagged (ACE) or deleted (ExpeL) with probability at least 1 − 2 q 1 1-2q_1 1 − 2 q 1 (majority rule) or 1 − ( q 1 / ( 1 − q 1 ) ) c 0 1-(q_1/(1-q_1))^{c_0} 1 − ( q 1 / ( 1 − q 1 ) ) c 0 , for every change time (averaged over the pre-change history).
Proof of Proposition 9. (a) Without a cap, a ± 1 \pm1 ± 1 walk with up-probability 1 − q 0 > 1 2 1-q_0>\frac{1}{2} 1 − q 0 > 2 1 started at c 0 ≥ 1 c_0\ge1 c 0 ≥ 1 hits 0 0 0 with probability λ 0 c 0 < 1 \lambda_0^{c_0}<1 λ 0 c 0 < 1 , so A = ∞ A=\infty A = ∞ . Given the pre-change history on { τ ≥ t c } \{\tau\ge t_c\} { τ ≥ t c } , the post-change walk starts at C t c − 1 C_{t_c-1} C t c − 1 with drift − ( 2 q 1 − 1 ) -(2q_1-1) − ( 2 q 1 − 1 ) . Wald’s identity gives the conditional delay C t c − 1 / ( 2 q 1 − 1 ) C_{t_c-1}/(2q_1-1) C t c − 1 / ( 2 q 1 − 1 ) , and the all-success history makes C t c − 1 = c 0 + t c − 1 C_{t_c-1}=c_0+t_c-1 C t c − 1 = c 0 + t c − 1 arbitrarily large, so D ˉ = ∞ \bar{D}=\infty D ˉ = ∞ . (b) For q 1 < 1 2 q_1<\frac{1}{2} q 1 < 2 1 , the probability that a walk from c c c never hits 0 0 0 is h 1 ( c ) = 1 − λ 1 c h_1(c)=1-\lambda_1^c h 1 ( c ) = 1 − λ 1 c . The process h 1 ( C n ) 1 { τ > n } h_1(C_n)1\{\tau>n\} h 1 ( C n ) 1 { τ > n } is a P ∞ P_\infty P ∞ -submartingale, so P t c ( τ = ∞ ) P_{t_c}(\tau=\infty) P t c ( τ = ∞ ) is nondecreasing in t c t_c t c . Its value at t c = 1 t_c=1 t c = 1 is 1 − λ 1 c 0 1-\lambda_1^{c_0} 1 − λ 1 c 0 , and for the majority rule it is ( 1 − q 1 ) h 1 ( 1 ) = 1 − 2 q 1 (1-q_1)h_1(1)=1-2q_1 ( 1 − q 1 ) h 1 ( 1 ) = 1 − 2 q 1 . Exact dynamic programming reproduces these values to 8 digits.
Time decay is a time-to-live. Suppose confidence also decays as c ← ( 1 − λ ) c c\leftarrow(1-\lambda)c c ← ( 1 − λ ) c at every query, and the template is used with probability ϕ \phi ϕ per query. Then any run of k ⋆ = ⌊ ln τ / ln ( 1 − λ ) ⌋ + 1 k^\star=\lfloor\ln\tau/\ln(1-\lambda)\rfloor+1 k ⋆ = ⌊ ln τ / ln ( 1 − λ )⌋ + 1 consecutive queries that do not use the template retires the macro, whatever its reliability. The expected waiting time for such a run is ( ( 1 − ϕ ) − k ⋆ − 1 ) / ϕ ((1-\phi)^{-k^\star}-1)/\phi (( 1 − ϕ ) − k ⋆ − 1 ) / ϕ queries, i.e. ( 1 − ϕ ) − k ⋆ − 1 (1-\phi)^{-k^\star}-1 ( 1 − ϕ ) − k ⋆ − 1 uses. For λ = 10 − 3 \lambda=10^{-3} λ = 1 0 − 3 and τ = 0.85 \tau=0.85 τ = 0.85 we get k ⋆ = 163 k^\star=163 k ⋆ = 163 , so a perfectly reliable macro used by 1% of queries is retired after at most 4.15 uses on average.
The negative-drift regime in prior work: a correction. Wu and Yang (2016) study Page’s CUSUM run with a mismatched post-change density g g g . Their eq. (26) defines it by the restarted recursion C ~ n + 1 = max ( 1 , C ~ n ) Λ ~ n + 1 \widetilde{C}_{n+1}=\max(1,\widetilde{C}_n)\widetilde{\Lambda}_{n+1} C n + 1 = max ( 1 , C n ) Λ n + 1 , i.e. (2) with f = ln ( g / f 0 ) f=\ln(g/f_0) f = ln ( g / f 0 ) , for which θ 0 = 1 \theta_0=1 θ 0 = 1 and P ~ 0 = g \widetilde{P}_0=g P 0 = g . Their Thm. 2 states that if KL ( P 1 ∥ P 0 ) < KL ( P 1 ∥ g ) \operatorname{KL}(P_1\Vert P_0)<\operatorname{KL}(P_1\Vert g) KL ( P 1 ∥ P 0 ) < KL ( P 1 ∥ g ) (their D 10 < D ~ 11 D_{10}<\widetilde{D}_{11} D 10 < D 11 ), the average detection delay is infinite for every false-alarm level below one, and they stress that the statement is not asymptotic. This is our regime (iii), and there the delay is finite whenever P 1 ( f > 0 ) > 0 P_1(f>0)>0 P 1 ( f > 0 ) > 0 : D ( h ) ≤ ( E 1 N − / c 1 ) e θ 1 ( h + x ˉ ) D(h)\leq(\mathbb{E}_1N_-/c_1)e^{\theta_1(h+\bar{x})} D ( h ) ≤ ( E 1 N − / c 1 ) e θ 1 ( h + x ˉ ) (proof of Theorem 1). The proof of their Thm. 2 writes the CUSUM stopping time as a minimum over restart times, τ ~ c = min v τ v ( A ) \widetilde{\tau}_c=\min_v\tau_v(A) τ c = min v τ v ( A ) (their eq. (77)), where τ v ( A ) \tau_v(A) τ v ( A ) is the one-sided test started at v v v and never restarted, and their eq. (78) then equates E k ( min v τ v ( A ) − k ) + \mathbb{E}_k(\min_v\tau_v(A)-k)^+ E k ( min v τ v ( A ) − k ) + with min v E k ( τ v ( A ) − k ) + \min_v\mathbb{E}_k(\tau_v(A)-k)^+ min v E k ( τ v ( A ) − k ) + . Their Lemma 6 is correct: each τ v ( A ) \tau_v(A) τ v ( A ) never stops with positive probability, so its mean delay is infinite. But in general only E min ≤ min E \mathbb{E}\min\leq\min\mathbb{E} E min ≤ min E holds, and here the inequality is strict: the CUSUM alarms at the first success of a geometric number of Page cycles (Lemma 7(a)), each of finite mean length. Counterexample. The symmetric rule with q 0 = 0.05 q_0=0.05 q 0 = 0.05 is the CUSUM with g g g the failure rate 0.95. At q 1 = 0.25 q_1=0.25 q 1 = 0.25 , KL ( P 1 ∥ P 0 ) = 0.225 < KL ( P 1 ∥ g ) = 1.697 \operatorname{KL}(P_1\Vert P_0)=0.225<\operatorname{KL}(P_1\Vert g)=1.697 KL ( P 1 ∥ P 0 ) = 0.225 < KL ( P 1 ∥ g ) = 1.697 , so their condition holds; their regularity conditions (their (5) and (47)) hold for i.i.d. data by the strong law. A single test τ v ( A ) \tau_v(A) τ v ( A ) with threshold h = 4 h=4 h = 4 never stops with probability 1 − 3 − 4 = 0.988 1-3^{-4}=0.988 1 − 3 − 4 = 0.988 , yet the CUSUM’s exact Lorden delays are D ( 4 ) = 232 D(4)=232 D ( 4 ) = 232 and D ( 6 ) = 2172 D(6)=2172 D ( 6 ) = 2172 (zero start is the worst case), and Monte Carlo gives 231.9 and 2160 (2 × 10 5 2\times10^5 2 × 1 0 5 and 4 × 10 4 4\times10^4 4 × 1 0 4 runs). Under their own Bayesian criterion, with the change at a geometric(0.1) time, E [ τ ~ c − ν ∣ τ ~ c ≥ ν ] = 230.8 \mathbb{E}[\widetilde{\tau}_c-\nu\mid\widetilde{\tau}_c\geq\nu]=230.8 E [ τ c − ν ∣ τ c ≥ ν ] = 230.8 and 2170.8. What their theorem does capture is the first-order statement D / ln A → ∞ D/\ln A\to\infty D / ln A → ∞ in this regime; Theorem 1 (iii) gives its rate, D ≍ A γ D\asymp A^\gamma D ≍ A γ (checks/wuyang_check.py in our code release).
Proofs for sec:limit
Assumptions.
(A1) Demand. Queries of template i i i form independent Poisson processes of rate π i \pi_i π i , with π 1 ≥ π 2 ≥ ⋯ \pi_1\geq\pi_2\geq\cdots π 1 ≥ π 2 ≥ ⋯ and ∑ i π i = 1 \sum_i\pi_i=1 ∑ i π i = 1 .
(A2) Audits. Each query is audited independently with probability p p p . An audit yields one verifier outcome, of the candidate that the policy chose to evaluate on that query, revealed after answering. Nothing else about the candidates’ correctness is observed; in particular, the policy does not see whether an unaudited shadow answer agrees with the live one. (Under exact-match scoring such agreement is informative, and Theorem 22 shows that it can speed up certification.)
(A3) Changes. Facts change at the points of an independent Poisson process of rate ν \nu ν per template. Changes may or may not be announced to the policy. A macro formed in an earlier epoch never counts as coverage.
(A4) Outcomes. In environment E τ E_\tau E τ the audited outcomes of the current epoch are i.i.d.
Bernoulli(r r r ), whichever candidate they evaluate, and independent of everything else, denoted G \mathcal{G} G (arrivals, audits, change times, other templates and epochs, internal randomization).
Precise form of Theorem 3. Assume (A1)–(A5) and that in every epoch the audited outcomes are i.i.d. Bernoulli(r 1 r_1 r 1 ), whichever candidate they evaluate (environment E r 1 E_{r_1} E r 1 , the least-favorable good case). (i) For every demand law π \pi π and all ν , p , δ \nu,p,\delta ν , p , δ , every policy that is δ \delta δ -safe in the sense of Definition 1 has lim inf M ≥ ( 1 − ε δ ) F π ( Θ ) \liminf M \ge(1-\varepsilon_\delta)F_\pi(\Theta) lim inf M ≥ ( 1 − ε δ ) F π ( Θ ) almost surely, whether or not changes are announced and however many candidates it forms, where ε δ = O ( ln ln ( 1 / δ ) / ln ( 1 / δ ) ) \varepsilon_\delta=O\left(\sqrt{\ln\ln(1/\delta)/\ln(1/\delta)}\right) ε δ = O ( ln ln ( 1/ δ ) / ln ( 1/ δ ) ) depends only on ( δ , r 0 , r 1 ) (\delta,r_0,r_1) ( δ , r 0 , r 1 ) . (ii) With announced changes, the SPRT that discards all evidence and restarts at each change is δ \delta δ -safe and has M ≤ ( 1 + ln ( r 1 / r 0 ) / ln ( 1 / δ ) ) F π ( Θ ) M\le\left(1+\ln(r_1/r_0)/\ln(1/\delta)\right)F_\pi(\Theta) M ≤ ( 1 + ln ( r 1 / r 0 ) / ln ( 1/ δ ) ) F π ( Θ ) . Hence M ⋆ = ( 1 + o ( 1 ) ) F π ( Θ ) M^\star=(1+o(1))F_\pi(\Theta) M ⋆ = ( 1 + o ( 1 )) F π ( Θ ) as δ → 0 \delta\to0 δ → 0 , uniformly in π , ν , p \pi,\nu,p π , ν , p . The main text calls the environment “good memories are only barely good”; the converse needs no other restriction on the policy than non-anticipation (A5) and the information structure (A2).
Notation: x = ν / p x=\nu/p x = ν / p , ρ i = π i / ( π i + x ) \rho_i=\pi_i/(\pi_i+x) ρ i = π i / ( π i + x ) , a ± a_\pm a ± the log-likelihood-ratio increments on success and failure, w = a + + a − w=a_++a_- w = a + + a − , K L = K L ( r 1 ∥ r 0 ) \mathrm{KL}=\mathrm{KL}(r_1\|r_0) KL = KL ( r 1 ∥ r 0 ) , L = ln ( 1 / δ ) L=\ln(1/\delta) L = ln ( 1/ δ ) , n ⋆ = L / K L n^\star=L/\mathrm{KL} n ⋆ = L / KL , Θ = x n ⋆ \Theta=xn^\star Θ = x n ⋆ and β = 1 − 1 / s \beta=1-1/s β = 1 − 1/ s . Define M f i x ( n , x ) = ∑ i π i ( 1 − ρ i n ) M_{\mathrm{fix}}(n,x)=\sum_i\pi_i(1-\rho_i^n) M fix ( n , x ) = ∑ i π i ( 1 − ρ i n ) .
Lemma 10 (Exact stationary gap). If the policy folds when the N e N_e N e -th outcome of epoch e e e is observed, with ( N e ) (N_e) ( N e ) i.i.d. copies of N N N independent of arrivals, audits and changes, then the long-run unfolded fraction of template i i i is u i = 1 − E [ ρ i N ] u_i=1-\mathbb{E}[\rho_i^N] u i = 1 − E [ ρ i N ] a.s. and in mean, and M = ∑ i π i u i M=\sum_i\pi_i u_i M = ∑ i π i u i .
Proof. Epochs are i.i.d. renewal cycles of mean length 1 / ν 1/\nu 1/ ν with π i / ν \pi_i/\nu π i / ν queries on average. A query at time t t t of an epoch is unfolded iff fewer than N N N audited queries preceded it. By the Mecke formula, E U e = π i E ∫ 0 ℓ P ( Poi ( p π i t ) < N ) d t \mathbb{E}U_e=\pi_i\mathbb{E}\int_0^\ell\mathbb{P}(\operatorname{Poi}(p\pi_i t)<N)\,dt E U e = π i E ∫ 0 ℓ P ( Poi ( p π i t ) < N ) d t with ℓ ∼ Exp ( ν ) \ell\sim\operatorname{Exp}(\nu) ℓ ∼ Exp ( ν ) . The count Poi ( p π i E ) \operatorname{Poi}(p\pi_i E) Poi ( p π i E ) with E ∼ Exp ( ν ) E\sim\operatorname{Exp}(\nu) E ∼ Exp ( ν ) is geometric with P ( ⋅ = k ) = ( 1 − ρ i ) ρ i k \mathbb{P}(\cdot=k)=(1-\rho_i)\rho_i^k P ( ⋅ = k ) = ( 1 − ρ i ) ρ i k , so P ( Poi ( p π i E ) < N ) = 1 − E ρ i N \mathbb{P}(\operatorname{Poi}(p\pi_i E)<N)=1-\mathbb{E}\rho_i^N P ( Poi ( p π i E ) < N ) = 1 − E ρ i N . Apply renewal–reward per template and sum, using Fatou for the lower bound and the superposition property for the upper bound.
Lemma 11 (Zipf sums). For π i = i − s / ζ ( s ) \pi_i=i^{-s}/\zeta(s) π i = i − s / ζ ( s ) , s > 1 s>1 s > 1 , real n ≥ 1 n\ge1 n ≥ 1 and x > 0 x>0 x > 0 ,
K s , n x β − n x ≤ M f i x ( n , x ) ≤ K s , n x β , K_{s,n}x^\beta-nx\le M_{\mathrm{fix}}(n,x)\le K_{s,n}x^\beta, K s , n x β − n x ≤ M fix ( n , x ) ≤ K s , n x β ,
where K s , n = Γ ( 1 / s ) C s , n K_{s,n}=\Gamma(1/s)C_{s,n} K s , n = Γ ( 1/ s ) C s , n and C s , n = ζ ( s ) − 1 / s Γ ( n + 1 − 1 / s ) / ( ( s − 1 ) Γ ( n ) ) C_{s,n}=\zeta(s)^{-1/s}\Gamma(n+1-1/s)/((s-1)\Gamma(n)) C s , n = ζ ( s ) − 1/ s Γ ( n + 1 − 1/ s ) / (( s − 1 ) Γ ( n )) . For integer n n n the latter equals the occupancy form ζ ( s ) − 1 / s s ∑ k < n Γ ( k + 1 − 1 / s ) / k ! \frac{\zeta(s)^{-1/s}}{s}\sum_{k<n}\Gamma(k+1-1/s)/k! s ζ ( s ) − 1/ s ∑ k < n Γ ( k + 1 − 1/ s ) / k ! . Likewise κ s Θ β − Θ ≤ F π ( Θ ) ≤ κ s Θ β \kappa_s\Theta^\beta-\Theta\le F_\pi(\Theta)\le\kappa_s\Theta^\beta κ s Θ β − Θ ≤ F π ( Θ ) ≤ κ s Θ β with κ s = Γ ( 1 / s ) / ( ( s − 1 ) ζ ( s ) 1 / s ) \kappa_s=\Gamma(1/s)/((s-1)\zeta(s)^{1/s}) κ s = Γ ( 1/ s ) / (( s − 1 ) ζ ( s ) 1/ s ) .
Proof. The summand g ( π ) = π ( 1 − ( π / ( π + x ) ) n ) g(\pi)=\pi(1-(\pi/(\pi+x))^n) g ( π ) = π ( 1 − ( π / ( π + x ) ) n ) is nondecreasing in π \pi π and bounded by n x nx n x . Hence the sum lies between ∫ 1 ∞ \int_1^\infty ∫ 1 ∞ and ∫ 0 ∞ \int_0^\infty ∫ 0 ∞ of g ( t − s / ζ ( s ) ) d t g(t^{-s}/\zeta(s))\,dt g ( t − s / ζ ( s )) d t , and the two differ by at most n x nx n x . Substituting y = x ζ ( s ) t s y=x\zeta(s)t^s y = x ζ ( s ) t s and integrating by parts turns ∫ 0 ∞ \int_0^\infty ∫ 0 ∞ into a Beta integral, which gives K s , n x β K_{s,n}x^\beta K s , n x β . The identity ∑ k < n Γ ( k + 1 ) / k ! = Γ ( n + a ) / ( a Γ ( n ) ) \sum_{k<n}\Gamma(k+1)/k!=\Gamma(n+a)/(a\Gamma(n)) ∑ k < n Γ ( k + 1 ) / k ! = Γ ( n + a ) / ( a Γ ( n )) follows by induction. The bounds on F π F_\pi F π follow in the same way with g ( π ) = π ( 1 − e − Θ / π ) ≤ Θ g(\pi)=\pi(1-e^{-\Theta/\pi})\le\Theta g ( π ) = π ( 1 − e − Θ/ π ) ≤ Θ .
Lemma 12 (From Poisson to exponential). For n ≥ 1 n\ge1 n ≥ 1 and y ≥ 0 y\ge0 y ≥ 0 , ( 1 − C ⋆ / n ) ( 1 − e − n y ) ≤ 1 − ( 1 + y ) − n ≤ 1 − e − n y (1-C_\star/n)(1-e^{-ny})\le1-(1+y)^{-n}\le1-e^{-ny} ( 1 − C ⋆ / n ) ( 1 − e − n y ) ≤ 1 − ( 1 + y ) − n ≤ 1 − e − n y with C ⋆ = 1.1047 C_\star=1.1047 C ⋆ = 1.1047 . Consequently ( 1 − C ⋆ / n ) F π ( n x ) ≤ M f i x ( n , x ) ≤ F π ( n x ) (1-C_\star/n)F_\pi(nx)\le M_{\mathrm{fix}}(n,x)\le F_\pi(nx) ( 1 − C ⋆ / n ) F π ( n x ) ≤ M fix ( n , x ) ≤ F π ( n x ) . The function F π F_\pi F π is concave and nondecreasing with F π ( 0 ) = 0 F_\pi(0)=0 F π ( 0 ) = 0 . For random N N N , 1 − E ρ N ≤ 1 − ρ E N 1-\mathbb{E}\rho^N\le1-\rho^{\mathbb{E}N} 1 − E ρ N ≤ 1 − ρ E N by Jensen’s inequality.
Proof of Theorem 3: converse. Fix template i i i and let H e \mathcal{H}_e H e be the history up to the start of epoch e e e . We bound the expected unfolded count of one epoch given H e \mathcal{H}_e H e , and then average over epochs with a martingale strong law.
One epoch. Condition on H e \mathcal{H}_e H e . Let T 1 < T 2 < ⋯ T_1<T_2<\cdots T 1 < T 2 < ⋯ be the audit times of template i i i from the epoch start (continued past its end), Y k Y_k Y k the audited outcomes, σ \sigma σ the first fold event of the epoch, of a candidate formed in any epoch (σ = ∞ \sigma=\infty σ = ∞ if there is none), and N = # { k : T k < σ } N=\#\{k:T_k<\sigma\} N = # { k : T k < σ } . By (A5), N N N is a stopping time for F m = σ ( H e , G , Y 1 , … , Y m ) \mathcal{F}_m=\sigma(\mathcal{H}_e,\mathcal{G},Y_1,\ldots,Y_m) F m = σ ( H e , G , Y 1 , … , Y m ) , and σ \sigma σ is F N \mathcal{F}_N F N -measurable. By (A4), d P r 1 / d P r 0 ∣ F m = e W m d\mathbb{P}_{r_1}/d\mathbb{P}_{r_0}|_{\mathcal{F}_m}=e^{W_m} d P r 1 / d P r 0 ∣ F m = e W m , where W m W_m W m is the log-likelihood-ratio walk; this holds whichever candidates the policy forms or audits, because every audit reveals one outcome with the same law. Fix an integer n ≤ n ⋆ n\le n^\star n ≤ n ⋆ and c > 0 c>0 c > 0 . Let Q n Q^n Q n be the number of the epoch’s queries preceded by fewer than n n n of its audits, and let R R R be the number of those that arrive after the first fold event σ \sigma σ . Every query answered by a candidate of the epoch arrives after σ \sigma σ , so the unfolded count satisfies U ≥ Q < n − R U \ge Q^{<n} - R U ≥ Q < n − R . Moreover, R R R is a function of σ \sigma σ and G \mathcal{G} G , hence F N \mathcal{F}_N F N -measurable even if the policy later unfolds and refolds, and R > 0 R > 0 R > 0 implies N ≤ n − 1 N \le n - 1 N ≤ n − 1 .
Low evidence. Wald’s likelihood-ratio identity for the F N \mathcal{F}_N F N -measurable R ≥ 0 R \ge0 R ≥ 0 gives E r 1 [ R ; W N ≤ c , N < ∞ ] ≤ e c E r 0 [ R ] \mathbb{E}_{r_1}[R; W_N \le c, N < \infty] \le e^c\mathbb{E}_{r_0}[R] E r 1 [ R ; W N ≤ c , N < ∞ ] ≤ e c E r 0 [ R ] . Under r 0 r_0 r 0 all candidates are bad, so by Definition 1 the epoch has a fold event with probability at most δ \delta δ given H e \mathcal{H}_e H e . Given F σ \mathcal{F}_\sigma F σ , the strong Markov property of the Poisson arrival, audit and change processes bounds the mean number of queries between σ \sigma σ and the earlier of the n n n -th audit and the epoch end by min ( n / p , π i / ν ) \min(n/p,\pi_i/\nu) min ( n / p , π i / ν ) . Hence E r 0 [ R ∣ H e ] ≤ δ min ( n / p , π i / ν ) \mathbb{E}_{r_0}[R \mid\mathcal{H}_e] \le\delta\min(n/p,\pi_i/\nu) E r 0 [ R ∣ H e ] ≤ δ min ( n / p , π i / ν ) .
High evidence. On { W N > c , R > 0 } \{W_N > c, R > 0\} { W N > c , R > 0 } we have max k ≤ n − 1 W k > c \max_{k\le n-1} W_k > c max k ≤ n − 1 W k > c . Since R ≤ Q < n R \le Q^{<n} R ≤ Q < n and Q < n Q^{<n} Q < n is G \mathcal{G} G -measurable, E r 1 [ R ; W N > c ∣ H e ] ≤ E Q < n ⋅ β n − 1 ( c ) \mathbb{E}_{r_1}[R; W_N > c \mid\mathcal{H}_e] \le\mathbb{E}Q^{<n}\cdot\beta_{n-1}(c) E r 1 [ R ; W N > c ∣ H e ] ≤ E Q < n ⋅ β n − 1 ( c ) , where β m ( c ) = P r 1 ( max k ≤ m W k ≥ c ) \beta_m(c) = \mathbb{P}_{r_1}(\max_{k\le m} W_k \ge c) β m ( c ) = P r 1 ( max k ≤ m W k ≥ c ) .
Since E Q < n = π i ν ( 1 − ρ i n ) \mathbb{E}Q^{<n} = \frac{\pi_i}{\nu}(1-\rho_i^n) E Q < n = ν π i ( 1 − ρ i n ) by the computation in Lemma 10, the unfolded count U e U_e U e of epoch e e e satisfies E [ U e ∣ H e ] ≥ π i ν b i \mathbb{E}[U_e \mid\mathcal{H}_e] \ge\frac{\pi_i}{\nu}b_i E [ U e ∣ H e ] ≥ ν π i b i , where
b i : = ( 1 − β n − 1 ( c ) ) ( 1 − ρ i n ) − e c δ min ( 1 , n ν p π i ) . b_i := (1-\beta_{n-1}(c))(1-\rho_i^n)-e^c\delta\min\left(1,\frac{n\nu}{p\pi_i}\right). b i := ( 1 − β n − 1 ( c )) ( 1 − ρ i n ) − e c δ min ( 1 , p π i n ν ) .
Many epochs. Let Q e Q_e Q e be the number of queries of template i i i in epoch e e e . The Q e Q_e Q e are i.i.d. geometric with mean π i / ν \pi_i/\nu π i / ν whatever the policy does, so E Q e 2 < ∞ \mathbb{E}Q_e^2 < \infty E Q e 2 < ∞ . The differences D e = U e − E [ U e ∣ H e ] D_e = U_e-\mathbb{E}[U_e \mid\mathcal{H}_e] D e = U e − E [ U e ∣ H e ] are martingale differences with E D e 2 ≤ E Q e 2 \mathbb{E}D_e^2 \le\mathbb{E}Q_e^2 E D e 2 ≤ E Q e 2 , because 0 ≤ U e ≤ Q e 0 \le U_e \le Q_e 0 ≤ U e ≤ Q e . Hence ∑ e D e / e \sum_e D_e/e ∑ e D e / e converges a.s. by the L 2 L^2 L 2 martingale convergence theorem, and Kronecker’s lemma gives 1 K ∑ e ≤ K D e → 0 \frac{1}{K}\sum_{e\le K}D_e \to0 K 1 ∑ e ≤ K D e → 0 a.s. (Hall and Heyde, 1980, Thm. 2.18). With the ordinary strong law for ( Q e ) (Q_e) ( Q e ) , lim inf K ∑ e ≤ K U e ∑ e ≤ K Q e ≥ b i \liminf_K \frac{\sum_{e\le K}U_e}{\sum_{e\le K}Q_e} \ge b_i lim inf K ∑ e ≤ K Q e ∑ e ≤ K U e ≥ b i a.s. The last, incomplete epoch contributes a vanishing share because Q K / K → 0 Q_K/K \to0 Q K / K → 0 a.s., so the long-run unfolded fraction satisfies lim inf u i ≥ b i \liminf u_i \ge b_i lim inf u i ≥ b i a.s.
Choice of n n n and $c. Take n − 1 = ⌊ ( 1 − ε ) n ⌋ n-1=\lfloor(1-\varepsilon)n\rfloor n − 1 = ⌊( 1 − ε ) n ⌋ and c = ( 1 − ε / 2 ) L c=(1-\varepsilon/2)L c = ( 1 − ε /2 ) L , with ε → 0 \varepsilon\to0 ε → 0 and ε L / ln L → ∞ \varepsilon\sqrt{L}/\sqrt{\ln L}\to\infty ε L / ln L → ∞ . Then β n − 1 ( c ) → 0 \beta_{n-1}(c)\to0 β n − 1 ( c ) → 0 by Azuma’s maximal inequality for W W W (the mean of W n − 1 W_{n-1} W n − 1 is at most ( 1 − ε ) L (1-\varepsilon)L ( 1 − ε ) L ), and e c δ = δ ε / 2 → 0 e^c\delta=\delta^{\varepsilon/2}\to0 e c δ = δ ε /2 → 0 . Lemma 12 and concavity give $1-\rho_i^n\ge(1-C_*/n)(1-\varepsilon)(1-e^{-\Theta/\pi_i})$, and min ( 1 , Θ / π i ) ≤ e e − 1 ( 1 − e − Θ / π i ) \min(1,\Theta/\pi_i)\le\frac{e}{e-1}(1-e^{-\Theta/\pi_i}) min ( 1 , Θ/ π i ) ≤ e − 1 e ( 1 − e − Θ/ π i ) . Hence lim inf u i ≥ ( 1 − ε δ ) ( 1 − e − Θ / π i ) \liminf u_i\ge(1-\varepsilon_\delta)(1-e^{-\Theta/\pi_i}) lim inf u i ≥ ( 1 − ε δ ) ( 1 − e − Θ/ π i ) with ε δ = O ( ln L / L ) \varepsilon_\delta=O(\sqrt{\ln L}/L) ε δ = O ( ln L / L ) , uniformly in i i i , π \pi π , ν \nu ν and p p p .
O ( ln L / L ) O(\sqrt{\ln L}/L) O ( ln L / L ) , uniformly in i i i , π \pi π , ν \nu ν and p p p . Summing over templates with Fatou’s lemma for series gives lim inf M ≥ ( 1 − ε δ ) F π ( Θ ) \liminf M\ge(1-\varepsilon_\delta)F_\pi(\Theta) lim inf M ≥ ( 1 − ε δ ) F π ( Θ ) a.s.
Announcements and candidates. The argument used announcements only through F m \mathcal{F}_m F m , which contains the change times through G \mathcal{G} G . A policy that does not observe changes is non-anticipating for a smaller filtration, so the bound holds for it a fortiori. The number of candidates entered only through the likelihood ratio, which (A2) and (A4) make independent of which candidate is audited. □
Proof of Theorem 3: achievability. At each announced change the policy discards all candidates’ evidence and restarts one SPRT, so every fold event of an epoch is a crossing of that epoch’s test. Under r ≤ r 0 r\le r_0 r ≤ r 0 , E e Z k ≤ 1 \mathbb{E}e^{Z_k}\le1 E e Z k ≤ 1 for each increment of the SPRT statistic. So e Λ n e^{\Lambda_n} e Λ n is a nonnegative supermartingale, and Ville’s inequality gives P ( sup n Λ n ≥ L ) ≤ δ \mathbb{P}(\sup_n\Lambda_n\ge L)\le\delta P ( sup n Λ n ≥ L ) ≤ δ under arbitrary drift below r 0 r_0 r 0 and adaptive audit schedules. Under r ≥ r 1 r\ge r_1 r ≥ r 1 , Wald’s identity with overshoot < a + <a_+ < a + gives E N ≤ ( L + a + ) / K L \mathbb{E}N\le(L+a_+)/KL E N ≤ ( L + a + ) / K L . By Lemma 10, Jensen’s inequality and Lemma 12, M S P R T ≤ F π ( ν E N ) ≤ ( 1 + a + / L ) F π ( Θ ) M_{\mathrm{SPRT}}\le F_\pi(\nu\mathbb{E}N)\le(1+a_+/L)F_\pi(\Theta) M SPRT ≤ F π ( ν E N ) ≤ ( 1 + a + / L ) F π ( Θ ) , where the last step uses concavity of F π F_\pi F π .
The per-template gap of the SPRT can be bracketed exactly, which sharpens the Jensen step above and makes the limit quantitative at practical δ \delta δ .
Lemma 13 (Finite-δ \delta δ bracket). Let Z Z Z be the SPRT increment, a + = ln ( r 1 / r 0 ) a_+=\ln(r_1/r_0) a + = ln ( r 1 / r 0 ) its value on a success, and let ξ i > 0 \xi_i>0 ξ i > 0 solve
E r 1 e ξ i Z = 1 + ν / ( p π i ) . (7) \mathbb{E}_{r_1}e^{\xi_i Z}=1+\nu/(p\pi_i). \tag*{(7)} E r 1 e ξ i Z = 1 + ν / ( p π i ) . (7)
If every epoch runs the SPRT at level δ \delta δ , the unfolded fraction u i u_i u i of template i i i (so M = ∑ i π i u i M=\sum_i\pi_i u_i M = ∑ i π i u i ) satisfies
1 − δ ξ i ≤ u i ≤ 1 − δ ξ i e − ξ i a + . 1-\delta^{\xi_i}\le u_i\le1-\delta^{\xi_i}e^{-\xi_i a_+}. 1 − δ ξ i ≤ u i ≤ 1 − δ ξ i e − ξ i a + .
Every per-epoch δ \delta δ -safe certifier that folds at a stopping time of the audited outcomes has u i ≥ 1 − δ ξ i / ( 1 + ξ i ) u_i\ge1-\delta^{\xi_i/(1+\xi_i)} u i ≥ 1 − δ ξ i / ( 1 + ξ i ) . As ν / ( p π i ) → 0 \nu/(p\pi_i)\to0 ν / ( p π i ) → 0 with Θ / π i \Theta/\pi_i Θ/ π i fixed, ξ i ln ( 1 / δ ) = Θ / π i \xi_i\ln(1/\delta)=\Theta/\pi_i ξ i ln ( 1/ δ ) = Θ/ π i , and all three bounds tend to 1 − e − Θ / π i 1-e^{-\Theta/\pi_i} 1 − e − Θ/ π i .
Proof of Lemma 13. Write L = ln ( 1 / δ ) L=\ln(1/\delta) L = ln ( 1/ δ ) and σ 2 = Var r 1 Z \sigma^2=\operatorname{Var}_{r_1}Z σ 2 = Var r 1 Z . The right side of Equation (7) is 1 / ρ i 1/\rho_i 1/ ρ i , and N N N is the SPRT sample size in audited outcomes. By Lemma 10, u i = 1 − E e ρ i N u_i=1-\mathbb{E}e^{\rho_i^N} u i = 1 − E e ρ i N , since audited outcomes of template i i i arrive at rate p π i p\pi_i p π i and the epoch ends at rate ν \nu ν . The function ψ ( ξ ) = ln E r 1 e ξ Z \psi(\xi)=\ln\mathbb{E}_{r_1}e^{\xi Z} ψ ( ξ ) = ln E r 1 e ξ Z is convex with ψ ( 0 ) = 0 \psi(0)=0 ψ ( 0 ) = 0 , ψ ′ ( 0 ) = K L > 0 \psi'(0)=KL>0 ψ ′ ( 0 ) = K L > 0 and ψ ( ξ ) → ∞ \psi(\xi)\to\infty ψ ( ξ ) → ∞ , so Equation (7) has a unique root. Hence M n = ρ i ξ i Λ n M_n=\rho_i^{\xi_i\Lambda_n} M n = ρ i ξ i Λ n is a mean-one P r 1 \mathbb{P}_{r_1} P r 1 -martingale, as in Wald’s fundamental identity (Siegmund, 1985). Bracket. Before the crossing M n ≤ e ξ i L M_n\le e^{\xi_iL} M n ≤ e ξ i L , and at the crossing L ≤ Λ N < L + a + L\le\Lambda_N<L+a_+ L ≤ Λ N < L + a + . Since N < ∞ N<\infty N < ∞ a.s., dominated convergence gives E M N = 1 \mathbb{E}M_N=1 E M N = 1 , and the bounds on Λ N \Lambda_N Λ N give δ ξ i e − ξ i a + ≤ E ρ i N ≤ δ ξ i \delta^{\xi_i}e^{-\xi_i a_+}\le\mathbb{E}\rho_i^N\le\delta^{\xi_i} δ ξ i e − ξ i a + ≤ E ρ i N ≤ δ ξ i . Converse. Write ρ i N = M N 1 / ( 1 + ξ i ) ( ρ i N e − Λ N ) ξ i / ( 1 + ξ i ) \rho_i^N=M_N^{1/(1+\xi_i)}(\rho_i^Ne^{-\Lambda_N})^{\xi_i/(1+\xi_i)} ρ i N = M N 1/ ( 1 + ξ i ) ( ρ i N e − Λ N ) ξ i / ( 1 + ξ i ) . By Hölder’s inequality with exponents 1 + ξ i 1+\xi_i 1 + ξ i and 1 + ξ i ξ i \frac{1+\xi_i}{\xi_i} ξ i 1 + ξ i , E r 1 [ ρ i N ; N < ∞ ] \mathbb{E}_{r_1}[\rho_i^N;N<\infty] E r 1 [ ρ i N ; N < ∞ ] is at most E r 1 [ M N ; N < ∞ ] 1 / ( 1 + ξ i ) \mathbb{E}_{r_1}[M_N;N<\infty]^{1/(1+\xi_i)} E r 1 [ M N ; N < ∞ ] 1/ ( 1 + ξ i ) times E r 1 [ ρ i N e − Λ N ; N < ∞ ] ξ i / ( 1 + ξ i ) \mathbb{E}_{r_1}[\rho_i^Ne^{-\Lambda_N};N<\infty]^{\xi_i/(1+\xi_i)} E r 1 [ ρ i N e − Λ N ; N < ∞ ] ξ i / ( 1 + ξ i ) . The first factor is ≤ 1 \le1 ≤ 1 by Fatou’s lemma. By change of measure the second expectation is E r 0 [ ρ i N ; N < ∞ ] \mathbb{E}_{r_0}[\rho_i^N;N<\infty] E r 0 [ ρ i N ; N < ∞ ] , the probability of folding a bad candidate within the epoch, which is ≤ δ \le\delta ≤ δ . Limit. Expanding ψ ( ξ ) = K L ξ + σ 2 ξ 2 2 + O ( ξ 3 ) \psi(\xi)=\mathrm{KL}\xi+\frac{\sigma^2\xi^2}{2}+O(\xi^3) ψ ( ξ ) = KL ξ + 2 σ 2 ξ 2 + O ( ξ 3 ) and ln ( 1 + y ) = y + O ( y 2 ) \ln(1+y)=y+O(y^2) ln ( 1 + y ) = y + O ( y 2 ) in Equation (7) gives ξ i L = Θ π i ( 1 + O ( ν p π i ( 1 + σ 2 K L 2 ) ) ) \xi_iL=\frac{\Theta}{\pi_i}\left(1+O\left(\frac{\nu}{p\pi_i}\left(1+\frac{\sigma^2}{\mathrm{KL}^2}\right)\right)\right) ξ i L = π i Θ ( 1 + O ( p π i ν ( 1 + KL 2 σ 2 ) ) ) , and ξ i a + → 0 \xi_i a_+\to0 ξ i a + → 0 .
The bracket is two-sided and sharper than the Jensen bound u i ≤ 1 − ρ i E N u_i\le1-\rho_i^{\mathrm{EN}} u i ≤ 1 − ρ i EN used for Theorem 3 . For ( r 0 , r 1 ) = ( 0.85 , 0.95 ) (r_0,r_1)=(0.85,0.95) ( r 0 , r 1 ) = ( 0.85 , 0.95 ) , δ = 10 − 2 \delta=10^{-2} δ = 1 0 − 2 and Θ / π i = 0.908 \Theta/\pi_i=0.908 Θ/ π i = 0.908 , exact dynamic programming gives u i = 0.5610 ∈ [ 0.5557 , 0.5643 ] u_i=0.5610\in[0.5557,0.5643] u i = 0.5610 ∈ [ 0.5557 , 0.5643 ] . Here ξ i = 0.1762 \xi_i=0.1762 ξ i = 0.1762 , the converse bound is 0.4984, the first-order value 1 − e − Θ / π i 1-e^{-\Theta/\pi_i} 1 − e − Θ/ π i is 0.5966, and the Jensen bound is 0.5998.
Universality. Suppose G ( θ ) = ∑ i : π i ≤ θ π i G(\theta)=\sum_{i:\pi_i\le\theta}\pi_i G ( θ ) = ∑ i : π i ≤ θ π i is regularly varying with index 1 − α ∈ ( 0 , 1 ) 1-\alpha\in(0,1) 1 − α ∈ ( 0 , 1 ) . Writing F π ( Θ ) = 1 − e − Θ + ∫ 0 ∞ G ( Θ / y ) e − y d y F_\pi(\Theta)=1-e^{-\Theta}+\int_0^\infty G(\Theta/y)e^{-y}\,dy F π ( Θ ) = 1 − e − Θ + ∫ 0 ∞ G ( Θ/ y ) e − y d y and applying Potter’s bounds with dominated convergence gives F π ( Θ ) ∼ Γ ( α ) G ( Θ ) F_\pi(\Theta)\sim\Gamma(\alpha)G(\Theta) F π ( Θ ) ∼ Γ ( α ) G ( Θ ) as Θ → 0 \Theta\to0 Θ → 0 . For Zipf demand, α = 1 / s \alpha=1/s α = 1/ s .
A finite-size law for cold starts. The steady state of Theorem 3 is reached only after about 1 / ν 1/\nu 1/ ν queries. The following law interpolates between a cold start and the drift floor. It is stated for a fixed certification sample size n n n , not for sequentially tested (safe) folding; extending it to safe folding is open.
Theorem 14 (One law for cold start and drift). Let demand be Zipf( s ) (s) ( s ) , start all templates cold at time 0, let facts change at rate ν \nu ν , and fold after n n n audited uses. The probability that the query at time T T T is not answered in one step satisfies M ( T , ν ) = ( p T ) − ( 1 − 1 / s ) Φ s , n ( ν T ) ( 1 + o ( 1 ) ) M(T,\nu)=(pT)^{-(1-1/s)}\Phi_{s,n}(\nu T)(1+o(1)) M ( T , ν ) = ( pT ) − ( 1 − 1/ s ) Φ s , n ( ν T ) ( 1 + o ( 1 )) with relative error O ( m 1 / s ln ( 1 / m ) ) O(m^{1/s}\ln(1/m)) O ( m 1/ s ln ( 1/ m )) , m = max ( 1 / ( p T ) , ν / p ) m=\max(1/(pT),\nu/p) m = max ( 1/ ( pT ) , ν / p ) , where Φ s , n ( y ) = C s , n e − y + y 1 − 1 / s γ i n c ( 1 / s , y ) \Phi_{s,n}(y)=C_{s,n}e^{-y}+y^{1-1/s}\gamma_{\mathrm{inc}}(1/s,y) Φ s , n ( y ) = C s , n e − y + y 1 − 1/ s γ inc ( 1/ s , y ) , C s , n C_{s,n} C s , n is as in Lemma 11, and γ i n c \gamma_{\mathrm{inc}} γ inc is the lower incomplete gamma function.
At y = ν T = 0 y=\nu T=0 y = ν T = 0 this is the static amortization law M ( T ) ∼ C s , n ( p T ) − ( 1 − 1 / s ) M(T)\sim C_{s,n}(pT)^{-(1-1/s)} M ( T ) ∼ C s , n ( pT ) − ( 1 − 1/ s ) , a corollary of Karlin (1967) and Ohannessian and Dahleh (2012, Prop. 7) summed over r < n r<n r < n . It is a power law of practice (Newell and Rosenbloom, 1981; Heathcote et al., 2000) whose exponent 1 − 1 / s 1-1/s 1 − 1/ s , shared by memorization learning curves (Hutter, 2021; Michaud et al., 2023), is set by the task distribution. As y → ∞ y\to\infty y → ∞ it tends to Γ ( 1 / s ) C s , n ( ν / p ) − 1 / s = κ s Θ − 1 / s ( 1 + O ( 1 / n ) ) \Gamma(1/s)C_{s,n}(\nu/p)^{-1/s}=\kappa_s\Theta^{-1/s}(1+O(1/n)) Γ ( 1/ s ) C s , n ( ν / p ) − 1/ s = κ s Θ − 1/ s ( 1 + O ( 1/ n )) with Θ = n ν / p \Theta=n\nu/p Θ = n ν / p , the steady state of Corollary 4. Appendix § 14 .§ 1 tests the static branch on natural template streams.
Proof of Theorem 14. With changes at rate ν \nu ν from a cold start at 0, the age of the current epoch at time T T T is A T = min ( T , E ν ) A_T=\min(T,E_\nu) A T = min ( T , E ν ) , and the audited count of template i i i given A T A_T A T is Poi ( p π i A T ) \operatorname{Poi}(p\pi_iA_T) Poi ( p π i A T ) . For audited exposure a a a (i.e. a = p A T a=pA_T a = p A T ), the sum S n ( a ) = ∑ i π i P ( Poi ( π i a ) < n ) S_n(a)=\sum_i\pi_i\mathbb{P}(\operatorname{Poi}(\pi_i a)<n) S n ( a ) = ∑ i π i P ( Poi ( π i a ) < n ) satisfies ∣ S n ( a ) − C s , n a − β ∣ ≤ 2 n / a |S_n(a)-C_{s,n}a^{-\beta}|\le2n/a ∣ S n ( a ) − C s , n a − β ∣ ≤ 2 n / a . The summand is unimodal in π i \pi_i π i , with maximum at most n / a n/a n / a , and its integral is C s , n a − β C_{s,n}a^{-\beta} C s , n a − β . Averaging ( p A T ) − β (pA_T)^{-\beta} ( p A T ) − β gives p − β E A T − β = ( p T ) − β [ e − y + y β γ i n c ( 1 − β , y ) ] p^{-\beta}\mathbb{E}A_T^{-\beta}=(pT)^{-\beta}[e^{-y}+y^\beta\gamma_{\mathrm{inc}}(1-\beta,y)] p − β E A T − β = ( pT ) − β [ e − y + y β γ inc ( 1 − β , y )] with y = ν T y=\nu T y = ν T , which is the stated Φ s , n \Phi_{s,n} Φ s , n . The error bound O ( m 1 / s ln ( 1 / m ) ) O(m^{1/s}\ln(1/m)) O ( m 1/ s ln ( 1/ m )) with m = max ( 1 / ( p T ) , ν / p ) m=\max(1/(pT),\nu/p) m = max ( 1/ ( pT ) , ν / p ) follows by integrating min ( 2 n / a , 1 ) \min(2n/a,1) min ( 2 n / a , 1 ) against the law of p A T pA_T p A T . □
Certifying utility by betting
The SPRT of Section 4 tests reliability against r 0 = r ⋆ r_0=r^\star r 0 = r ⋆ (Equation (1) ), which depends on the live accuracy a a a . Here we certify the macro’s net utility relative to live on paired shadow evaluations instead, so a never enters the null. The tools are testing by betting (Shafer, 2021; Ramdas et al., 2023; Waudby-Smith and Ramdas, 2024) with inverse-propensity audits, as in Xu et al. (2024) and Yu et al. (2026b).
Setup. Fix a template and a frozen candidate. At shadow evaluation t = 1 , 2 , … t=1,2,\ldots t = 1 , 2 , … , both paths run on the same instance. Live has cost C t L C_t^L C t L and correctness Y t L ∈ { 0 , 1 } Y_t^L\in\{0,1\} Y t L ∈ { 0 , 1 } ; the macro has C t M C_t^M C t M and Y t M Y_t^M Y t M . The paired utility of folding is
U t = C t L − C t M + L ( Y t M − Y t L ) . (8) U_t=C_t^L-C_t^M+L(Y_t^M-Y_t^L). \tag*{(8)} U t = C t L − C t M + L ( Y t M − Y t L ) . (8)
Given a known B B B with U t ≥ − B U_t\ge-B U t ≥ − B , put Z t = U t / B ∈ [ − 1 , M ] Z_t=U_t/B\in[-1,M] Z t = U t / B ∈ [ − 1 , M ] . In the paired Bernoulli model (C L ≡ m C^L\equiv m C L ≡ m , C M ≡ 1 C^M\equiv1 C M ≡ 1 ), let η = ( m − 1 ) / L < 1 \eta=(m-1)/L<1 η = ( m − 1 ) / L < 1 , D t = Y t M − Y t L D_t=Y_t^M-Y_t^L D t = Y t M − Y t L and B = L ( 1 − η ) B=L(1-\eta) B = L ( 1 − η ) . Then Z t = ( η + D t ) / ( 1 − η ) Z_t=(\eta+D_t)/(1-\eta) Z t = ( η + D t ) / ( 1 − η ) and E Z t = ( r − r ⋆ ) / ( 1 − η ) \mathbb{E}Z_t=(r-r^\star)/(1-\eta) E Z t = ( r − r ⋆ ) / ( 1 − η ) .
Correctness is revealed only on audited instances (A t = 1 A_t = 1 A t = 1 ). Let F t − 1 \mathcal{F}_{t-1} F t − 1 be everything that happened before t t t , observed or not, and let W t W_t W t be pre-audit side information (costs, both answers, a judge score). Put H t = F t − 1 ∨ σ ( W t ) \mathcal{H}_t = \mathcal{F}_{t-1} \lor\sigma(W_t) H t = F t − 1 ∨ σ ( W t ) , and let G t − 1 ⊆ F t − 1 \mathcal{G}_{t-1} \subseteq\mathcal{F}_{t-1} G t − 1 ⊆ F t − 1 be the system’s records. We assume:
(A1) the audit probability p t p_t p t is H t \mathcal{H}_t H t -measurable and computable, and p t ≥ π t p_t \ge\pi_t p t ≥ π t on { p t > 0 } \{p_t > 0\} { p t > 0 } for a G t − 1 \mathcal{G}_{t-1} G t − 1 -measurable floor π t ∈ ( 0 , 1 ] \pi_t \in(0, 1] π t ∈ ( 0 , 1 ] ;
(A2) P ( A t = 1 ∣ H t , Z t ) = p t \mathbb{P}(A_t = 1 \mid\mathcal{H}_t, Z_t) = p_t P ( A t = 1 ∣ H t , Z t ) = p t ;
(A3) a computable surrogate g t ∈ [ − 1 , G ‾ ] g_t \in[-1, \overline{G}] g t ∈ [ − 1 , G ] satisfies Z t = g t Z_t = g_t Z t = g t on { p t = 0 } \{p_t = 0\} { p t = 0 } .
The estimator Z ^ t = g t + A t ( Z t − g t ) / p t \widehat{Z}_t = g_t + A_t(Z_t - g_t)/p_t Z t = g t + A t ( Z t − g t ) / p t (with 0 / 0 : = 0 0/0 := 0 0/0 := 0 ) is observable. Taking g ≡ 0 g \equiv0 g ≡ 0 gives IPW, and p ≡ 1 p \equiv1 p ≡ 1 gives full information. The candidate is inadmissible under
H 0 : E [ Z t ∣ F t − 1 ] ≤ 0 a.s. for all t . (9) H_0 : \mathbb{E}[Z_t \mid\mathcal{F}_{t-1}] \le0 \text{ a.s. for all } t. \tag*{(9)} H 0 : E [ Z t ∣ F t − 1 ] ≤ 0 a.s. for all t . (9)
H 0 H_0 H 0 leaves arbitrary the joint law of ( C L , C M , Y L , Y M ) (C^L, C^M, Y^L, Y^M) ( C L , C M , Y L , Y M ) , including the live–macro error dependence, and its dependence on the past. Drifting live accuracy, shared difficulty and adaptive query selection are therefore all allowed.
Test. Let κ t = ( 1 + G ‾ ( 1 − π t ) ) / π t \kappa_t = (1 + \overline{G}(1 - \pi_t))/\pi_t κ t = ( 1 + G ( 1 − π t )) / π t , which is 1 / π t 1/\pi_t 1/ π t for IPW. Take G t − 1 \mathcal{G}_{t-1} G t − 1 -measurable bets λ t ( j ) ∈ [ 0 , 1 / κ t ] \lambda_t^{(j)} \in[0, 1/\kappa_t] λ t ( j ) ∈ [ 0 , 1/ κ t ] and weights w j ≥ 0 w_j \ge0 w j ≥ 0 with ∑ j w j ≤ 1 \sum_j w_j \le1 ∑ j w j ≤ 1 . Fold at τ = inf { n : K n ≥ 1 / δ } \tau= \inf\{n : K_n \ge1/\delta\} τ = inf { n : K n ≥ 1/ δ } , where
K n = ∑ j w j ∏ t ≤ n ( 1 + λ t ( j ) Z ^ t ) . (10) K_n = \sum_j w_j \prod_{t \le n}(1 + \lambda_t^{(j)}\widehat{Z}_t). \tag*{(10)} K n = j ∑ w j t ≤ n ∏ ( 1 + λ t ( j ) Z t ) . (10)
The grid mixture at audit rate p p p uses λ ( j ) = p c j \lambda^{(j)} = p c_j λ ( j ) = p c j , c j = ( 1 + ε ) − j c_j = (1 + \varepsilon)^{-j} c j = ( 1 + ε ) − j , w j = 1 / ( j ( j + 1 ) ) w_j = 1/(j(j + 1)) w j = 1/ ( j ( j + 1 )) and ε = 1 / ln ( 1 / δ ) \varepsilon= 1/\ln(1/\delta) ε = 1/ ln ( 1/ δ ) .
Theorem 15 (Anytime validity). Under (A1)–(A3) and H 0 H_0 H 0 , ( K n ) (K_n) ( K n ) is a nonnegative supermartingale with K 0 ≤ 1 K_0 \le1 K 0 ≤ 1 . Hence P ( ∃ n : K n ≥ 1 / δ ) ≤ δ \mathbb{P}(\exists n : K_n \ge1/\delta) \le\delta P ( ∃ n : K n ≥ 1/ δ ) ≤ δ for every schedule of shadow evaluations and every stopping or abandonment rule.
Proof. Positivity. If A t = 0 A_t = 0 A t = 0 , then Z ^ t = g t ≥ − 1 ≥ − κ t \widehat{Z}_t = g_t \ge-1 \ge-\kappa_t Z t = g t ≥ − 1 ≥ − κ t . If A t = 1 A_t = 1 A t = 1 , then Z ^ t = g t ( 1 − 1 / p t ) + Z t / p t ≥ G ‾ − ( 1 + G ‾ ) / p t \widehat{Z}_t = g_t(1 - 1/p_t) + Z_t/p_t \ge\overline{G} - (1 + \overline{G})/p_t Z t = g t ( 1 − 1/ p t ) + Z t / p t ≥ G − ( 1 + G ) / p t . This bound increases in p t p_t p t , so it is ≥ − κ t \ge-\kappa_t ≥ − κ t because p t ≥ π t p_t \ge\pi_t p t ≥ π t . Hence every factor is ≥ 1 − λ t ( j ) κ t ≥ 0 \ge1 - \lambda_t^{(j)}\kappa_t \ge0 ≥ 1 − λ t ( j ) κ t ≥ 0 . Unbiasedness. On { p t > 0 } \{p_t > 0\} { p t > 0 } , (A2) gives E [ Z ^ t ∣ H t , Z t ] = Z t \mathbb{E}[\widehat{Z}_t \mid\mathcal{H}_t, Z_t] = Z_t E [ Z t ∣ H t , Z t ] = Z t . On { p t = 0 } \{p_t = 0\} { p t = 0 } , Z ^ t = g t = Z t \widehat{Z}_t = g_t = Z_t Z t = g t = Z t by (A3). Since F t − 1 ⊆ H t \mathcal{F}_{t-1} \subseteq\mathcal{H}_t F t − 1 ⊆ H t ,
E [ Z ^ t ∣ F t − 1 ] = E [ Z t ∣ F t − 1 ] ≤ 0. \mathbb{E}[\widehat{Z}_t \mid\mathcal{F}_{t-1}] = \mathbb{E}[Z_t \mid\mathcal{F}_{t-1}] \le0. E [ Z t ∣ F t − 1 ] = E [ Z t ∣ F t − 1 ] ≤ 0.
Supermartingale. Because λ t ( j ) \lambda_t^{(j)} λ t ( j ) is F t − 1 \mathcal{F}_{t-1} F t − 1 -measurable, each product in Equation (10) is a nonnegative supermartingale, and so is their weighted sum, by monotone convergence. Ville. Let σ = inf { n : K n ≥ 1 / δ } \sigma= \inf\{n : K_n \ge1/\delta\} σ = inf { n : K n ≥ 1/ δ } . Optional stopping at σ ∧ n \sigma\wedge n σ ∧ n gives 1 ≥ E K σ ∧ n ≥ δ − 1 P ( σ ≤ n ) 1 \ge\mathbb{E}K_{\sigma\wedge n} \ge\delta^{-1}\mathbb{P}(\sigma\le n) 1 ≥ E K σ ∧ n ≥ δ − 1 P ( σ ≤ n ) . Let n → ∞ n \to\infty n → ∞ (Ville (1939)).
Remark 3. Validity has three limits.
Bets may not use W t W_t W t .
(A2) excludes outcome-dependent labelling, such as labels that arrive through user complaints.
Drift is covered only inside H 0 H_0 H 0 , so folded macros must still be monitored.
Audits can also be triggered by disagreement. Audit only when the two answers differ, and set g t = ( C t L − C t M ) / B g_t = (C_t^L - C_t^M)/B g t = ( C t L − C t M ) / B on agreement, which (A3) allows only under exact-match scoring (condition (E) of Appendix § 13 .§ 1 ). Then p t ∈ { 0 , 1 } p_t \in\{0,1\} p t ∈ { 0 , 1 } and κ t = 1 \kappa_t = 1 κ t = 1 , so the test keeps full-information power at a label cost of P ( answers differ ) E τ \mathbb{P}(\text{answers differ}) \mathbb{E}\tau P ( answers differ ) E τ . Unlike a sign test on discordant pairs ((Shawn, 2026)), concordant pairs here carry the deterministic gain η / ( 1 − η ) \eta/(1-\eta) η / ( 1 − η ) . A macro slightly less accurate than live is therefore still certifiable when r > r ⋆ r > r^\star r > r ⋆ .
The information constant. For a law P P P of Z Z Z on [ − 1 , M ] [-1,M] [ − 1 , M ] with mean μ \mu μ , let g P ( c ) = E P ln ( 1 + c Z ) g_P(c) = \mathbb{E}_P \ln(1 + cZ) g P ( c ) = E P ln ( 1 + c Z ) and g ⋆ ( P ) = max c ∈ [ 0 , 1 ] g P ( c ) g^\star(P) = \max_{c \in[0,1]} g_P(c) g ⋆ ( P ) = max c ∈ [ 0 , 1 ] g P ( c ) , attained at c ⋆ c^\star c ⋆ . Let K L inf ( P ) = inf { K L ( P ∥ Q ) : E Q Z ≤ 0 } \mathrm{KL}_{\inf}(P) = \inf\{\mathrm{KL}(P\Vert Q) : \mathbb{E}_Q Z \le0\} KL i n f ( P ) = inf { KL ( P ∥ Q ) : E Q Z ≤ 0 } over laws Q Q Q on [ − 1 , M ] [-1,M] [ − 1 , M ] .
Lemma 16 (Growth equals information). (The dual form of K L inf \mathrm{KL}_{\inf} KL i n f is due to Honda and Takemura (2010); we include a short proof for bounded Z Z Z .) g ⋆ ( P ) = K L inf ( P ) g^\star(P) = \mathrm{KL}_{\inf}(P) g ⋆ ( P ) = KL i n f ( P ) , and g ⋆ > 0 g^\star> 0 g ⋆ > 0 iff μ > 0 \mu> 0 μ > 0 . If μ > 0 \mu> 0 μ > 0 , the infimum is attained by Q ⋆ ( d z ) = P ( d z ) / ( 1 + c ⋆ z ) + w δ − 1 ( d z ) Q^\star(dz) = P(dz)/(1 + c^\star z) + w\delta_{-1}(dz) Q ⋆ ( d z ) = P ( d z ) / ( 1 + c ⋆ z ) + w δ − 1 ( d z ) with $w = 1-\mathbb{E}_P[(1 + c^\star Z)^{-1}] \ge 0.
Proof. (≤ \le ≤ ). Let E Q Z ≤ 0 \mathbb{E}_Q Z \le0 E Q Z ≤ 0 and ℓ = d P / d Q \ell= dP/dQ ℓ = d P / d Q . For every c ∈ [ 0 , 1 ] c \in[0,1] c ∈ [ 0 , 1 ] , Jensen gives E P ln ( 1 + c Z ) ≤ ln E Q [ ( 1 + c Z ) 1 ℓ > 0 ] ≤ ln ( 1 + c E Q Z ) ≤ 0 \mathbb{E}_P \ln(1+cZ) \le\ln\mathbb{E}_Q[(1+cZ)\mathbf{1}_{\ell>0}] \le\ln(1+c\mathbb{E}_Q Z) \le0 E P ln ( 1 + c Z ) ≤ ln E Q [( 1 + c Z ) 1 ℓ > 0 ] ≤ ln ( 1 + c E Q Z ) ≤ 0 . (≥ \ge ≥ ). If μ ≤ 0 \mu\le0 μ ≤ 0 , both sides are 0. Otherwise c ⋆ > 0 c^\star> 0 c ⋆ > 0 . If c ⋆ < 1 c^\star< 1 c ⋆ < 1 , differentiation under the integral is legitimate because ∣ Z / ( 1 + c Z ) ∣ ≤ max ( 1 / c , 1 / ( 1 − c ) ) |Z/(1+cZ)| \le\max(1/c,1/(1-c)) ∣ Z / ( 1 + c Z ) ∣ ≤ max ( 1/ c , 1/ ( 1 − c )) . The first-order condition E P [ Z / ( 1 + c ⋆ Z ) ] = 0 \mathbb{E}_P[Z/(1+c^\star Z)] = 0 E P [ Z / ( 1 + c ⋆ Z )] = 0 then shows that w = 0 w = 0 w = 0 and that Q ⋆ Q^\star Q ⋆ has mass 1 and mean 0. If c ⋆ = 1 c^\star= 1 c ⋆ = 1 , then P ( { − 1 } ) = 0 P(\{-1\}) = 0 P ({ − 1 }) = 0 , and the left derivative E P [ Z / ( 1 + Z ) ] = w \mathbb{E}_P[Z/(1+Z)] = w E P [ Z / ( 1 + Z )] = w is ≥ 0 \ge0 ≥ 0 , so $Q^\star again has mass 1 and mean 0. In both cases KL ( P ∥ Q ∗ ) = E P ln ( 1 + c ∗ Z ) = g ∗ . \operatorname{KL}(P\Vert Q^*) = \mathbb{E}_P \ln(1+c^*Z)=g^*. KL ( P ∥ Q ∗ ) = E P ln ( 1 + c ∗ Z ) = g ∗ .
Since Q ∗ Q^* Q ∗ lives on supp P ∪ { − 1 } \operatorname{supp}P \cup\{-1\} supp P ∪ { − 1 } , in the paired Bernoulli model KL inf \operatorname{KL}_{\inf} KL i n f equals the information of the three-point model. Locally, KL inf = μ 2 2 σ 2 ( 1 + O ( μ ) ) \operatorname{KL}_{\inf}=\frac{\mu^2}{2\sigma^2}(1+O(\mu)) KL i n f = 2 σ 2 μ 2 ( 1 + O ( μ )) with σ 2 = Var ( Z ) \sigma^2=\operatorname{Var}(Z) σ 2 = Var ( Z ) .
Observation models. A lower bound on certification time depends on what the rule observes. Let U U U be an independent randomization of the rule, and let ξ 1 , ξ 2 , … \xi_1,\xi_2,\ldots ξ 1 , ξ 2 , … be i.i.d. uniform audit coins, independent of U U U and of all shadow outcomes.
(O1) Audited utilities only. After t t t shadow evaluations the rule’s records are R t = σ ( U , ( A s , A s Z s ) s ≤ t ) \mathcal{R}_t=\sigma(U,(A_s,A_sZ_s)_{s\le t}) R t = σ ( U , ( A s , A s Z s ) s ≤ t ) , and A t = 1 { ξ t ≤ p t } A_t=1\{\xi_t\le p_t\} A t = 1 { ξ t ≤ p t } , where p t p_t p t is a fixed (law-independent) function of the records R t − 1 \mathcal{R}_{t-1} R t − 1 . Unaudited shadow outputs, including whether the two answers agree, are neither used nor allowed to trigger audits.
(O2) Audited utilities and agreement. The records also contain the agreement indicators G s G_s G s , and A t = 1 { ξ t ≤ p t ( G t ) } A_t=1\{\xi_t\le p_t(G_t)\} A t = 1 { ξ t ≤ p t ( G t )} , where p t ( ⋅ ) p_t(\cdot) p t ( ⋅ ) is a fixed function of the records before t t t ; audits may thus depend on G t G_t G t but not on Z t Z_t Z t (Appendix C.1).
The IPW certificate (q ≡ 0 q\equiv0 q ≡ 0 ) with audits that do not depend on W t W_t W t is an (O1) rule. So is our restart-only certificate, which updates its wealth only on audited pairs.
Theorem 17 (Certification time and optimality). Let Z t Z_t Z t be i.i.d. P P P with μ > 0 \mu>0 μ > 0 . (a) Suppose audits are i.i.d. Bernoulli( p ) (p) ( p ) and independent of ( Z t ) (Z_t) ( Z t ) . Under the grid mixture, the label count N p N_p N p has the law of the full-information stopping time τ 1 \tau_1 τ 1 , E τ p = E τ 1 / p \mathbb{E}\tau_p=\mathbb{E}\tau_1/p E τ p = E τ 1 / p , and
E N p ≤ ln 1 δ + 2 ln ln 1 δ + O ( 1 ) KL inf ( P ) \mathbb{E}N_p\le\frac{\ln\frac{1}{\delta}+2\ln\ln\frac{1}{\delta}+O(1)}{\operatorname{KL}_{\inf}(P)} E N p ≤ KL i n f ( P ) ln δ 1 + 2 ln ln δ 1 + O ( 1 ) where O ( 1 ) O(1) O ( 1 ) depends only on c ∗ c^* c ∗ and M M M . (b) Consider a rule of type (O1) with p t ≤ p ˉ p_t\le\bar p p t ≤ p ˉ , folding at a stopping time τ \tau τ of ( R t ) (\mathcal{R}_t) ( R t ) . Let P Q ( τ < ∞ ) ≤ δ \mathbb{P}_Q(\tau<\infty)\le\delta P Q ( τ < ∞ ) ≤ δ for every i.i.d. law Q Q Q of ( Z t ) (Z_t) ( Z t ) on [ − 1 , M ] [-1,M] [ − 1 , M ] with E Q Z ≤ 0 \mathbb{E}_QZ\le0 E Q Z ≤ 0 , and let P P ( τ < ∞ ) = 1 \mathbb{P}_P(\tau<\infty)=1 P P ( τ < ∞ ) = 1 . Then
E P ∑ t ≤ τ A t ≥ ln ( 1 / δ ) KL inf ( P ) , \mathbb{E}_P\sum_{t\le\tau}A_t\ge\frac{\ln(1/\delta)}{\operatorname{KL}_{\inf}(P)}, E P t ≤ τ ∑ A t ≥ KL i n f ( P ) ln ( 1/ δ ) , E P τ ≥ ln ( 1 / δ ) p ˉ KL inf ( P ) . \mathbb{E}_P\tau\ge\frac{\ln(1/\delta)}{\bar p\operatorname{KL}_{\inf}(P)}. E P τ ≥ p ˉ KL i n f ( P ) ln ( 1/ δ ) . Hence, among (O1) rules, E τ p = ( 1 + o ( 1 ) ) ln ( 1 / δ ) / ( p KL inf ( P ) ) \mathbb{E}\tau_p=(1+o(1))\ln(1/\delta)/(p\operatorname{KL}_{\inf}(P)) E τ p = ( 1 + o ( 1 )) ln ( 1/ δ ) / ( p KL i n f ( P )) is optimal as δ → 0 \delta\to0 δ → 0 .
Here P P P is the law of the unweighted Z t Z_t Z t . The audit rate enters only through the factor 1 / p 1/p 1/ p (proof of (a)); expressing the rate through the law of the weighted increment and dividing by p p p again would count p p p twice. Part (b) does not extend beyond (O1): a rule that also sees whether the answers agree can be faster (Proposition 21 and Theorem 22 ).
Proof. (a) With λ ( j ) = p c j \lambda^{(j)}=pc_j λ ( j ) = p c j , the factor 1 + c j A t Z t 1+c_jA_tZ_t 1 + c j A t Z t equals 1 on unaudited steps. The wealth therefore moves only at audits, whose outcomes are i.i.d. P P P and independent of the Geometric( p ) (p) ( p ) gaps. So N p = d τ 1 N_p\mathrel{\stackrel{\mathrm{d}}{=}}\tau_1 N p = d τ 1 , and Wald’s identity gives E τ p = E N p / p \mathbb{E}\tau_p=\mathbb{E}N_p/p E τ p = E N p / p . Pick j ∗ j^* j ∗ with c j ∗ ∈ [ c ∗ / ( 1 + ε ) , c ∗ ] c_{j^*}\in[c^*/(1+\varepsilon),c^*] c j ∗ ∈ [ c ∗ / ( 1 + ε ) , c ∗ ] . By concavity, g ( c j ∗ ) ≥ g ∗ / ( 1 + ε ) g(c_{j^*})\ge g^*/(1+\varepsilon) g ( c j ∗ ) ≥ g ∗ / ( 1 + ε ) . Since K n ≥ w j ∗ ∏ t ≤ n ( 1 + c j ∗ Z t ) K_n\ge w_{j^*}\prod_{t\le n}(1+c_{j^*}Z_t) K n ≥ w j ∗ ∏ t ≤ n ( 1 + c j ∗ Z t ) , Wald’s identity with overshoot ≤ ln ( 1 + M ) \le\ln(1+M) ≤ ln ( 1 + M ) gives
E τ 1 ≤ 1 + ε g ∗ [ ln 1 δ + ln ( j ∗ ( j ∗ + 1 ) ) + ln ( 1 + M ) ] . \mathbb{E}\tau_1\le\frac{1+\varepsilon}{g^*}\left[\ln\frac{1}{\delta}+\ln\bigl(j^*(j^*+1)\bigr)+\ln(1+M)\right]. E τ 1 ≤ g ∗ 1 + ε [ ln δ 1 + ln ( j ∗ ( j ∗ + 1 ) ) + ln ( 1 + M ) ] .
Finally, j ∗ ≤ 1 + 2 ln ( 1 / c ∗ ) ln ( 1 / δ ) j^*\le1+2\ln(1/c^*)\ln(1/\delta) j ∗ ≤ 1 + 2 ln ( 1/ c ∗ ) ln ( 1/ δ ) .
(b) Take Q ∗ Q^* Q ∗ from Lemma 16, so that d P / d Q ∗ = 1 + c ∗ z dP/dQ^*=1+c^*z d P / d Q ∗ = 1 + c ∗ z on supp P \operatorname{supp}P supp P , and put ℓ = ln ( 1 + c ∗ Z ) \ell=\ln(1+c^*Z) ℓ = ln ( 1 + c ∗ Z ) . Under an i.i.d. law Q Q Q of ( Z t ) (Z_t) ( Z t ) the records R n \mathcal{R}_n R n have, with respect to the law of U U U times a fixed dominating measure, the density ∏ t ≤ n p t A t ( 1 − p t ) 1 − A t q ( Z t ) A t \prod_{t\le n}p_t^{A_t}(1-p_t)^{1-A_t}q(Z_t)^{A_t} ∏ t ≤ n p t A t ( 1 − p t ) 1 − A t q ( Z t ) A t , where q q q is the density of Q Q Q . Under (O1) the audit factors are the same functions of the records under P P P and Q ∗ Q^* Q ∗ , because the coins ξ t \xi_t ξ t and the map R t − 1 ↦ p t \mathcal{R}_{t-1}\mapsto p_t R t − 1 ↦ p t do not depend on the law; they cancel. The likelihood ratio of R n \mathcal{R}_n R n is therefore exp ∑ t ≤ n A t ℓ ( Z t ) \exp\sum_{t\le n}A_t\ell(Z_t) exp ∑ t ≤ n A t ℓ ( Z t ) . (This is the step that fails outside (O1): if the records contain W t W_t W t , or audits depend on W t W_t W t , the ratio also contains the likelihood ratio of W t W_t W t , whose law may differ between P P P and every null.) Since Z t Z_t Z t and ξ t \xi_t ξ t are independent of R t − 1 \mathcal{R}_{t-1} R t − 1 and of each other, E P [ A t ℓ ( Z t ) ∣ R t − 1 ] = p t g ∗ \mathbb{E}_P[A_t\ell(Z_t)\mid\mathcal{R}_{t-1}]=p_tg^* E P [ A t ℓ ( Z t ) ∣ R t − 1 ] = p t g ∗ . By optional stopping at τ ∧ n \tau\wedge n τ ∧ n , the KL divergence between the laws of the records up to τ ∧ n \tau\wedge n τ ∧ n is g ∗ E P ∑ t ≤ τ ∧ n A t g^*\mathbb{E}_P\sum_{t\le\tau\wedge n}A_t g ∗ E P ∑ t ≤ τ ∧ n A t . Data processing on { τ ≤ n } \{\tau\le n\} { τ ≤ n } , whose Q ∗ Q^* Q ∗ -probability is ≤ δ \le\delta ≤ δ , together with kl ( x , y ) ≥ x ln ( 1 / y ) − h ( x ) \operatorname{kl}(x,y)\ge x\ln(1/y)-h(x) kl ( x , y ) ≥ x ln ( 1/ y ) − h ( x ) , bounds this below by x n ln ( 1 / δ ) − h ( x n ) x_n\ln(1/\delta)-h(x_n) x n ln ( 1/ δ ) − h ( x n ) , where x n = P P ( τ ≤ n ) → 1 x_n=\mathbb{P}_P(\tau\le n)\to1 x n = P P ( τ ≤ n ) → 1 . Now let n → ∞ n\to\infty n → ∞ ((Kaufmann et al., 2016; Garivier and Kaufmann, 2016)). Finally, E P ∑ t ≤ τ A t = E P ∑ t ≤ τ p t ≤ p ˉ E P τ \mathbb{E}_P\sum_{t\le\tau}A_t=\mathbb{E}_P\sum_{t\le\tau}p_t\le\bar p\mathbb{E}_P\tau E P ∑ t ≤ τ A t = E P ∑ t ≤ τ p t ≤ p ˉ E P τ .
Why the plug-in reliability test fails. The SPRT is a Kelly bet: e Λ n = ∏ k ≤ n ( 1 + b ( Y k − r 0 ) ) e^{\Lambda_n}=\prod_{k\le n}(1+b(Y_k-r_0)) e Λ n = ∏ k ≤ n ( 1 + b ( Y k − r 0 )) with b = r − r 0 r 0 ( 1 − r 0 ) b=\frac{r-r_0}{r_0(1-r_0)} b = r 0 ( 1 − r 0 ) r − r 0 . With r 0 = r ∗ r_0=r^* r 0 = r ∗ it is the betting test on ( Y M − r ∗ ) / r ∗ (Y^M-r^*)/r^* ( Y M − r ∗ ) / r ∗ , and it is valid only if a a a is known.
Proposition 18 (Plug-in tests are not level δ \delta δ ; re-states Proposition 5 ). Let a ^ = k / n a \hat{a}=k/n_a a ^ = k / n a with k ∼ Bin ( n a , a ) k\sim\operatorname{Bin}(n_a,a) k ∼ Bin ( n a , a ) , estimated from independent live runs. Run the one-sided SPRT of Section 4 with r 0 = a ^ − η r_0=\hat{a}-\eta r 0 = a ^ − η and r 1 = a ^ r_1=\hat{a} r 1 = a ^ on i.i.d. macro outcomes at the break-even r = r ⋆ r=r^\star r = r ⋆ . Let E = { η < a ^ < 1 } E=\{\eta<\hat{a}<1\} E = { η < a ^ < 1 } and
r m i d = ln 1 − r 0 1 − r 1 ln r 1 ( 1 − r 0 ) r 0 ( 1 − r 1 ) ∈ ( r 0 , r 1 ) . r_{\mathrm{mid}}=\frac{\ln\frac{1-r_0}{1-r_1}}{\ln\frac{r_1(1-r_0)}{r_0(1-r_1)}}\in(r_0,r_1). r mid = ln r 0 ( 1 − r 1 ) r 1 ( 1 − r 0 ) ln 1 − r 1 1 − r 0 ∈ ( r 0 , r 1 ) . Then:
(i) P ( fold ) ≥ P ( E , r m i d < r ⋆ ) ≥ P ( η < a ^ ≤ r ⋆ ) \mathbb{P}(\operatorname{fold})\ge\mathbb{P}(E,r_{\mathrm{mid}}<r^\star)\ge\mathbb{P}(\eta<\hat{a}\le r^\star) P ( fold ) ≥ P ( E , r mid < r ⋆ ) ≥ P ( η < a ^ ≤ r ⋆ ) ;
(ii) P ( fold ) ≥ E [ 1 E 1 { r 0 < r ⋆ } ( δ r 0 r 1 ) θ ] \mathbb{P}(\operatorname{fold})\ge\mathbb{E}\left[1_E1_{\{r_0<r^\star\}}\left(\frac{\delta r_0}{r_1}\right)^\theta\right] P ( fold ) ≥ E [ 1 E 1 { r 0 < r ⋆ } ( r 1 δ r 0 ) θ ] .
In (ii), θ = 0 \theta=0 θ = 0 if r ⋆ ≥ r m i d r^\star\ge r_{\mathrm{mid}} r ⋆ ≥ r mid . Otherwise θ ∈ ( 0 , 1 ) \theta\in(0,1) θ ∈ ( 0 , 1 ) solves
r ⋆ ( r 1 r 0 ) θ + ( 1 − r ⋆ ) ( 1 − r 1 1 − r 0 ) θ = 1. r^\star\left(\frac{r_1}{r_0}\right)^\theta+(1-r^\star)\left(\frac{1-r_1}{1-r_0}\right)^\theta=1. r ⋆ ( r 0 r 1 ) θ + ( 1 − r ⋆ ) ( 1 − r 0 1 − r 1 ) θ = 1. For large n a n_a n a , the middle term of (i) is ≈ Φ ( − 1 2 n a a ( 1 − a ) ) \approx\Phi\left(-\frac{1}{2}\sqrt{\frac{n_a}{a(1-a)}}\right) ≈ Φ ( − 2 1 a ( 1 − a ) n a ) .
Proof. Condition on a ^ ∈ E \hat{a}\in E a ^ ∈ E . The increments X k X_k X k of Λ \Lambda Λ are i.i.d. with mean KL ( r ⋆ ∥ r 0 ) − KL ( r ⋆ ∥ r 1 ) \operatorname{KL}(r^\star\mathbin\Vert r_0)-\operatorname{KL}(r^\star\mathbin\Vert r_1) KL ( r ⋆ ∥ r 0 ) − KL ( r ⋆ ∥ r 1 ) . This mean is affine in r ⋆ r^\star r ⋆ and vanishes at r m i d r_{\mathrm{mid}} r mid . If r ⋆ ≥ r m i d r^\star\ge r_{\mathrm{mid}} r ⋆ ≥ r mid , the drift is nonnegative and the steps are non-degenerate, so lim sup Λ n = ∞ \limsup\Lambda_n=\infty lim sup Λ n = ∞ and the test folds a.s. On E E E , a ^ ≤ r ⋆ \hat{a}\le r^\star a ^ ≤ r ⋆ implies r m i d < r 1 ≤ r ⋆ r_{\mathrm{mid}}<r_1\le r^\star r mid < r 1 ≤ r ⋆ , which proves (i). For (ii), let r 0 < r ⋆ < r m i d r_0<r^\star<r_{\mathrm{mid}} r 0 < r ⋆ < r mid . The map θ ↦ E e θ X \theta\mapsto\mathbb{E}e^{\theta X} θ ↦ E e θ X is strictly convex. It equals 1 at 0 with negative slope and equals 1 + b ( r ⋆ − r 0 ) > 1 1+b(r^\star-r_0)>1 1 + b ( r ⋆ − r 0 ) > 1 at 1, so the root θ \theta θ exists and e θ Λ n e^{\theta\Lambda_n} e θ Λ n is a martingale. At the fold time σ \sigma σ , Λ σ ≤ ln 1 δ + ln r 1 r 0 \Lambda_\sigma\le\ln\frac{1}{\delta}+\ln\frac{r_1}{r_0} Λ σ ≤ ln δ 1 + ln r 0 r 1 ; on { σ = ∞ } \{\sigma=\infty\} { σ = ∞ } , Λ n → − ∞ \Lambda_n\to-\infty Λ n → − ∞ . Bounded convergence therefore gives
1 = E [ e θ Λ σ ; σ < ∞ ] ≤ ( r 1 δ r 0 ) θ P ( σ < ∞ ∣ a ^ ) . 1=\mathbb{E}[e^{\theta\Lambda_\sigma};\sigma<\infty]\le\left(\frac{r_1}{\delta r_0}\right)^\theta\mathbb{P}(\sigma<\infty\mid\hat{a}). 1 = E [ e θ Λ σ ; σ < ∞ ] ≤ ( δ r 0 r 1 ) θ P ( σ < ∞ ∣ a ^ ) .
Table 4 shows that the excess over δ \delta δ persists long after the middle term of (i) drops below δ \delta δ . At n a = 1000 n_a=1000 n a = 1000 and δ = 0.01 \delta=0.01 δ = 0.01 , bound (ii) gives 0.035 and the exact value is 0.034. Macros slightly below break-even behave similarly. At shortfall 0.04 with n a ≤ 20 n_a\le20 n a ≤ 20 live labels, the rate is 0.1–0.4 across a ∈ [ 0.5 , 0.9 ] a\in[0.5,0.9] a ∈ [ 0.5 , 0.9 ] and η ∈ [ 0.05 , 0.2 ] \eta\in[0.05,0.2] η ∈ [ 0.05 , 0.2 ] . On the full KQA-STREAM tables (Qwen3-8B, 30 streams) both certificates stay far below δ \delta δ on below-break-even candidates. The plug-in SPRT folds 0.32% of them (477 of 147,349 encounters) and the betting test 0.017% (33 of 190,187), while counter rules fold all of them. The failure of the plug-in test is a boundary phenomenon: it needs candidates just below break-even and live accuracy estimated from few labels. Most spurious candidates in our streams are far below break-even: the ones that counters fold fall short by a median of 0.68.
Table 4. Exact false-fold probability of the plug-in SPRT for a macro at break-even, computed by dynamic programming (a = 0.9 a=0.9 a = 0.9 , ( m − 1 ) / L = 0.05 (m-1)/L=0.05 ( m − 1 ) / L = 0.05 , horizon 2000 uses).
Pairing. Write P 1 ≤ c x P 2 P_1\le_{\mathrm{cx}}P_2 P 1 ≤ cx P 2 if E ϕ ( Z 1 ) ≤ E ϕ ( Z 2 ) \mathbb{E}\phi(Z_1)\le\mathbb{E}\phi(Z_2) E ϕ ( Z 1 ) ≤ E ϕ ( Z 2 ) for all convex ϕ \phi ϕ .
Theorem 19 (Pairing gain). If P 1 ≤ c x P 2 P_1\le_{\mathrm{cx}}P_2 P 1 ≤ cx P 2 on [ − 1 , M ] [-1,M] [ − 1 , M ] , then KL inf ( P 1 ) ≥ KL inf ( P 2 ) \operatorname{KL}_{\inf}(P_1)\ge\operatorname{KL}_{\inf}(P_2) KL i n f ( P 1 ) ≥ KL i n f ( P 2 ) , strictly if P 1 ≠ P 2 P_1\ne P_2 P 1 = P 2 and μ > 0 \mu>0 μ > 0 . Now take the paired Bernoulli model with marginals ( a , r ) (a,r) ( a , r ) fixed and r > r ⋆ r>r^\star r > r ⋆ . Then KL inf \operatorname{KL}_{\inf} KL i n f is strictly increasing in γ = Cov ( Y L , Y M ) \gamma=\operatorname{Cov}(Y^L,Y^M) γ = Cov ( Y L , Y M ) . Pairing therefore certifies faster than an unpaired design (live outcome from an independent instance) iff γ > 0 \gamma>0 γ > 0 , that is, when live and macro fail on the same instances.
Proof. For c < 1 c<1 c < 1 , z ↦ ln ( 1 + c z ) z\mapsto\ln(1+cz) z ↦ ln ( 1 + cz ) is concave and bounded, so g P 1 ( c ) ≥ g P 2 ( c ) g_{P_1}(c)\ge g_{P_2}(c) g P 1 ( c ) ≥ g P 2 ( c ) . Let c ↑ 1 c\uparrow1 c ↑ 1 and maximize. For strictness, Strassen’s theorem gives a coupling Z 2 = Z 1 + ξ Z_2=Z_1+\xi Z 2 = Z 1 + ξ with E [ ξ ∣ Z 1 ] = 0 \mathbb{E}[\xi\mid Z_1]=0 E [ ξ ∣ Z 1 ] = 0 and ξ ≠ 0 \xi\ne0 ξ = 0 with positive probability. At c = c ⋆ ( P 2 ) c=c^\star(P_2) c = c ⋆ ( P 2 ) the map ln ( 1 + c z ) \ln(1+cz) ln ( 1 + cz ) is strictly concave where finite, so conditional Jensen is strict. Raising γ \gamma γ by Δ \Delta Δ moves mass Δ \Delta Δ from each of D = ± 1 D=\pm1 D = ± 1 to D = 0 D=0 D = 0 . This changes E ϕ ( D ) \mathbb{E}\phi(D) E ϕ ( D ) by − Δ [ ϕ ( 1 ) + ϕ ( − 1 ) − 2 ϕ ( 0 ) ] ≤ 0 -\Delta[\phi(1)+\phi(-1)-2\phi(0)]\le0 − Δ [ ϕ ( 1 ) + ϕ ( − 1 ) − 2 ϕ ( 0 )] ≤ 0 for convex ϕ \phi ϕ , and Z Z Z is affine in D D D .
At a = r = 0.9 a=r=0.9 a = r = 0.9 and η = 0.05 \eta=0.05 η = 0.05 , pairing raises KL inf \operatorname{KL}_{\inf} KL i n f by 1.85× \times × at correlation 0.5 and by 7.56× \times × at correlation 1. Near break-even, it beats even the SPRT that knows a a a if the correlation exceeds
a ( 1 − a ) 2 r ⋆ ( 1 − r ⋆ ) , \sqrt{\frac{a(1-a)}{2\sqrt{r^\star(1-r^\star)}}}, 2 r ⋆ ( 1 − r ⋆ ) a ( 1 − a ) ,
which is 0.42 here.
The scaling law with KL inf \operatorname{KL}_{\inf} KL i n f .
Corollary 20 (Coverage gap with KL inf \operatorname{KL}_{\inf} KL i n f ). Assume (A1)–(A3) and (A5) of Appendix B, and replace (A4) by: in every epoch the normalized paired utilities Z t = U t / B Z_t=U_t/B Z t = U t / B of the audited shadow evaluations are i.i.d. from a finitely supported law P Z P_Z P Z on [ − 1 , M ] [-1,M] [ − 1 , M ] with positive mean, whichever candidate they evaluate, and independent of G \mathcal{G} G . Let
Θ U : = ν ln ( 1 / δ ) p KL inf ( P Z ) . \Theta_U:=\frac{\nu\ln(1/\delta)}{p\operatorname{KL}_{\inf}(P_Z)}. Θ U := p KL i n f ( P Z ) ν ln ( 1/ δ ) . (i) Every policy of type (O1) that is δ \delta δ -safe in the sense of Definition 1, with “bad” meaning
E Z ≤ 0 \mathbb{E}Z \le0 E Z ≤ 0 , has lim inf M ≥ ( 1 − ε δ ) F π ( Θ U ) \liminf M \ge(1-\varepsilon_\delta)F_\pi(\Theta_U) lim inf M ≥ ( 1 − ε δ ) F π ( Θ U ) almost surely, with ε δ = O ( ln ln ( 1 / δ ) / ln ( 1 / δ ) ) \varepsilon_\delta= O\left(\sqrt{\ln\ln(1/\delta)}/\ln(1/\delta)\right) ε δ = O ( ln ln ( 1/ δ ) / ln ( 1/ δ ) ) depending only on ( δ , P Z ) (\delta,P_Z) ( δ , P Z ) . (ii) With unannounced changes, the grid-mixture betting test of Theorem 17 (a), restarted at each change with all earlier evidence discarded, is δ \delta δ -safe and has M ≤ ( 1 + ( 2 ln ln 1 δ + O ( 1 ) ) / ln 1 δ ) F π ( Θ U ) M \le\left(1+(2\ln\ln\frac{1}{\delta}+O(1))/\ln\frac{1}{\delta}\right)F_\pi(\Theta_U) M ≤ ( 1 + ( 2 ln ln δ 1 + O ( 1 )) / ln δ 1 ) F π ( Θ U ) . Thus Theorem 3 holds with KL inf ( P Z ) \operatorname{KL}_{\inf}(P_Z) KL i n f ( P Z ) in place of KL ( r 1 ∥ r 0 ) \operatorname{KL}(r_1\Vert r_0) KL ( r 1 ∥ r 0 ) , and the live accuracy a a a need not be known.
Proof. (i) Repeat the converse proof of Theorem 3 with three substitutions. The null environment. Let Q ∗ Q^* Q ∗ be the least-favorable null of Lemma 16; it has mean 0 0 0 , so in the environment where the epoch’s audited utilities are i.i.d. Q ∗ Q^* Q ∗ every candidate is bad, and δ \delta δ -safety bounds the probability of a fold event in the epoch by δ \delta δ given H e \mathcal{H}_e H e . The likelihood ratio. By Lemma 16, d P Z / d Q ∗ = 1 + c ∗ z > 0 \mathrm{d}P_Z/\mathrm{d}Q^* = 1+c^*z>0 d P Z / d Q ∗ = 1 + c ∗ z > 0 on supp P Z \operatorname{supp}P_Z supp P Z , so P Z ≪ Q ∗ P_Z\ll Q^* P Z ≪ Q ∗ . Under (O1) the records add to the audited utilities only the audit coins and the internal randomization, whose laws do not depend on the environment, exactly as in the proof of Theorem 17 (b). Hence d P P Z / d P Q ∗ \mathrm{d}P_{P_Z}/\mathrm{d}P_{Q^*} d P P Z / d P Q ∗ restricted to F m \mathcal{F}_m F m is e W m e^{W_m} e W m with W m = ∑ k ≤ m ℓ ( Z k ) W_m=\sum_{k\le m}\ell(Z_k) W m = ∑ k ≤ m ℓ ( Z k ) and ℓ ( z ) = ln ( 1 + c ∗ z ) \ell(z)=\ln(1+c^*z) ℓ ( z ) = ln ( 1 + c ∗ z ) , whichever candidates the policy forms or audits. Wald’s likelihood-ratio identity then gives the low-evidence bound E P Z [ R ; W N ≤ c , N < ∞ ] ≤ e c E Q ∗ [ R ] \mathbb{E}_{P_Z}[R;W_N\le c,N<\infty]\le e^c\mathbb{E}_{Q^*}[R] E P Z [ R ; W N ≤ c , N < ∞ ] ≤ e c E Q ∗ [ R ] as before.
The drift. Under P Z P_Z P Z the increments ℓ ( Z k ) \ell(Z_k) ℓ ( Z k ) are i.i.d., bounded (the support is finite and 1 + c ∗ z > 0 1+c^*z>0 1 + c ∗ z > 0 on it) and have mean g ∗ = KL inf ( P Z ) g^*=\operatorname{KL}_{\inf}(P_Z) g ∗ = KL i n f ( P Z ) . With n ∗ = ln ( 1 / δ ) / KL inf ( P Z ) n^*=\ln(1/\delta)/\operatorname{KL}_{\inf}(P_Z) n ∗ = ln ( 1/ δ ) / KL i n f ( P Z ) , n − 1 = ⌊ ( 1 − ε ) n ∗ ⌋ n-1=\lfloor(1-\varepsilon)n^*\rfloor n − 1 = ⌊( 1 − ε ) n ∗ ⌋ and c = ( 1 − ε / 2 ) ln ( 1 / δ ) c=(1-\varepsilon/2)\ln(1/\delta) c = ( 1 − ε /2 ) ln ( 1/ δ ) , Azuma’s maximal inequality gives β n − 1 ( c ) → 0 \beta_{n-1}(c)\to0 β n − 1 ( c ) → 0 , and the rest of the proof (one epoch, many epochs, choice of n n n and c c c ) applies verbatim with Θ \Theta Θ replaced by Θ U \Theta_U Θ U . (ii) After each change the test restarts from wealth 1 1 1 on the epoch’s own evidence, so Theorem 15 and Ville’s inequality bound the probability of a fold of a null candidate in the epoch by δ \delta δ , which is Definition 1. The wealth moves only at audits (Theorem 17 (a)), so the test folds at the N e N_e N e -th audited outcome of epoch e e e , where the N e N_e N e are i.i.d., independent of arrivals, audits and changes, and have the law of N p N_p N p in Theorem 17 (a). Lemma 10 gives u i = 1 − E ρ i u_i=1-\mathbb{E}\rho_i u i = 1 − E ρ i , and Lemma 12 gives u i ≤ 1 − ρ i ≤ 1 − e − x E N / π i u_i\le1-\rho_i\le1-e^{-xEN/\pi_i} u i ≤ 1 − ρ i ≤ 1 − e − x E N / π i with x = ν / p x=\nu/p x = ν / p . By Theorem 17 (a), x E N ≤ ( 1 + η δ ) Θ U xEN\le(1+\eta_\delta)\Theta_U x E N ≤ ( 1 + η δ ) Θ U with η δ = ( 2 ln ln 1 δ + O ( 1 ) ) / ln 1 δ \eta_\delta=(2\ln\ln\frac{1}{\delta}+O(1))/\ln\frac{1}{\delta} η δ = ( 2 ln ln δ 1 + O ( 1 )) / ln δ 1 . Since F π F_\pi F π is concave and nondecreasing with F π ( 0 ) = 0 F_\pi(0)=0 F π ( 0 ) = 0 , F π ( ( 1 + η ) Θ U ) ≤ ( 1 + η ) F π ( Θ U ) F_\pi((1+\eta)\Theta_U)\le(1+\eta)F_\pi(\Theta_U) F π (( 1 + η ) Θ U ) ≤ ( 1 + η ) F π ( Θ U ) ; summing π i u i \pi_i u_i π i u i gives the bound. □
Pairing, disagreement-triggered audits and cost-aware utilities thus all act through one constant, KL inf ( P Z ) \operatorname{KL}_{\inf}(P_Z) KL i n f ( P Z ) , in the certification load. Under Zipf demand, a pairing gain ρ g = KL inf p a i r / KL inf \rho_g=\operatorname{KL}_{\inf}^{\mathrm{pair}}/\operatorname{KL}_{\inf} ρ g = KL i n f pair / KL i n f lowers the coverage gap by the factor ρ g 1 − 1 / s \rho_g^{1-1/s} ρ g 1 − 1/ s .
Agreement-aware certification
Shadow mode runs both paths, so the system sees both answers before any audit. When the answers agree, their correctness labels agree, provided scoring depends on the answer alone:
(E) Exact-match scoring. There are G t ∈ { 0 , 1 } G_t\in\{0,1\} G t ∈ { 0 , 1 } and z 0 , t z_{0,t} z 0 , t , observed before the audit decision (functions of W t W_t W t ), such that G t = 1 G_t=1 G t = 1 implies Z t = z 0 , t Z_t=z_{0,t} Z t = z 0 , t .
(E) holds if correctness is a deterministic function of the instance and the final answer, Y = ϕ t ( answer ) Y=\phi_t(\text{answer}) Y = ϕ t ( answer ) (exact match to a gold answer, or execution against fixed tests), if G t = 1 G_t=1 G t = 1 exactly when the two final answers are identical as inputs to ϕ t \phi_t ϕ t , and if both costs are observed; then G t = 1 G_t=1 G t = 1 forces Y t M = Y t L Y_t^M=Y_t^L Y t M = Y t L , and z 0 , t = ( C t L − C t M ) / B z_{0,t}=(C_t^L-C_t^M)/B z 0 , t = ( C t L − C t M ) / B . It fails for stochastic or rubric-based judges, for judges that read more than the final answer, and whenever a path’s score depends on anything other than its answer. KQA-STREAM is such a case: a macro answer counts as correct only if the query was also routed to the right template, so on a misrouted query whose macro answer equals a correct live answer, G t = 1 G_t=1 G t = 1 but Y t M = 0 ≠ Y t L = 1 Y_t^M=0\ne Y_t^L=1 Y t M = 0 = Y t L = 1 . The certificates of this subsection are therefore not valid for the KQA-STREAM labels as defined; they are valid for a variant that scores a macro by its answer alone.
Proposition 21 (Agreement breaks the (O1) bound). Assume (E) in the paired model with constant costs, so z 0 = η / ( 1 − η ) z_0=\eta/(1-\eta) z 0 = η / ( 1 − η ) . Let V t = z 0 V_t=z_0 V t = z 0 if G t = 1 G_t=1 G t = 1 and V t = − 1 V_t=-1 V t = − 1 otherwise. For every λ ∈ [ 0 , 1 ] \lambda\in[0,1] λ ∈ [ 0 , 1 ] , ∏ s ≤ t ( 1 + λ V s ) \prod_{s\le t}(1+\lambda V_s) ∏ s ≤ t ( 1 + λ V s ) is a test supermartingale under H 0 H_0 H 0 , for any audit mechanism. If G t G_t G t is i.i.d. with P ( G t = 1 ) = g \mathbb{P}(G_t=1)=g P ( G t = 1 ) = g , the best constant bet grows the log-wealth by kl ( g ∥ 1 1 + z 0 ) \operatorname{kl}\left(g\middle\Vert\frac{1}{1+z_0}\right) kl ( g 1 + z 0 1 ) per shadow run if g > 1 1 + z 0 g>\frac{1}{1+z_0} g > 1 + z 0 1 , and by 0 0 0 otherwise. If g = 1 g=1 g = 1 , the bet λ = 1 \lambda=1 λ = 1 folds after ⌈ ln ( 1 / δ ) / ln ( 1 + z 0 ) ⌉ \lceil\ln(1/\delta)/\ln(1+z_0)\rceil ⌈ ln ( 1/ δ ) / ln ( 1 + z 0 )⌉ shadow runs and uses no labels, whereas every (O1) rule needs E P T ≥ ln ( 1 / δ ) / ( p ln ( 1 + z 0 ) ) \mathbb{E}P_T\ge\ln(1/\delta)/(p\ln(1+z_0)) E P T ≥ ln ( 1/ δ ) / ( p ln ( 1 + z 0 )) .
Proof. By (E), V t = Z t V_t=Z_t V t = Z t if G t = 1 G_t=1 G t = 1 , and V t = − 1 ≤ Z t V_t=-1\le Z_t V t = − 1 ≤ Z t otherwise. So V t ≤ Z t V_t\le Z_t V t ≤ Z t pointwise, and E [ V t ∣ F t − 1 ] ≤ E [ Z t ∣ F t − 1 ] ≤ 0 \mathbb{E}[V_t\mid\mathcal{F}_{t-1}]\le\mathbb{E}[Z_t\mid\mathcal{F}_{t-1}]\le0 E [ V t ∣ F t − 1 ] ≤ E [ Z t ∣ F t − 1 ] ≤ 0 whatever the
audits do. The factors satisfy 1 + λ V t ≥ 1 − λ ≥ 0 1+\lambda V_t \ge1-\lambda\ge0 1 + λ V t ≥ 1 − λ ≥ 0 , and V t V_t V t is observed without a label. For i.i.d. G t G_t G t , V t V_t V t has the two-point law g δ z 0 + ( 1 − g ) δ − 1 g\delta_{z_0}+(1-g)\delta_{-1} g δ z 0 + ( 1 − g ) δ − 1 . By Lemma 16 the best constant bet grows at rate KL inf \operatorname{KL}_{\inf} KL i n f of this law, and its least-favorable null lives on { z 0 , − 1 } \{z_0,-1\} { z 0 , − 1 } . A null law q δ z 0 + ( 1 − q ) δ − 1 q\delta_{z_0}+(1-q)\delta_{-1} q δ z 0 + ( 1 − q ) δ − 1 has mean q z 0 − ( 1 − q ) ≤ 0 qz_0-(1-q)\le0 q z 0 − ( 1 − q ) ≤ 0 iff q ≤ 1 / ( 1 + z 0 ) q\le1/(1+z_0) q ≤ 1/ ( 1 + z 0 ) , and kl ( g ∥ q ) \operatorname{kl}(g\mathbin{\|}q) kl ( g ∥ q ) decreases in q q q on [ 0 , g ] [0,g] [ 0 , g ] , which gives the rate. If g = 1 g=1 g = 1 , the wealth is ( 1 + z 0 ) n (1+z_0)^n ( 1 + z 0 ) n . For (O1) rules, P Z = δ z 0 P_Z=\delta_{z_0} P Z = δ z 0 and KL inf ( δ z 0 ) = ln ( 1 + z 0 ) \operatorname{KL}_{\inf}(\delta_{z_0})=\ln(1+z_0) KL i n f ( δ z 0 ) = ln ( 1 + z 0 ) , so Theorem 17 (b) applies.
At η = δ = 0.05 \eta=\delta=0.05 η = δ = 0.05 and p = 0.1 p=0.1 p = 0.1 the agreement bet folds after 59 shadow runs, while (O1) rules need at least 584 (the grid-mixture IPW certificate needs 910). Under the least-favorable null q = 1 / ( 1 + z 0 ) q=1/(1+z_0) q = 1/ ( 1 + z 0 ) with Z = − 1 Z=-1 Z = − 1 on disagreement, the bet λ = 1 \lambda=1 λ = 1 folds with probability q 59 = 0.048 ≤ δ q^{59}=0.048\le\delta q 59 = 0.048 ≤ δ . The rule is powerless unless agreement is nearly certain (g > 0.95 g>0.95 g > 0.95 here), because an unaudited disagreement is charged the worst case − 1 -1 − 1 . The certificate below also bets on audited disagreements, with inverse-propensity weights.
The agreement-aware certificate. Assume (E), (A1), (A2), and p t ≥ π t > 0 p_t\ge\pi_t>0 p t ≥ π t > 0 on { G t = 0 } \{G_t=0\} { G t = 0 } (agreements need no audits). Let
C t = { ( λ , u ) : λ ≥ 0 , u ≥ − 1 , λ + u ≤ π t ( 1 + u ) } . C_t=\{(\lambda,u):\lambda\ge0,\ u\ge-1,\ \lambda+u\le\pi_t(1+u)\}. C t = {( λ , u ) : λ ≥ 0 , u ≥ − 1 , λ + u ≤ π t ( 1 + u )} .
For F t − 1 \mathcal{F}_{t-1} F t − 1 -measurable ( λ t , u t ) ∈ C t (\lambda_t,u_t)\in C_t ( λ t , u t ) ∈ C t , the agreement-aware factor is
F t = { 1 + λ t z 0 , t , G t = 1 , 1 + u t + A t ( λ t Z t − u t ) / p t , G t = 0. F_t=
\begin{cases}
1+\lambda_t z_{0,t}, & G_t=1,\\
1+u_t+A_t(\lambda_t Z_t-u_t)/p_t, & G_t=0.
\end{cases} F t = { 1 + λ t z 0 , t , 1 + u t + A t ( λ t Z t − u t ) / p t , G t = 1 , G t = 0.
Equivalently, F t = 1 + λ t X t F_t=1+\lambda_t X_t F t = 1 + λ t X t with X t = z 0 , t X_t=z_{0,t} X t = z 0 , t on agreement and X t = v t + A t ( Z t − v t ) / p t X_t=v_t+A_t(Z_t-v_t)/p_t X t = v t + A t ( Z t − v t ) / p t on disagreement, where v t = u t / λ t v_t=u_t/\lambda_t v t = u t / λ t (for λ t > 0 \lambda_t>0 λ t > 0 ): an inverse-propensity estimator whose surrogate is exact on agreement and the constant v t v_t v t on disagreement. The conservative increment
X t 0 = A t Z t + ( 1 − A t ) [ G t z 0 , t − ( 1 − G t ) ] X_t^0=A_tZ_t+(1-A_t)[G_tz_{0,t}-(1-G_t)] X t 0 = A t Z t + ( 1 − A t ) [ G t z 0 , t − ( 1 − G t )]
(audited: Z t Z_t Z t ; unaudited agreement: z 0 , t z_{0,t} z 0 , t ; unaudited disagreement: − 1 -1 − 1 , or any known lower bound on Z t Z_t Z t ) is bet on with λ ∈ [ 0 , 1 ] \lambda\in[0,1] λ ∈ [ 0 , 1 ] and no weights. As before, K n = ∑ k w k ∏ t ≤ n F t ( k ) K_n=\sum_k w_k\prod_{t\le n}F_t^{(k)} K n = ∑ k w k ∏ t ≤ n F t ( k ) with ∑ k w k ≤ 1 \sum_k w_k\le1 ∑ k w k ≤ 1 , and the certificate folds when K n ≥ 1 / δ K_n\ge1/\delta K n ≥ 1/ δ .
For the rate, take the i.i.d. model: ( G t , Z t ) (G_t,Z_t) ( G t , Z t ) are i.i.d. with law P P P satisfying (E) with a constant z 0 ≥ 0 z_0\ge0 z 0 ≥ 0 , g = P ( G = 1 ) g=P(G=1) g = P ( G = 1 ) , Z Z Z given G = 0 G=0 G = 0 has a finitely supported law P d i s P_{\mathrm{dis}} P dis on [ − 1 , M ] [-1,M] [ − 1 , M ] , and audits are i.i.d. Bernoulli(p p p ), independent of everything else.
A law Q Q Q of ( G , Z ) (G,Z) ( G , Z ) that satisfies (E) with the same z 0 z_0 z 0 is structural ; write q = Q ( G = 1 ) q=Q(G=1) q = Q ( G = 1 ) and R R R for the law of Z Z Z given G = 0 G=0 G = 0 . Define
D ∗ ( P ; p ) = inf { kl ( g ∥ q ) + p ( 1 − g ) KL ( P d i s ∥ R ) } , D^*(P;p)=\inf\{\operatorname{kl}(g\mathbin{\|}q)+p(1-g)\operatorname{KL}(P_{\mathrm{dis}}\mathbin{\|}R)\}, D ∗ ( P ; p ) = inf { kl ( g ∥ q ) + p ( 1 − g ) KL ( P dis ∥ R )} ,
over structural Q Q Q with q z 0 + ( 1 − q ) E R Z ≤ 0 qz_0+(1-q)\mathbb{E}_RZ\le0 q z 0 + ( 1 − q ) E R Z ≤ 0 . The first term is the information in the agreement frequency, the second the information in the audited disagreements. Let Γ ( λ , u ) = E P ln F \Gamma(\lambda,u)=\mathbb{E}_P\ln F Γ ( λ , u ) = E P ln F be the growth rate of the constant bet ( λ , u ) ∈ C (\lambda,u)\in C ( λ , u ) ∈ C (with π t = p \pi_t=p π t = p ; for p = 1 p=1 p = 1 , where Γ \Gamma Γ does not depend on u u u , we also require u ≤ 0 u\le0 u ≤ 0 , so that C C C is compact), and call ( λ , u ) (\lambda,u) ( λ , u ) strictly feasible if λ > 0 \lambda>0 λ > 0 , u > − 1 u>-1 u > − 1 and λ + u < p ( 1 + u ) \lambda+u<p(1+u) λ + u < p ( 1 + u ) .
Theorem 22 (Agreement-aware certificate). (i) Validity. Under (E), (A1), (A2), p t ≥ π t > 0 p_t\ge\pi_t>0 p t ≥ π t > 0 on { G t = 0 } \{G_t=0\} { G t = 0 } and H 0 H_0 H 0 , ( K n ) (K_n) ( K n ) is a test supermartingale, so the certificate folds with probability at most δ \delta δ . The conservative certificate is a test supermartingale under (E) and H 0 H_0 H 0 alone, for any audit mechanism, including outcome-dependent audits.
(ii) Information. In the i.i.d. model , D ∗ ( P ; p ) = max C Γ D^*(P;p)=\max_C\Gamma D ∗ ( P ; p ) = max C Γ ; D ∗ > 0 D^*>0 D ∗ > 0 iff E P Z > 0 \mathbb{E}_PZ>0 E P Z > 0 ; some maximizer has u ∗ ≤ 0 u^*\le0 u ∗ ≤ 0 ; and
D ∗ ≥ max { p KL inf ( P Z ) , KL inf ( P X 0 ) , kl ( g ∥ 1 1 + z 0 ) 1 { g > 1 1 + z 0 } } . D^*\ge\max\left\{p\operatorname{KL}_{\inf}(P_Z),\operatorname{KL}_{\inf}(P_{X^0}),\operatorname{kl}\left(g\mathbin{\Big\|}\frac{1}{1+z_0}\right)\mathbf{1}_{\left\{g>\frac{1}{1+z_0}\right\}}\right\}. D ∗ ≥ max { p KL i n f ( P Z ) , KL i n f ( P X 0 ) , kl ( g 1 + z 0 1 ) 1 { g > 1 + z 0 1 } } . (iii) Converse. Consider a rule of type (O2) with p t ( 0 ) ≤ p p_t(0)\le p p t ( 0 ) ≤ p that folds at a stopping time τ \tau τ of its records. Suppose P Q ( τ < ∞ ) ≤ δ P_Q(\tau<\infty)\le\delta P Q ( τ < ∞ ) ≤ δ for every i.i.d. structural Q Q Q with E Q Z ≤ 0 \mathbb{E}_QZ\le0 E Q Z ≤ 0 , and P P ( τ < ∞ ) = 1 P_P(\tau<\infty)=1 P P ( τ < ∞ ) = 1 . Then E P τ ≥ ln ( 1 / δ ) / D ∗ ( P ; p ) \mathbb{E}_P\tau\ge\ln(1/\delta)/D^*(P;p) E P τ ≥ ln ( 1/ δ ) / D ∗ ( P ; p ) .
(iv) Achievability. For any finite set of strictly feasible ( λ k , u k ) (\lambda_k,u_k) ( λ k , u k ) with u k ≤ 0 u_k\le0 u k ≤ 0 and weights w k w_k w k , the mixture has
E P τ ≤ min k : Γ k > 0 ln 1 δ + ln 1 w k + ln 1 + M p Γ ( λ k , u k ) . \mathbb{E}_P\tau\le\min_{k:\Gamma_k>0}\frac{\ln\frac{1}{\delta}+\ln\frac{1}{w_k}+\ln\frac{1+M}{p}}{\Gamma(\lambda_k,u_k)}. E P τ ≤ k : Γ k > 0 min Γ ( λ k , u k ) ln δ 1 + ln w k 1 + ln p 1 + M . With grids refined as δ → 0 \delta\to0 δ → 0 and ln ( 1 / w k ) = o ( ln ( 1 / δ ) ) \ln(1/w_k)=o(\ln(1/\delta)) ln ( 1/ w k ) = o ( ln ( 1/ δ )) , E P τ = ( 1 + o ( 1 ) ) ln ( 1 / δ ) / D ∗ ( P ; p ) \mathbb{E}_P\tau=(1+o(1))\ln(1/\delta)/D^*(P;p) E P τ = ( 1 + o ( 1 )) ln ( 1/ δ ) / D ∗ ( P ; p ) . The conservative certificate with the grid mixture of Theorem 17 (a) (with p = 1 p=1 p = 1 ) has E P τ ≤ ( ln ( 1 / δ ) + 2 ln ln ( 1 / δ ) + O ( 1 ) ) / KL inf ( P X 0 ) \mathbb{E}_P\tau\le(\ln(1/\delta)+2\ln\ln(1/\delta)+O(1))/\operatorname{KL}_{\inf}(P_{X^0}) E P τ ≤ ( ln ( 1/ δ ) + 2 ln ln ( 1/ δ ) + O ( 1 )) / KL i n f ( P X 0 ) .
Proof. (i) Nonnegativity. Since π t ≤ 1 \pi_t\le1 π t ≤ 1 and $1+u\ge 0$, λ ≤ π t ( 1 + u ) − u ≤ 1 \lambda\le\pi_t(1+u)-u\le1 λ ≤ π t ( 1 + u ) − u ≤ 1 , so 1 + λ z 0 , t ≥ 1 − λ ≥ 0 1+\lambda z_{0,t}\ge1-\lambda\ge0 1 + λ z 0 , t ≥ 1 − λ ≥ 0 on agreement. On disagreement without audit, F t = 1 + u t ≥ 0 F_t=1+u_t\ge0 F t = 1 + u t ≥ 0 . With audit, $Z_t\ge -1 gives F t ≥ 1 + u t − ( λ t + u t ) / p t F_t \ge1 + u_t - (\lambda_t + u_t)/p_t F t ≥ 1 + u t − ( λ t + u t ) / p t . This is ≥ 1 + u t ≥ 0 \ge1 + u_t \ge0 ≥ 1 + u t ≥ 0 if λ t + u t ≤ 0 \lambda_t + u_t \le0 λ t + u t ≤ 0 ; otherwise it increases in p t p_t p t and is ≥ 1 + u t − ( λ t + u t ) / π t ≥ 0 \ge1 + u_t - (\lambda_t + u_t)/\pi_t \ge0 ≥ 1 + u t − ( λ t + u t ) / π t ≥ 0 because ( λ t , u t ) ∈ C t (\lambda_t,u_t) \in C_t ( λ t , u t ) ∈ C t . Mean. On { G t = 1 } \{G_t = 1\} { G t = 1 } , (E) gives F t = 1 + λ t Z t F_t = 1 + \lambda_t Z_t F t = 1 + λ t Z t . On { G t = 0 } \{G_t = 0\} { G t = 0 } , (A2) and p t > 0 p_t > 0 p t > 0 give E [ F t ∣ H t , Z t ] = 1 + u t + λ t Z t − u t = 1 + λ t Z t \mathbb{E}[F_t \mid\mathcal{H}_t,Z_t] = 1 + u_t + \lambda_t Z_t - u_t = 1 + \lambda_t Z_t E [ F t ∣ H t , Z t ] = 1 + u t + λ t Z t − u t = 1 + λ t Z t . Since λ t , u t \lambda_t,u_t λ t , u t are F t − 1 \mathcal{F}_{t-1} F t − 1 -measurable and λ t ≥ 0 \lambda_t \ge0 λ t ≥ 0 , E [ F t ∣ F t − 1 ] = 1 + λ t E [ Z t ∣ F t − 1 ] ≤ 1 \mathbb{E}[F_t \mid\mathcal{F}_{t-1}] = 1 + \lambda_t\mathbb{E}[Z_t \mid\mathcal{F}_{t-1}] \le1 E [ F t ∣ F t − 1 ] = 1 + λ t E [ Z t ∣ F t − 1 ] ≤ 1 . The mixture and Ville’s inequality follow as in Theorem 15 . For the conservative certificate, X t 0 = Z t X_t^0 = Z_t X t 0 = Z t if A t = 1 A_t = 1 A t = 1 , X t 0 = Z t X_t^0 = Z_t X t 0 = Z t if A t = 0 A_t = 0 A t = 0 and G t = 1 G_t = 1 G t = 1 (by (E)), and X t 0 = − 1 ≤ Z t X_t^0 = -1 \le Z_t X t 0 = − 1 ≤ Z t otherwise. So X t 0 ≤ Z t X_t^0 \le Z_t X t 0 ≤ Z t pointwise, whatever the audits depend on, X t 0 X_t^0 X t 0 is observable, and 1 + λ X t 0 ≥ 1 − λ ≥ 0 1 + \lambda X_t^0 \ge1 - \lambda\ge0 1 + λ X t 0 ≥ 1 − λ ≥ 0 .
(ii) Let O = ( G , A , A Z ) O = (G,A,AZ) O = ( G , A , A Z ) . Because A A A is independent Bernoulli( p ) (p) ( p ) under P P P and under every structural Q Q Q , and A Z = A z 0 AZ = Az_0 A Z = A z 0 on { G = 1 } \{G = 1\} { G = 1 } , the chain rule gives KL ( P O ∥ Q O ) = kl ( g ∥ q ) + p ( 1 − g ) KL ( P d i s ∥ R ) \operatorname{KL}(P_O\|Q_O) = \operatorname{kl}(g\|q) + p(1-g)\operatorname{KL}(P_{\mathrm{dis}}\|R) KL ( P O ∥ Q O ) = kl ( g ∥ q ) + p ( 1 − g ) KL ( P dis ∥ R ) . So D ∗ D^* D ∗ is the infimum of KL ( P O ∥ Q O ) \operatorname{KL}(P_O\|Q_O) KL ( P O ∥ Q O ) over structural nulls. Weak duality. The computation in (i) with p t = p p_t = p p t = p gives E Q F = 1 + λ E Q Z ≤ 1 \mathbb{E}_QF = 1 + \lambda\mathbb{E}_QZ \le1 E Q F = 1 + λ E Q Z ≤ 1 for every ( λ , u ) ∈ C (\lambda,u) \in C ( λ , u ) ∈ C and structural null Q Q Q . As in Lemma 16, Jensen then gives Γ ( λ , u ) = E P ln F ≤ KL ( P O ∥ Q O ) \Gamma(\lambda,u) = \mathbb{E}_P\ln F \le\operatorname{KL}(P_O\|Q_O) Γ ( λ , u ) = E P ln F ≤ KL ( P O ∥ Q O ) . Hence sup C Γ ≤ D ∗ \sup_C \Gamma\le D^* sup C Γ ≤ D ∗ . If E P Z ≤ 0 \mathbb{E}_PZ \le0 E P Z ≤ 0 , P P P is itself a structural null, so D ∗ = 0 = Γ ( 0 , 0 ) D^* = 0 = \Gamma(0,0) D ∗ = 0 = Γ ( 0 , 0 ) . Let E P Z > 0 \mathbb{E}_PZ > 0 E P Z > 0 . The set C C C is a compact polygon, and Γ \Gamma Γ is concave and upper semicontinuous with values in [ − ∞ , ∞ ) [-\infty,\infty) [ − ∞ , ∞ ) , so it has a maximizer ( λ ∗ , u ∗ ) (\lambda^*,u^*) ( λ ∗ , u ∗ ) . For λ ≤ p \lambda\le p λ ≤ p , ( λ , 0 ) ∈ C (\lambda,0) \in C ( λ , 0 ) ∈ C and d d λ Γ ( λ , 0 ) ∣ λ = 0 = E P Z > 0 \left.\frac{\mathrm{d}}{\mathrm{d}\lambda}\Gamma(\lambda,0)\right|_{\lambda=0} = \mathbb{E}_PZ > 0 d λ d Γ ( λ , 0 ) λ = 0 = E P Z > 0 , so Γ ∗ : = Γ ( λ ∗ , u ∗ ) > 0 \Gamma^* := \Gamma(\lambda^*,u^*) > 0 Γ ∗ := Γ ( λ ∗ , u ∗ ) > 0 and λ ∗ > 0 \lambda^* > 0 λ ∗ > 0 . Case g = 1 g = 1 g = 1 . Then Γ = ln ( 1 + λ z 0 ) \Gamma= \ln(1+\lambda z_0) Γ = ln ( 1 + λ z 0 ) , which is maximal at ( 1 , − 1 ) ∈ C (1,-1) \in C ( 1 , − 1 ) ∈ C with value ln ( 1 + z 0 ) \ln(1+z_0) ln ( 1 + z 0 ) . The structural law with q = 1 / ( 1 + z 0 ) q = 1/(1+z_0) q = 1/ ( 1 + z 0 ) and R = δ − 1 R = \delta_{-1} R = δ − 1 has mean 0 and KL ( P O ∥ Q O ) = ln ( 1 + z 0 ) \operatorname{KL}(P_O\|Q_O) = \ln(1+z_0) KL ( P O ∥ Q O ) = ln ( 1 + z 0 ) , so D ∗ = Γ ∗ D^* = \Gamma^* D ∗ = Γ ∗ and u ∗ = − 1 u^* = -1 u ∗ = − 1 . Case g < 1 g < 1 g < 1 . Since Γ ∗ \Gamma^* Γ ∗ is finite and P P P has finite support, all factors are positive at ( λ ∗ , u ∗ ) (\lambda^*,u^*) ( λ ∗ , u ∗ ) on the support of P O P_O P O , and Γ \Gamma Γ is differentiable nearby, with F d ( z ) : = 1 + u + ( λ z − u ) / p F_d(z) := 1 + u + (\lambda z-u)/p F d ( z ) := 1 + u + ( λ z − u ) / p .
∂ λ Γ = g z 0 1 + λ z 0 + ( 1 − g ) E P d i s Z F d , \partial_\lambda\Gamma= \frac{g z_0}{1+\lambda z_0} + (1-g)\mathbb{E}_{P_{\mathrm{dis}}}\frac{Z}{F_d}, ∂ λ Γ = 1 + λ z 0 g z 0 + ( 1 − g ) E P dis F d Z ,
∂ u Γ = ( 1 − g ) ( 1 − p ) [ 1 1 + u − E P d i s 1 F d ] . \partial_u \Gamma= (1-g)(1-p)\left[\frac{1}{1+u} - \mathbb{E}_{P_{\mathrm{dis}}}\frac{1}{F_d}\right]. ∂ u Γ = ( 1 − g ) ( 1 − p ) [ 1 + u 1 − E P dis F d 1 ] .
The constraint λ ≥ 0 \lambda\ge0 λ ≥ 0 is inactive. Write the others as c 1 = 1 + u ≥ 0 c_1 = 1+u \ge0 c 1 = 1 + u ≥ 0 and c 2 = p ( 1 + u ) − u − λ ≥ 0 c_2 = p(1+u)-u-\lambda\ge0 c 2 = p ( 1 + u ) − u − λ ≥ 0 . The KKT conditions for a concave function on a polytope give ν 1 , ν 2 ≥ 0 \nu_1,\nu_2 \ge0 ν 1 , ν 2 ≥ 0 with ν i c i = 0 \nu_i c_i = 0 ν i c i = 0 , ∂ λ Γ = ν 2 \partial_\lambda\Gamma= \nu_2 ∂ λ Γ = ν 2 and ∂ u Γ = ν 2 ( 1 − p ) − ν 1 \partial_u\Gamma= \nu_2(1-p)-\nu_1 ∂ u Γ = ν 2 ( 1 − p ) − ν 1 . If p < 1 p < 1 p < 1 , Γ = − ∞ \Gamma= -\infty Γ = − ∞ at u = − 1 u = -1 u = − 1 , so ν 1 = 0 \nu_1 = 0 ν 1 = 0 . If p = 1 p = 1 p = 1 , ∂ u Γ ≡ 0 \partial_u\Gamma\equiv0 ∂ u Γ ≡ 0 ; take the maximizer with u ∗ = 0 u^* = 0 u ∗ = 0 , where c 1 > 0 c_1 > 0 c 1 > 0 , so ν 1 = 0 \nu_1 = 0 ν 1 = 0 and the constraint u ≤ 0 u \le0 u ≤ 0 gets multiplier 0.
If ν 2 > 0 \nu_2 > 0 ν 2 > 0 , then c 2 = 0 c_2 = 0 c 2 = 0 , so F d ( − 1 ) = 0 F_d(-1) = 0 F d ( − 1 ) = 0 and P d i s ( { − 1 } ) = 0 P_{\mathrm{dis}}(\{-1\}) = 0 P dis ({ − 1 }) = 0 . Define a measure Q O ∗ Q_O^* Q O ∗ on the values of O O O : mass g / ( 1 + λ ∗ z 0 ) g/(1+\lambda^*z_0) g / ( 1 + λ ∗ z 0 ) on agreement, ( 1 − g ) ( 1 − p ) / ( 1 + u ∗ ) (1-g)(1-p)/(1+u^*) ( 1 − g ) ( 1 − p ) / ( 1 + u ∗ ) on an unaudited disagreement, and ( 1 − g ) p P d i s ( z ) / F d ( z ) + p ν 2 1 { z = − 1 } (1-g)pP_{\mathrm{dis}}(z)/F_d(z)+p\nu_2\mathbf{1}_{\{z=-1\}} ( 1 − g ) p P dis ( z ) / F d ( z ) + p ν 2 1 { z = − 1 } on an audited disagreement with Z = z Z=z Z = z . On the support of P O P_O P O , d P O / d Q O ∗ = F ∗ \mathrm{d}P_O/\mathrm{d}Q_O^* = F^* d P O / d Q O ∗ = F ∗ , and the added atom lies outside it. Mass. Since F − 1 F-1 F − 1 is linear in ( λ , u ) (\lambda,u) ( λ , u ) , λ ∂ λ Γ + u ∂ u Γ = E P [ 1 − 1 / F ] = 1 − Q O ∗ ( a l l ) − p ν 2 \lambda\partial_\lambda\Gamma+ u\partial_u\Gamma= \mathbb{E}_P[1-1/F] = 1-Q_O^*(\mathrm{all})-p\nu_2 λ ∂ λ Γ + u ∂ u Γ = E P [ 1 − 1/ F ] = 1 − Q O ∗ ( all ) − p ν 2 . By the KKT conditions the left side equals ν 2 ( λ ∗ + u ∗ ( 1 − p ) ) \nu_2(\lambda^*+u^*(1-p)) ν 2 ( λ ∗ + u ∗ ( 1 − p )) , and this is p ν 2 p\nu_2 p ν 2 because ν 2 > 0 \nu_2 > 0 ν 2 > 0 forces λ ∗ = p ( 1 + u ∗ ) − u ∗ \lambda^* = p(1+u^*)-u^* λ ∗ = p ( 1 + u ∗ ) − u ∗ . So Q O ∗ Q_O^* Q O ∗ has mass 1. Structure. For p < 1 p < 1 p < 1 , the u u u -condition with ν 1 = 0 \nu_1 = 0 ν 1 = 0 reads ( 1 − g ) / ( 1 + u ∗ ) − ( 1 − g ) E P d i s [ 1 / F d ] = ν 2 (1-g)/(1+u^*)-(1-g)\mathbb{E}_{P_{\mathrm{dis}}}[1/F_d] = \nu_2 ( 1 − g ) / ( 1 + u ∗ ) − ( 1 − g ) E P dis [ 1/ F d ] = ν 2 , that is, Q O ∗ ( unaudited disagreement ) / ( 1 − p ) = Q O ∗ ( audited disagreement ) / p = : 1 − q ∗ Q_O^*(\text{unaudited disagreement})/(1-p) = Q_O^*(\text{audited disagreement})/p =: 1-q^* Q O ∗ ( unaudited disagreement ) / ( 1 − p ) = Q O ∗ ( audited disagreement ) / p =: 1 − q ∗ . With the mass identity, the agreement mass is q ∗ q^* q ∗ . So Q O ∗ Q_O^* Q O ∗ is the observation law (the audit coin is Bernoulli( p ) (p) ( p ) under both laws) of the structural Q ∗ Q^* Q ∗ with Q ∗ ( G = 1 ) = q ∗ Q^*(G=1)=q^* Q ∗ ( G = 1 ) = q ∗ and R ∗ = Q O ∗ ( audited disagreement , ⋅ ) / ( p ( 1 − q ∗ ) ) R^* = Q_O^*(\text{audited disagreement},\cdot)/(p(1-q^*)) R ∗ = Q O ∗ ( audited disagreement , ⋅ ) / ( p ( 1 − q ∗ )) . For p = 1 p = 1 p = 1 there are no unaudited disagreements, and 1 − q ∗ 1-q^* 1 − q ∗ is the audited disagreement mass. Mean. E Q ∗ Z = q ∗ z 0 + ( 1 − q ∗ ) E R ∗ Z = ∂ λ Γ − ν 2 = 0 \mathbb{E}_{Q^*}Z = q^*z_0 + (1-q^*)\mathbb{E}_{R^*}Z = \partial_\lambda\Gamma-\nu_2 = 0 E Q ∗ Z = q ∗ z 0 + ( 1 − q ∗ ) E R ∗ Z = ∂ λ Γ − ν 2 = 0 . So Q ∗ Q^* Q ∗ is a structural null and D ∗ ≤ KL ( P O ∥ Q O ∗ ) = E P ln F ∗ = Γ ∗ ≤ D ∗ D^* \le\operatorname{KL}(P_O\|Q_O^*) = \mathbb{E}_P\ln F^* = \Gamma^* \le D^* D ∗ ≤ KL ( P O ∥ Q O ∗ ) = E P ln F ∗ = Γ ∗ ≤ D ∗ . Sign of u ∗ u^* u ∗ . For p < 1 p < 1 p < 1 , the structure identity gives 1 + u ∗ = ( 1 − g ) / ( 1 − q ∗ ) 1+u^* = (1-g)/(1-q^*) 1 + u ∗ = ( 1 − g ) / ( 1 − q ∗ ) , and q ∗ = g / ( 1 + λ ∗ z 0 ) ≤ g q^* = g/(1+\lambda^*z_0) \le g q ∗ = g / ( 1 + λ ∗ z 0 ) ≤ g because z 0 ≥ 0 z_0 \ge0 z 0 ≥ 0 . Hence u ∗ ≤ 0 u^* \le0 u ∗ ≤ 0 . For p = 1 p = 1 p = 1 , u u u does not enter Γ \Gamma Γ , and u ∗ = 0 u^* = 0 u ∗ = 0 is a maximizer. Lower bounds. Under a structural null Q Q Q , the pair ( A , A Z ) (A,AZ) ( A , A Z ) is a function of O O O with law Bernoulli ( p ) ⊗ Q Z \operatorname{Bernoulli}(p)\otimes Q_Z Bernoulli ( p ) ⊗ Q Z and E Q Z ≤ 0 \mathbb{E}_QZ \le0 E Q Z ≤ 0 , so data processing gives KL ( P O ∥ Q O ) ≥ p KL ( P Z ∥ Q Z ) ≥ p KL inf ( P Z ) \operatorname{KL}(P_O\|Q_O) \ge p\operatorname{KL}(P_Z\|Q_Z) \ge p\operatorname{KL}_{\inf}(P_Z) KL ( P O ∥ Q O ) ≥ p KL ( P Z ∥ Q Z ) ≥ p KL i n f ( P Z ) . Likewise X 0 X^0 X 0 is a function of O O O with E Q X 0 ≤ E Q Z ≤ 0 \mathbb{E}_QX^0 \le\mathbb{E}_QZ \le0 E Q X 0 ≤ E Q Z ≤ 0 , which gives KL inf ( P X 0 ) \operatorname{KL}_{\inf}(P_{X^0}) KL i n f ( P X 0 ) . Finally G G G is a function of O O O , and E R Z ≥ − 1 \mathbb{E}_RZ \ge-1 E R Z ≥ − 1 forces q ≤ 1 / ( 1 + z 0 ) q \le1/(1+z_0) q ≤ 1/ ( 1 + z 0 ) , which gives the kl \operatorname{kl} kl term. Take the infimum over Q Q Q .
(iii) Let Q ∗ Q^* Q ∗ be the structural null from (ii). The records after n n n runs are ( U , ( G t , A t , A t Z t ) t ≤ n ) (U,(G_t,A_t,A_tZ_t)_{t\le n}) ( U , ( G t , A t , A t Z t ) t ≤ n ) . Their density under an i.i.d. structural law is a product of Q ( G t ) Q(G_t) Q ( G t ) , of the audit factors p t ( G t ) A t ( 1 − p t ( G t ) ) 1 − A t p_t(G_t)^{A_t}(1-p_t(G_t))^{1-A_t} p t ( G t ) A t ( 1 − p t ( G t ) ) 1 − A t , and of the density of R R R at Z t Z_t Z t when A t = 1 A_t = 1 A t = 1 and G t = 0 G_t = 0 G t = 0 ; on { G t = 1 } \{G_t = 1\} { G t = 1 } , A t Z t = A t z 0 A_tZ_t = A_tz_0 A t Z t = A t z 0 carries no further information. The audit factors are the same under P P P and Q ∗ Q^* Q ∗ . The log-likelihood ratio is therefore ∑ t ≤ n ℓ t \sum_{t\le n}\ell_t ∑ t ≤ n ℓ t with
ℓ t = ln P ( G t ) Q ∗ ( G t ) + A t ( 1 − G t ) ln d P d i s ( Z t ) d R ∗ ( Z t ) , \ell_t = \ln\frac{P(G_t)}{Q^*(G_t)} + A_t(1-G_t)\ln\frac{\mathrm{d}P_{\mathrm{dis}}(Z_t)}{\mathrm{d}R^*}(Z_t), ℓ t = ln Q ∗ ( G t ) P ( G t ) + A t ( 1 − G t ) ln d R ∗ d P dis ( Z t ) ( Z t ) ,
which is bounded because the supports are finite and R ∗ > 0 R^* > 0 R ∗ > 0 on supp P d i s \operatorname{supp}P_{\mathrm{dis}} supp P dis . Its conditional mean under P P P given the records before t t t is kl ( g ∥ q ∗ ) + ( 1 − g ) p t ( 0 ) KL ( P d i s ∥ R ∗ ) ≤ D ∗ \operatorname{kl}(g\|q^*) + (1-g)p_t(0)\operatorname{KL}(P_{\mathrm{dis}}\|R^*) \le D^* kl ( g ∥ q ∗ ) + ( 1 − g ) p t ( 0 ) KL ( P dis ∥ R ∗ ) ≤ D ∗ . Optional stopping at τ ∧ n \tau\wedge n τ ∧ n and data processing on { τ ≤ n } \{\tau\le n\} { τ ≤ n } give D ∗ E P τ ≥ x n ln ( 1 / δ ) − h ( x n ) D^*\mathbb{E}_P\tau\ge x_n\ln(1/\delta)-h(x_n) D ∗ E P τ ≥ x n ln ( 1/ δ ) − h ( x n ) with x n = P P ( τ ≤ n ) → 1 x_n=\mathbb{P}_P(\tau\le n)\to1 x n = P P ( τ ≤ n ) → 1 , as in Theorem 17 (b).
(iv) For a strictly feasible ( λ k , u k ) (\lambda_k,u_k) ( λ k , u k ) with u k ≤ 0 u_k\le0 u k ≤ 0 , the factors lie between a positive constant and ( 1 + M ) / p (1+M)/p ( 1 + M ) / p , since 1 + u k ( 1 − 1 / p ) + λ k M / p ≤ ( 1 + M ) / p 1+u_k(1-1/p)+\lambda_kM/p\le(1+M)/p 1 + u k ( 1 − 1/ p ) + λ k M / p ≤ ( 1 + M ) / p . The log-wealth S n S_n S n of this bet has i.i.d. bounded increments of mean Γ k > 0 \Gamma_k>0 Γ k > 0 . Since K n ≥ w k e S n K_n\ge w_ke^{S_n} K n ≥ w k e S n , τ \tau τ is at most the first n n n with S n ≥ ln ( 1 / ( δ w k ) ) S_n\ge\ln(1/(\delta w_k)) S n ≥ ln ( 1/ ( δ w k )) , and Wald’s identity with overshoot at most ln ( ( 1 + M ) / p ) \ln((1+M)/p) ln (( 1 + M ) / p ) gives the bound. For the limit, take θ ∈ ( 0 , 1 ) \theta\in(0,1) θ ∈ ( 0 , 1 ) and a maximizer with u ∗ ≤ 0 u^*\le0 u ∗ ≤ 0 . The point θ ( λ ∗ , u ∗ ) \theta(\lambda^*,u^*) θ ( λ ∗ , u ∗ ) has λ = θ λ ∗ > 0 \lambda=\theta\lambda^*>0 λ = θ λ ∗ > 0 , u = θ u ∗ ∈ ( − 1 , 0 ] u=\theta u^*\in(-1,0] u = θ u ∗ ∈ ( − 1 , 0 ] and c 2 = ( 1 − θ ) p + θ c 2 ( λ ∗ , u ∗ ) ≥ ( 1 − θ ) p > 0 c_2=(1-\theta)p+\theta c_2(\lambda^*,u^*)\ge(1-\theta)p>0 c 2 = ( 1 − θ ) p + θ c 2 ( λ ∗ , u ∗ ) ≥ ( 1 − θ ) p > 0 , so it is strictly feasible, and Γ ( θ λ ∗ , θ u ∗ ) ≥ θ Γ ∗ + ( 1 − θ ) Γ ( 0 , 0 ) = θ Γ ∗ \Gamma(\theta\lambda^*,\theta u^*)\ge\theta\Gamma^*+(1-\theta)\Gamma(0,0)=\theta\Gamma^* Γ ( θ λ ∗ , θ u ∗ ) ≥ θ Γ ∗ + ( 1 − θ ) Γ ( 0 , 0 ) = θ Γ ∗ by concavity. Γ \Gamma Γ is continuous on the strictly feasible set, so fine grids contain points with Γ ≥ θ 2 Γ ∗ \Gamma\ge\theta^2\Gamma^* Γ ≥ θ 2 Γ ∗ ; let θ → 1 \theta\to1 θ → 1 . The conservative certificate is Theorem 17 (a) applied to the i.i.d. X t 0 ∈ [ − 1 , M ] X_t^0\in[-1,M] X t 0 ∈ [ − 1 , M ] with p = 1 p=1 p = 1 .
Implementation. A replay policy implements the certificate as follows. The agreement indicator is G t = 1 G_t=1 G t = 1 iff both final answers are non-empty and identical under the scorer’s own comparison, and (E) must hold for the benchmark’s labels. On a shadow run with live cost c t c_t c t , put z 0 , t = ( c t − 1 ) / B z_{0,t}=(c_t-1)/B z 0 , t = ( c t − 1 ) / B (clipped to [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] as for Z t Z_t Z t ), and on an audited disagreement compute Z t Z_t Z t as in the IPW certificate. The bets are λ = c ( π ( 1 − s ) + s ) \lambda=c(\pi(1-s)+s) λ = c ( π ( 1 − s ) + s ) and u = − s u=-s u = − s , where π \pi π is the audit floor, c c c runs over the grid c j = ( 1 + ε ) − j c_j=(1+\varepsilon)^{-j} c j = ( 1 + ε ) − j of Theorem 17 (a) with weights 1 / ( j ( j + 1 ) ) 1/(j(j+1)) 1/ ( j ( j + 1 )) (truncated at c j ≥ 1 / 200 c_j\ge1/200 c j ≥ 1/200 ), and s s s runs over { 0 , 0.01 , 0.03 , 0.1 , 0.3 , 0.6 , 0.9 , 0.97 , 0.99 } \{0,0.01,0.03,0.1,0.3,0.6,0.9,0.97,0.99\} { 0 , 0.01 , 0.03 , 0.1 , 0.3 , 0.6 , 0.9 , 0.97 , 0.99 } with weight 1 / 2 1/2 1/2 for s = 0 s=0 s = 0 and 1 / 16 1/16 1/16 for each other value. Every grid point is strictly feasible, because λ + u − π ( 1 + u ) = − ( 1 − c ) ( π ( 1 − s ) + s ) < 0 \lambda+u-\pi(1+u)=-(1-c)(\pi(1-s)+s)<0 λ + u − π ( 1 + u ) = − ( 1 − c ) ( π ( 1 − s ) + s ) < 0 . The factors are 1 + λ z 0 , t 1+\lambda z_{0,t} 1 + λ z 0 , t on agreement (audited or not), 1 − s 1-s 1 − s on an unaudited disagreement, and 1 − s + ( λ Z t + s ) / p t 1-s+(\lambda Z_t+s)/p_t 1 − s + ( λ Z t + s ) / p t on an audited disagreement. The wealth is updated on every shadow run, not only on audited ones. The slice s = 0 s=0 s = 0 is the IPW certificate with the exact surrogate z 0 , t z_{0,t} z 0 , t on agreement. By concavity, g ln ( 1 + c p z 0 ) ≥ p g ln ( 1 + c z 0 ) g\ln(1+cpz_0)\ge pg\ln(1+cz_0) g ln ( 1 + c p z 0 ) ≥ p g ln ( 1 + c z 0 ) , so the growth of its bet c c c is at least that of the IPW bet c c c . The bound of Theorem 17 (a) therefore holds for the mixture with an extra ln 2 \ln2 ln 2 in the numerator.
Changes, carried-over evidence and the lifetime ledger
Numerical checks. On 274 random structural laws (p ∈ { 0.05 , 0.1 , 0.3 , 0.7 , 1 } p\in\{0.05,0.1,0.3,0.7,1\} p ∈ { 0.05 , 0.1 , 0.3 , 0.7 , 1 } ), max C Γ \max_C\Gamma max C Γ and a direct convex program over structural nulls agree to 3 ⋅ 10 − 12 3\cdot10^{-12} 3 ⋅ 1 0 − 12 . The constructed Q ∗ Q^* Q ∗ has mass 1 1 1 , mean 0 0 0 and the structural ratio to within 5 ⋅ 10 − 8 5\cdot10^{-8} 5 ⋅ 1 0 − 8 , u ∗ ≤ 10 − 8 u^*\le10^{-8} u ∗ ≤ 1 0 − 8 , and D ∗ D^* D ∗ never falls below the three lower bounds in (ii). The median of D ∗ / ( p KL i n f ( P Z ) ) D^*/(p\operatorname{KL}_{\mathrm{inf}}(P_Z)) D ∗ / ( p KL inf ( P Z )) is only 1.02: agreement adds little information unless it is frequent. In the paired model with p = 0.1 p=0.1 p = 0.1 the ratio is 1.00 for live accuracy 0.38 and macro reliability 0.97 (as on KQA-STREAM), 1.18 for a = r = 0.9 a=r=0.9 a = r = 0.9 with correlated errors, and 5.2 when the answers agree with probability 0.99. In 200 simulated runs per setting, the grid above certified in 1.07, 1.03 and 0.29 times the time of the IPW grid mixture at δ = 10 − 2 \delta=10^{-2} δ = 1 0 − 2 , and in 1.02, 0.88 and 0.23 times at δ = 10 − 6 \delta=10^{-6} δ = 1 0 − 6 . The conservative certificate has rate 0 in the first two settings and 0.027 (against D ∗ = 0.030 D^*=0.030 D ∗ = 0.030 ) in the third. Under five structural nulls, including the least-favorable one, the certificate folded in 2.4–3.3% of 4,000 runs at δ = 0.05 \delta=0.05 δ = 0.05 (horizon 4,000).
Definition 1 counts every fold event of a bad candidate in an epoch, including candidates formed in earlier epochs. We separate what is proved for the idealized certificate from what holds for the two implemented ledgers: without restarts and with restarts (the restart-only certificate of Section 5).
Idealized. Changes are announced, all certification evidence is discarded at each change, and one test per template (SPRT, or the grid mixture of Theorem 17 ) restarts in each epoch at level δ \delta δ ; if several candidates are tested within an epoch, they share δ \delta δ , e.g. through a per-epoch ledger. Every fold in an epoch then rests on that epoch’s evidence alone, Ville’s inequality gives Definition 1 for every fold event, and Theorem 3 (ii) and Corollary 20 describe this certificate.
Ledger with restarts (restart only). The replay notifies the policy of every edit that changes the gold answer of some instance routed to a template; epochs of a template are the intervals between such edits, within which the macro’s reliability is constant. At each notification, a candidate under test discards its wealth and its shadow statistics and restarts its test with the next ledger index, so the lifetime ledger still sums to δ \delta δ . Folded macros are not reset; they are monitored by the LR-CUSUM.
By Proposition 23(iv) this certificate satisfies Definition 1 for these epochs if its own null is constant within them. The null E Z ≤ 0 \mathbb{E}Z \le0 E Z ≤ 0 also depends on live reasoning, whose accuracy and cost can change without any answer change; across such a silent change only Proposition 23(iii) applies (Appendix § 14 .5.1 measures how often this happens and evaluates a variant that also restarts on live-trace changes). It needs to know which templates an edit touches; a coarser change log that also flags edits without effect on a template’s answers triggers extra restarts, which cost coverage but not safety, because every restart consumes a fresh index.
Ledger without restarts. Here the policy is not told when an edit occurs. A candidate keeps its wealth (or its SPRT statistic) across edits; it is neither reset nor discarded. The j j j -th candidate of a template, counted over the whole stream, is tested at δ j = 6 δ / ( π 2 j 2 ) \delta_j = 6\delta/(\pi^2j^2) δ j = 6 δ / ( π 2 j 2 ) with seven fixed bets. For a candidate j j j and its shadow evaluations t = 1 , 2 , … t = 1, 2, \ldots t = 1 , 2 , … , let ζ j \zeta_j ζ j be the first t t t with E [ Z t ∣ F t − 1 ] > 0 \mathbb{E}[Z_t \mid\mathcal{F}_{t-1}] > 0 E [ Z t ∣ F t − 1 ] > 0 (ζ j = ∞ \zeta_j = \infty ζ j = ∞ if there is none). Call a fold of candidate j j j at evaluation t < ζ j t < \zeta_j t < ζ j a fold on null evidence: the candidate has been at or below break-even at every evaluation so far.
Proposition 23 (What the lifetime ledger guarantees). Let each candidate’s wealth be a mixture of test supermartingales, as in Theorem 15 , started at 1 at its formation and compared with 1 / δ j 1/\delta_j 1/ δ j .
(i) Lifetime. With probability at least 1 − δ 1 - \delta 1 − δ , over the whole stream no candidate of the template folds on null evidence. The expected number of such folds per template is at most δ \delta δ .
(ii) Fresh candidates. Given the history at the start of an epoch, the candidates formed from then on fold on null evidence with total probability at most ∑ j > J δ j ≤ δ \sum_{j>J}\delta_j \le\delta ∑ j > J δ j ≤ δ , where J J J is the number of earlier candidates.
(iii) Carried-over candidates. Let candidate j j j be unfolded at a stopping time c c c with wealth K c K_c K c , and let e ≥ c e \ge c e ≥ c be a stopping time such that the null holds at its evaluations in [ c , e ) [c,e) [ c , e ) . Then it folds in [ c , e ) [c,e) [ c , e ) with conditional probability at most min { 1 , δ j K c } \min\{1,\delta_jK_c\} min { 1 , δ j K c } given F c \mathcal{F}_c F c . Equality holds (with e = ∞ e = \infty e = ∞ ) if, after c c c , its wealth is a martingale that tends to 0 unless it reaches 1 / δ j 1/\delta_j 1/ δ j , and it reaches 1 / δ j 1/\delta_j 1/ δ j without overshoot.
(iv) Per epoch. If the library holds at most one candidate per template, the probability that an epoch contains a fold of a candidate that is bad in that epoch is at most ∑ j > J δ j + δ J K c ≤ δ + δ J ( K c − 1 ) + \sum_{j>J}\delta_j + \delta_JK_c \le\delta+ \delta_J(K_c - 1)^+ ∑ j > J δ j + δ J K c ≤ δ + δ J ( K c − 1 ) + , where candidate J J J is carried over with wealth K c K_c K c at the epoch start (δ J K c : = 0 \delta_JK_c := 0 δ J K c := 0 if there is none, in particular if J = 0 J = 0 J = 0 ). The ledger satisfies Definition 1 if, at each change, carried-over candidates are discarded or restart their wealth at 1 with the next ledger index (a restarted test then counts as a fresh candidate in (ii)); otherwise it does not in general.
Proof. (i) Fix j j j and condition on the history at the formation of candidate j j j . Since E [ Z t ∣ F t − 1 ] \mathbb{E}[Z_t \mid\mathcal{F}_{t-1}] E [ Z t ∣ F t − 1 ] is F t − 1 \mathcal{F}_{t-1} F t − 1 -measurable, { ζ j > t } ∈ F t − 1 \{\zeta_j > t\} \in\mathcal{F}_{t-1} { ζ j > t } ∈ F t − 1 . Let K ~ t \widetilde{K}_t K t be the wealth with factors replaced by 1 from evaluation ζ j \zeta_j ζ j on. Then E [ K ~ t ∣ F t − 1 ] = K ~ t − 1 ( 1 { ζ j > t } E [ F t ∣ F t − 1 ] + 1 { ζ j ≤ t } ) ≤ K ~ t − 1 \mathbb{E}[\widetilde{K}_t \mid\mathcal{F}_{t-1}] = \widetilde{K}_{t-1}(\mathbf{1}_{\{\zeta_j>t\}}\mathbb{E}[F_t \mid\mathcal{F}_{t-1}] + \mathbf{1}_{\{\zeta_j\le t\}}) \le\widetilde{K}_{t-1} E [ K t ∣ F t − 1 ] = K t − 1 ( 1 { ζ j > t } E [ F t ∣ F t − 1 ] + 1 { ζ j ≤ t } ) ≤ K t − 1 , because E [ F t ∣ F t − 1 ] ≤ 1 \mathbb{E}[F_t \mid\mathcal{F}_{t-1}] \le1 E [ F t ∣ F t − 1 ] ≤ 1 whenever the null holds at t t t (Theorem 15 ). A fold on null evidence implies sup t K ~ t ≥ 1 / δ j \sup_t\widetilde{K}_t \ge1/\delta_j sup t K t ≥ 1/ δ j , which has conditional probability at most δ j \delta_j δ j by Ville’s inequality. Sum over j j j : ∑ j δ j = δ \sum_j\delta_j = \delta ∑ j δ j = δ . Each candidate folds at most once, which gives the expectation bound. (ii) The same argument, conditioned on the history at the epoch start, for j > J j > J j > J . (iii) Stop the factors at e e e and at the first non-null evaluation, as in (i). Given F c \mathcal{F}_c F c , the stopped wealth ( K t ∧ e ) t ≥ c (K_{t\wedge e})_{t\ge c} ( K t ∧ e ) t ≥ c is a nonnegative supermartingale started at K c K_c K c ; apply Ville’s inequality to K t ∧ e / K c K_{t\wedge e}/K_c K t ∧ e / K c . In the equality case, the martingale stopped at 1 / δ j 1/\delta_j 1/ δ j is bounded by 1 / δ j 1/\delta_j 1/ δ j , so bounded convergence gives K c = E [ K ∞ ∣ F c ] = δ j − 1 P ( fold after c ∣ F c ) K_c = \mathbb{E}[K_\infty\mid\mathcal{F}_c] = \delta_j^{-1}\mathbb{P}(\text{fold after }c \mid\mathcal{F}_c) K c = E [ K ∞ ∣ F c ] = δ j − 1 P ( fold after c ∣ F c ) . (iv) A fold in the epoch of a candidate that is bad in the epoch is either a fold on null evidence of a candidate formed in the epoch, covered by (ii), or a fold of the carried-over candidate, covered by (iii) with c c c the epoch start and e e e its end. Previously folded macros cause no fold event. Add the bounds and use ∑ j ≥ J δ j ≤ δ \sum_{j\ge J}\delta_j \le\delta ∑ j ≥ J δ j ≤ δ .
In the paired model the utility null E Z ≤ 0 \mathbb{E}Z \le0 E Z ≤ 0 is the reliability condition r ≤ r ⋆ r \le r^\star r ≤ r ⋆ , so “bad” in Definition 1 (with r 0 = r ⋆ r_0 = r^\star r 0 = r ⋆ ) and “null” coincide, up to the online estimates of L L L and m m m that the certificate uses; since r ⋆ = a − ( m − 1 ) / L r^\star= a - (m - 1)/L r ⋆ = a − ( m − 1 ) / L moves with live reasoning, both can change inside an epoch of answer changes.
Numerical check of (iii). We simulated a candidate with the deployed seven-bet mixture (p = 0.1 p = 0.1 p = 0.1 , j = 1 j = 1 j = 1 , δ = 0.05 \delta= 0.05 δ = 0.05 ) that sees a good utility law for 60 shadow runs and then a null law with mean exactly 0. Of the candidates still unfolded at the change (mean wealth 4.4), 11.1% folded after it, against the bound E min ( 1 , δ 1 K c ) = 13.4 % \mathbb{E}\min(1,\delta_1 K_c)=13.4\% E min ( 1 , δ 1 K c ) = 13.4% and δ = 5 % \delta=5\% δ = 5% . After 120 good runs the numbers are 22.8% and 28.1%. So carried-over evidence can defeat per-epoch safety, as (iv) allows.
Restarts without change information. The restarts above use the edit log. The next result shows when per-epoch safety is out of reach without change information; the one after it gives the guarantee of restarts triggered by the memory’s own change detector, which needs none.
Under (A1)–(A3) of Appendix B, audits of template i i i form a Poisson process of rate λ i : = p π i \lambda_i:=p\pi_i λ i := p π i , independent of the changes. Let
α i : = λ i λ i + ν \alpha_i := \frac{\lambda_i}{\lambda_i+\nu} α i := λ i + ν λ i
be the probability that an epoch of template i i i contains at least one audit. By memorylessness this holds given any history at the epoch start, and the number of audits in an epoch is geometric, P ( K ≥ k ) = α i k \mathbb{P}(K\geq k)=\alpha_i^k P ( K ≥ k ) = α i k . In the notation of Lemma 10, α i = ρ i \alpha_i=\rho_i α i = ρ i .
Proposition 24. (Per-epoch safety without change information.) *Let the audited outcomes of an epoch be i.i.d. from the epoch’s law, whichever candidate they evaluate, and let a policy observe neither change times nor any signal of them, and fold only at audited outcomes of template i i i . (i) Upper bound. For every epoch and every history before it, the probability that the epoch contains a fold of template i i i is at most α i \alpha_i α i . So if α i ≤ δ \alpha_i\leq\delta α i ≤ δ , Definition 1 holds for template i i i whatever the policy. (ii) Lower bound. Suppose that, with positive probability, the policy reaches a history h h h after which its next audited outcome of template i i i , whenever it arrives, folds a candidate if it lies in a set F F F . Then for every bad law Q Q Q , given that an epoch starts after h h h and before that outcome, the probability that this epoch contains a fold of a bad candidate is at least α i Q ( F ) \alpha_iQ(F) α i Q ( F ) , and at least Q ( F ) Q(F) Q ( F ) given in addition that the epoch contains an audit. The policy is therefore not δ \delta δ -safe if α i Q ( F ) > δ \alpha_iQ(F)>\delta α i Q ( F ) > δ . Consequently, without change information, among certificates whose fold decisions for template i i i are deterministic functions of its own audited outcomes, (a) every reliability certificate that folds with positive probability violates Definition 1 at every level δ < α i r 0 \delta<\alpha_i r_0 δ < α i r 0 ; (b) every paired-utility certificate with Z Z Z taking finitely many values in [ − 1 , M ] [-1,M] [ − 1 , M ] that folds with positive probability violates it at every level δ < α i / ( 1 + M ) \delta<\alpha_i/(1+M) δ < α i / ( 1 + M ) .
Proof. (i) A fold of template i i i in the epoch requires an audit of template i i i in the epoch. Given the history at the epoch start s s s , the audits after s s s form a Poisson process of rate λ i \lambda_i λ i and the epoch length is exponential with rate ν \nu ν , independent of each other and of the history ((A1)–(A3)), so the first audit after s s s precedes the epoch end with probability λ i / ( λ i + ν ) = α i \lambda_i/(\lambda_i+\nu)=\alpha_i λ i / ( λ i + ν ) = α i . (ii) The policy’s action at the next audited outcome is the same function of h h h and of that outcome whether or not a change occurred, because it observes neither. Changes are the points of a Poisson process independent of the history, so an epoch starts between h h h and the next audited outcome with positive probability, and Definition 1 must hold for the histories at the start of such epochs; these histories consist of h h h and the elapsed time. Given such a history, the next audited outcome is the first audit of the epoch, and it falls in the epoch with probability α i \alpha_i α i , by the argument of (i). Under Q Q Q every candidate is bad in the epoch, and this outcome lies in F F F with probability Q ( F ) Q(F) Q ( F ) , independently of its arrival time and of the history; on the intersection of the two events a bad candidate folds in the epoch. For (a) and (b), outcomes take finitely many values, so some history h h h just before the policy’s first fold has positive probability; take F F F the set of outcomes on which the policy folds after h h h , which is not empty and, by determinism, does not depend on when the next audited outcome arrives. (a) If 1 ∈ F 1\in F 1 ∈ F , take Q = Bernoulli ( r 0 ) Q=\operatorname{Bernoulli}(r_0) Q = Bernoulli ( r 0 ) , so Q ( F ) ≥ r 0 Q(F)\geq r_0 Q ( F ) ≥ r 0 ; otherwise 0 ∈ F 0\in F 0 ∈ F and Q = Bernoulli ( 0 ) Q=\operatorname{Bernoulli}(0) Q = Bernoulli ( 0 ) gives Q ( F ) = 1 Q(F)=1 Q ( F ) = 1 . (b) Take z ∈ F z\in F z ∈ F . If z ≤ 0 z\leq0 z ≤ 0 , the point mass at z z z is bad and Q ( F ) = 1 Q(F)=1 Q ( F ) = 1 . If z > 0 z>0 z > 0 , the law with mass 1 / ( 1 + z ) 1/(1+z) 1/ ( 1 + z ) at z z z and z / ( 1 + z ) z/(1+z) z / ( 1 + z ) at − 1 -1 − 1 has mean 0, so it is bad, and Q ( F ) ≥ 1 / ( 1 + z ) ≥ 1 / ( 1 + M ) Q(F)\geq1/(1+z)\geq1/(1+M) Q ( F ) ≥ 1/ ( 1 + z ) ≥ 1/ ( 1 + M ) . □ \square □
So, for a reliability certificate without change information, per-epoch safety is impossible on every template that is likely enough to be audited in an epoch, α i r 0 > δ \alpha_i r_0>\delta α i r 0 > δ , i.e. with more than δ / ( r 0 − δ ) \delta/(r_0-\delta) δ / ( r 0 − δ ) audits per epoch on average, and automatic on every template with α i ≤ δ \alpha_i\leq\delta α i ≤ δ ; in between it depends on the rule. With M = 1 M=1 M = 1 (our clipped utilities) or r 0 = 1 2 r_0=\frac{1}{2} r 0 = 2 1 , and δ = 0.05 \delta=0.05 δ = 0.05 , the impossibility covers every template with more than one audit per nine epochs on average. The templates it leaves out are barely coverable even with change information: by Lemma 10, the restarted SPRT of Theorem 3 (ii), which needs at least n min = ⌈ ln ( 1 / δ ) / ln ( r 1 / r 0 ) ⌉ ≥ 1 n_{\min}=\lceil\ln(1/\delta)/\ln(r_1/r_0)\rceil\geq1 n m i n = ⌈ ln ( 1/ δ ) / ln ( r 1 / r 0 )⌉ ≥ 1 audits in an epoch to fold, answers in one step a share at most E ρ i N ≤ α i n min ≤ ( δ / r 0 ) n min \mathbb{E}\rho_i^N \le\alpha_i^{n_{\min}} \le(\delta/r_0)^{n_{\min}} E ρ i N ≤ α i n m i n ≤ ( δ / r 0 ) n m i n of the queries of a template with α i r 0 ≤ δ \alpha_i r_0 \le\delta α i r 0 ≤ δ . What remains attainable without change information is safety for every fold that rests on evidence collected after the change (Proposition 25 ).
Exact value for a stationary rule. The lower bound of (ii) is attained by a rule whose only chance to fold is the next audited outcome. A rule that, from the epoch start on, folds at the first audited outcome in F F F , whenever it comes, has an exact bad-fold probability: outcomes are i.i.d. within the epoch and independent of the audit times, so the audits whose outcome lies in F F F form a Poisson process of rate λ i Q ( F ) \lambda_i Q(F) λ i Q ( F ) , and the first of them precedes the epoch end with probability
β i ( F ) = λ i Q ( F ) λ i Q ( F ) + ν ∈ [ α i Q ( F ) , α i ] . \beta_i(F) = \frac{\lambda_i Q(F)}{\lambda_i Q(F) + \nu} \in[\alpha_i Q(F),\alpha_i]. β i ( F ) = λ i Q ( F ) + ν λ i Q ( F ) ∈ [ α i Q ( F ) , α i ] .
For fold-at-first-success under the bad law Bernoulli(r 0 r_0 r 0 ) this is λ i r 0 / ( λ i r 0 + ν ) \lambda_i r_0/(\lambda_i r_0+\nu) λ i r 0 / ( λ i r 0 + ν ) , so this rule is δ \delta δ -safe if and only if λ i / ν ≤ δ / ( r 0 ( 1 − δ ) ) \lambda_i/\nu\le\delta/(r_0(1-\delta)) λ i / ν ≤ δ / ( r 0 ( 1 − δ )) , i.e. 0.0658 at r 0 = 0.8 r_0 = 0.8 r 0 = 0.8 and δ = 0.05 \delta= 0.05 δ = 0.05 , slightly below the threshold δ / ( r 0 − δ ) = 0.0667 \delta/(r_0-\delta) = 0.0667 δ / ( r 0 − δ ) = 0.0667 beyond which (a) excludes every rule. The two bounds of the proposition bracket the exact value, and (a) cannot be sharpened to β i \beta_i β i for every rule, because a rule may stop folding after an audited failure.
Numerical check. At λ i = 0.01 \lambda_i = 0.01 λ i = 0.01 , ν = 1 \nu= 1 ν = 1 , δ = 0.05 \delta= 0.05 δ = 0.05 and r 0 = 0.8 r_0 = 0.8 r 0 = 0.8 , α i = 0.0099 < δ \alpha_i = 0.0099 < \delta α i = 0.0099 < δ , so every audit-driven rule is δ \delta δ -safe there; the next-audit rule folds a bad candidate with probability α i r 0 = 0.0079 \alpha_i r_0 = 0.0079 α i r 0 = 0.0079 , and fold-at-first-success with λ i r 0 / ( λ i r 0 + ν ) = 0.0079 \lambda_i r_0/(\lambda_i r_0+\nu) = 0.0079 λ i r 0 / ( λ i r 0 + ν ) = 0.0079 (they differ in the fifth decimal). Monte Carlo over 2 × 10 6 2 \times10^6 2 × 1 0 6 epochs per setting (Poisson audits and changes, bad law Bernoulli(r 0 r_0 r 0 )) reproduces the exact value of fold-at-first-success at 49 settings with r 0 ∈ { 0.5 , 0.8 , 0.95 , 1 } r_0 \in\{0.5, 0.8, 0.95, 1\} r 0 ∈ { 0.5 , 0.8 , 0.95 , 1 } and λ i / ν \lambda_i/\nu λ i / ν from 10 − 3 10^{-3} 1 0 − 3 to 100: 47 of the 49 95% intervals contain it, the largest relative deviation is 2.1%, and an event-driven simulator (2 × 10 5 2 \times10^5 2 × 1 0 5 epochs) agrees on all 10 rows it was run on. Every exact value lies between α i r 0 \alpha_i r_0 α i r 0 and α i \alpha_i α i , with equality to α i \alpha_i α i at r 0 = 1 r_0 = 1 r 0 = 1 , and the δ \delta δ -safety boundary falls where predicted: at r 0 = 0.8 r_0 = 0.8 r 0 = 0.8 the probability is 0.0234 at λ i / ν = 0.03 \lambda_i/\nu= 0.03 λ i / ν = 0.03 and 0.0500 at 0.0658. For the next-audit rule, Monte Carlo reproduces α i r 0 \alpha_i r_0 α i r 0 to within 3 ⋅ 10 − 4 3 \cdot10^{-4} 3 ⋅ 1 0 − 4 at five settings with α i \alpha_i α i from 0.0099 to 0.99. For an SPRT without restarts (r 1 = 0.95 r_1 = 0.95 r 1 = 0.95 , r 0 = 0.5 r_0 = 0.5 r 0 = 0.5 , δ = 0.05 \delta= 0.05 δ = 0.05 ), bad epochs that start one success from the threshold contain a bad fold with frequency α i r 0 \alpha_i r_0 α i r 0 up to Monte Carlo error (more for α i ≥ 0.9 \alpha_i \ge0.9 α i ≥ 0.9 , through later audits), which exceeds δ \delta δ from α i = 0.2 \alpha_i = 0.2 α i = 0.2 on; in a stream of epochs the frequency stays below α i \alpha_i α i at every tested α i ∈ [ 0.02 , 0.98 ] \alpha_i \in[0.02, 0.98] α i ∈ [ 0.02 , 0.98 ] (checks/prop24_check.py in our code release).
Proposition 25 (Detector-triggered restarts). Let the library hold at most one candidate per template, and let each candidate restart its test (wealth 1, the next ledger index) at stopping times of the system’s own records, for instance at the alarms of an LR-CUSUM on its audited shadow outcomes, or be discarded then. Call the interval from a candidate’s last restart (or its formation) to its decision its test segment. Then: (i) statement (i) of Proposition 23 holds; (ii) for every epoch and every history before it, the probability that the epoch contains a fold of a candidate that is bad in the epoch and whose test segment began in the epoch is at most ∑ j > J δ j ≤ δ \sum_{j>J}\delta_j \le\delta ∑ j > J δ j ≤ δ , where J J J is the number of ledger indices used before the epoch; (iii) the segment running at the epoch start, with index J J J and wealth K c K_c K c , folds a candidate that is bad in the epoch before its next restart with probability at most min { 1 , δ J K c } \min\{1,\delta_JK_c\} min { 1 , δ J K c } .
Proof. Restart times are stopping times and every restart starts a fresh mixture of test supermartingales at 1 with a fresh index, so each test segment is a candidate in the sense of Proposition 23. Apply (i) of that proposition to all segments, (ii) to the segments that begin in the epoch, and (iii) to the segment running at its start, with e e e the earlier of its next restart and the epoch end.
A restart costs coverage, never safety, because it consumes a fresh index. The carried-over risk of (iii) lasts until the detector’s next alarm, so the detector bounds its duration by its detection delay when the change raises the candidate’s failure rate. A change that leaves the macro’s outcomes unchanged but improves live reasoning is invisible to a detector on macro outcomes; it can make a candidate useless without making it wrong. Appendix § 14 .§ 14.4.4 measures both effects on KQA-STREAM. In a simulation of discard-on-alarm with the lifetime ledger (Bernoulli likelihood-ratio wealth, r 1 = 0.95 r_1 = 0.95 r 1 = 0.95 , bad law at r 0 = 0.5 r_0 = 0.5 r 0 = 0.5 , δ = 0.05 \delta= 0.05 δ = 0.05 , α i ∈ { 0.5 , 0.9 , 0.97 } \alpha_i \in\{0.5, 0.9, 0.97\} α i ∈ { 0.5 , 0.9 , 0.97 } ), fresh segments fold in most 0.0003 of bad epochs (mean bound ∑ j > J δ j = 0.001 \sum_{j>J}\delta_j = 0.001 ∑ j > J δ j = 0.001 –0.009), and carried-over segments in 0.009–0.014 (mean bound E min { 1 , δ J K c } = 0.015 \mathbb{E}\min\{1,\delta_JK_c\} = 0.015 E min { 1 , δ J K c } = 0.015 –0.052), as (ii) and (iii) require.
What the restart-only certificate attains. For the j j j -th test of a template (restarts included) the threshold is ln ( 1 / δ j ) = ln ( 1 / δ ) + 2 ln j + ln ( π 2 / 6 ) \ln(1/\delta_j)=\ln(1/\delta)+2\ln j+\ln(\pi^2/6) ln ( 1/ δ j ) = ln ( 1/ δ ) + 2 ln j + ln ( π 2 /6 ) . With i.i.d. audited utilities of law P P P and the seven bets B \mathcal{B} B with weights 1 / 7 1/7 1/7 , the best bet in B \mathcal{B} B and Wald’s identity (factors in [ 0.1 , 1.9 ] [0.1,1.9] [ 0.1 , 1.9 ] because the code clips Z Z Z to [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] ) give an expected label count of at most
ln ( 1 / δ ) + 2 ln j + ln ( π 2 / 6 ) + ln 7 + ln 1.9 g B ( P ) \frac{\ln(1/\delta)+2\ln j+\ln(\pi^2/6)+\ln7+\ln1.9}{g_{\mathcal{B}}(P)} g B ( P ) ln ( 1/ δ ) + 2 ln j + ln ( π 2 /6 ) + ln 7 + ln 1.9
before the fold threshold is reached (ignoring the futility test), where g B ( P ) = max b ∈ B E P ln ( 1 + b Z ) g_{\mathcal{B}}(P)=\max_{b\in\mathcal{B}}\mathbb{E}_P\ln(1+bZ) g B ( P ) = max b ∈ B E P ln ( 1 + b Z ) is the growth of the best bet, and g B ≤ KL inf ( P ) g_{\mathcal{B}}\leq\operatorname{KL}_{\inf}(P) g B ≤ KL i n f ( P ) , with equality only if c ∗ ∈ B c^*\in\mathcal{B} c ∗ ∈ B . The restart-only certificate therefore does not attain the limit of Theorem 3 or Corollary 20 as δ → 0 \delta\to0 δ → 0 . It is a finite-candidate, finite-grid version of the idealized certificate, whose extra cost is the additive 2 ln j + ln ( π 2 / 6 ) + ln 7 + ln 1.9 2\ln j+\ln(\pi^2/6)+\ln7+\ln1.9 2 ln j + ln ( π 2 /6 ) + ln 7 + ln 1.9 and the factor KL inf / g B \operatorname{KL}_{\inf}/g_{\mathcal{B}} KL i n f / g B (1.03–1.07 on the three paired laws we checked).
Experimental details
Compute and software. All LLM runs used one NVIDIA RTX 4080 SUPER GPU (16 GB). Models were served with vLLM 0.30 (Kwon et al., 2023) (FlashAttention backend) and PyTorch 2.13 under Ubuntu 22.04. The 8B models were served with FP8 weights: Qwen3-8B-FP8 natively (Yang et al., 2025), and Granite-3.3-8B-Instruct (IBM Granite Team, 2025), Mistral-7B-Instruct-v0.3 (Jiang et al., 2023) and OLMo-3-7B-Instruct (Team OLMo, 2025) with on-the-fly FP8 quantization. Qwen3-4B ran in BF16. The natural-edit timeline used 4.75 GPU-hours and the code domain 17.2 GPU-hours of wall time. Mistral has no system role, so its system message is prepended to the first user turn. Granite-3.3’s chat template embeds the current date, so its prompts change with the calendar day; all Granite prompts were rendered with the date pinned to 2026-09-25, and prompt hashes confirm that this reproduces the main-run prompts exactly. Qwen3 “thinking” was disabled. Main-table decoding used T = 0.7 T=0.7 T = 0.7 , top-p p p 0.8, top-k k k 20, with a deterministic per-request seed. Every LLM request carries a content hash. Results are appended to checkpoint shards and skipped on restart, so all runs are resumable. Tables and figures are generated by script from the raw logs.
Mechanism computations. Run lengths of integer-score rules were computed by solving the Markov chain of the reflected walk. The gap of SPRT certification uses Lemma 10 with the exact sample-size distribution of the one-sided SPRT, obtained by dynamic programming on the lattice of log-likelihood-ratio values. Sums over templates run to 10 7 10^7 1 0 7 with rigorous tail brackets. The collapse grid crossed ( r 0 , r 1 ) ∈ { ( 0.85 , 0.95 ) , ( 0.6 , 0.9 ) , ( 0.3 , 0.7 ) } (r_0,r_1)\in\{(0.85,0.95),(0.6,0.9),(0.3,0.7)\} ( r 0 , r 1 ) ∈ {( 0.85 , 0.95 ) , ( 0.6 , 0.9 ) , ( 0.3 , 0.7 )} plus random pairs, verifier flip rates { 0 , 0.05 , 0.1 , 0.2 } \{0,0.05,0.1,0.2\} { 0 , 0.05 , 0.1 , 0.2 } , δ ∈ [ 10 − 32 , 0.03 ] \delta\in[10^{-32},0.03] δ ∈ [ 1 0 − 32 , 0.03 ] , audit rates p ∈ [ 0.03 , 1 ] p\in[0.03,1] p ∈ [ 0.03 , 1 ] (tabulated settings: p = 1 p=1 p = 1 , q ∈ { 10 − 5 , … , 10 − 1 } q\in\{10^{-5},\ldots,10^{-1}\} q ∈ { 1 0 − 5 , … , 1 0 − 1 } ), 10 drift rates for the random settings and s ∈ { 1.2 , 1.5 , 2 , 3 } s\in\{1.2,1.5,2,3\} s ∈ { 1.2 , 1.5 , 2 , 3 } . Plotted against x = ν / p x=\nu/p x = ν / p alone, the same points spread over two orders of magnitude at fixed x x x because of the ln ( 1 / δ ) / K L \ln(1/\delta)/\mathrm{KL} ln ( 1/ δ ) / KL factor. The literal-stream check simulated Poisson arrivals, audits with p ∈ { 0.2 , 0.3 , 0.5 , 1 } p\in\{0.2,0.3,0.5,1\} p ∈ { 0.2 , 0.3 , 0.5 , 1 } , Poisson changes and verifier flips, for 500–10 4 10^4 1 0 4 templates, and matched the exact formula within 0.51%.
Natural template streams. KQA Pro templates are the programs of the train and validation sets (106,173 questions) with entity names, strings, numbers and dates abstracted. Function, relation, attribute and concept names are kept, giving 45,544 templates. MuSiQue templates abstract each single-hop sub-question of the answerable training set (19,938 questions; 10,686 templates). We abstract the relation phrase after “≫ \gg ≫ ” when it is present, and otherwise the question with bridge entities replaced by placeholders. Exponents were estimated from rank-frequency data (Sibuya-type estimator on counts ≤ 10 \leq10 ≤ 10 ), from the Clauset–Shalizi–Newman tail fit, and from Heaps’ law. The Sibuya and Heaps estimators give s ∈ [ 1.15 , 1.26 ] s\in[1.15,1.26] s ∈ [ 1.15 , 1.26 ] for the fine-grained templates. The CSN tail fit gives s ^ ≈ 0.85 \hat{s}\approx0.85 s ^ ≈ 0.85 –0.88 with a poor goodness of fit on MuSiQue (p < 0.01 p<0.01 p < 0.01 ), so we do not use it. Coverage curves average 100 random stream orders.
KQA-STREAM construction. We index the KQA Pro knowledge base: 16,960 entities, 794 concepts, 363 relations (726 relation-direction types) and 415,702 directed edges. Our path executor agrees with the official KoPL engine on 600 sampled one- and two-hop programs (2,187 steps). A template is an anchor concept plus a relation path of 2–4 hops. It is kept if at least 60 anchors have 1–3 answers of a consistent concept, the path does not immediately backtrack, and no single answer covers more than half of the anchors. From 2,250 qualifying distinct paths we selected 300 templates (120/120/60 with 2/3/4 hops), covering 17 anchor concepts, 51 answer concepts and 114 relations, and sampled 60 anchors each (18,000 instances). A random pattern verbalizes each instance question; 296 of the 300 templates have three LLM-written patterns with a single entity slot (the rest have fewer valid patterns). An edit event replaces the object of a relation for a fraction f ∈ { 0.25 , 0.6 } f \in\{0.25, 0.6\} f ∈ { 0.25 , 0.6 } of the relevant subjects with a random entity of the same concept, keeping inverse edges consistent. Each of three sequences has 24 events. An event changes the gold answer of 223 (f = 0.25 f=0.25 f = 0.25 ) or 386 (f = 0.6 f=0.6 f = 0.6 ) instances on average and touches 3.9% of templates, which become 32% or 59% stale respectively. Templates that share an edited relation go stale together. The per-template change rate grows with derivation length (events that hit a 2/3/4-hop template: 2.7/4.2/5.5%; Spearman 0.34), which makes staleness itself a multi-step-reasoning phenomenon.
LLM paths. The live agent answers hop by hop. At each step its prompt contains the question, the linked anchor, the path so far, the current frontier (up to 5 entity names) and a numbered list of the (relation, direction) pairs available at the frontier (up to 60, sorted by frequency). It outputs JSON that either takes one hop or answers, with at most 5 hops, and may filter the final frontier by one of its concepts. The answer is the resulting entity set, and it is correct if it equals the gold set of the current knowledge-base version. For Qwen3-8B a live query uses 3.24 calls with 1,486 prompt and 62 completion tokens on average; on the unedited knowledge base its live accuracy is 0.625, 0.305 and 0.190 at 2, 3 and 4 hops (0.410 over all 18,000 instances). Routing , the one LLM step of a macro, retrieves the top-5 templates by BM25 over their verbalized patterns and asks the LLM for a template id or NONE. It runs against the full, fixed template catalog, so its outcome does not depend on the policy. Its accuracy is 0.939 for Qwen3-8B, and the correct template is among the top 5 for all but 40 of the 18,000 instances. The direct baselines use one call: a parametric answer without the knowledge base, or whole-path generation from the question and the BM25 top-60 relation directions, executed on the current version. For each call we log prompt and completion tokens and latency. After an edit, live traces are re-run only for instances whose earlier trace or gold path
touches an edited edge; all other traces are reused unchanged, which is exact because the agent’s inputs are unchanged. A brute-force re-run of all instances at versions 0, 8, 16, 24 of every sequence matched in all 216,000 comparisons.
Baselines and statistics
The ExpeL-style counter starts at importance 2, moves by ± 1 \pm1 ± 1 per audited success or failure and retires the macro at 0. The ACE-style counter keeps helpful and harmful tallies from audited outcomes and retires the macro when it would be flagged (harmful ≥ \geq ≥ helpful, harmful > 0 > 0 > 0 ). Fold once folds a verified candidate at formation and never retires it. A semantic cache keyed on question embeddings reduces to this policy behind our router. vCache’s per-request bound assumes i.i.d. prompts and has no retirement; Appendix § 14 .2.4 evaluates a re-implementation, which avoids staleness mainly by rarely answering from cache. No policy was tuned on the evaluation streams. The validation-gated Hebbian rule uses its published defaults (η = 0.1 \eta=0.1 η = 0.1 , λ = 10 − 3 \lambda=10^{-3} λ = 1 0 − 3 , τ = 0.85 \tau=0.85 τ = 0.85 , c 0 = 0.5 c_0=0.5 c 0 = 0.5 , fusion bonus 0.05). Our certificates use δ = β = 0.05 \delta=\beta=0.05 δ = β = 0.05 and a likelihood-ratio CUSUM with threshold h = 7 h=7 h = 7 and post-change failure rate max ( 1 − r ^ ∗ , q ^ 0 + 0.15 ) \max(1-\hat r^*,\hat q_0+0.15) max ( 1 − r ^ ∗ , q ^ 0 + 0.15 ) ; its in-control rate q ^ 0 \hat q_0 q ^ 0 is estimated from the candidate’s shadow labels. The betting certificate mixes seven fixed bets λ ∈ { 0.05 , 0.1 , 0.2 , 0.3 , 0.5 , 0.7 , 0.9 } \lambda\in\{0.05,0.1,0.2,0.3,0.5,0.7,0.9\} λ ∈ { 0.05 , 0.1 , 0.2 , 0.3 , 0.5 , 0.7 , 0.9 } with equal weights. Any fixed mixture is valid; the grid mixture of Appendix § 13 is needed only for the rate result. All defaults were fixed on synthetic tables before any real-LLM run. Risk ledger. The library holds at most one candidate or macro per template. The lifetime ledger tests the j j j -th test of a template, counted over the whole stream, at δ j = 6 / ( π 2 j 2 ) \delta_j=6/(\pi^2j^2) δ j = 6/ ( π 2 j 2 ) . The restart-only certificate adds restarts : the replay notifies it of every edit that changes the gold answer of an instance routed to a template, and a candidate under test then discards its wealth and shadow statistics and restarts with the next ledger index (Appendix § 13 .§ 2 ). By Proposition 23(iv) this satisfies Definition 1 when the certificate’s null changes only at notices (Appendix § 14 .5.1). The recommended deployment (“ours” in the main text) also drops the notified template’s folded macro or candidate and re-forms it under the ledger (invalidate + LR, Appendix § 14 .4.2). Without restarts, the engine never tells a policy that an edit has occurred, and a candidate keeps its betting wealth (or SPRT statistic) across edits. The ledger then still bounds by δ \delta δ the probability that a template ever folds a candidate that was at or below break-even at all its evaluations, and, given the history at the start of any epoch, the probability that a candidate formed in that epoch folds while bad. A candidate carried across an edit with wealth w w w is covered only by the conditional bound δ j w \delta_j w δ j w , so this variant does not satisfy Definition 1 in general. The per-candidate variants test each new candidate at a fresh level δ = 0.05 \delta= 0.05 δ = 0.05 . This gives per-candidate conditional validity only, because a template’s total fold risk grows with its number of candidates. Compiled plans were run with the restart-only certificate (restarts), with the ledger without restarts, and per candidate. The SpF columns count every fold event of a candidate whose reliability at the fold’s knowledge-base version is below the break-even r ⋆ r^\star r ⋆ of its template at that version (L = 20 m ˉ L = 20\bar{m} L = 20 m ˉ ), including candidates carried across edits (Appendix § 14 .3.3). Same information and tuning. Every policy sees the same queries, edits, audit coins and verifier labels; all certificates share δ \delta δ , the bet grid and h h h , and no threshold was tuned on the evaluation streams. Only our certificates receive edit notices: restart only uses them to restart candidates under test, ours also to invalidate, and Table 2 reports ours with every notice missed; Appendix § 14 .4.2 gives the notices to baselines that invalidate on them, and Appendices § 14 .4.1 and § 14 .4.3 report the answer-only safety replays and the decoding-variance subset. On Qwen3-8B the ledger without restarts lowers accuracy by 0.35 and 0.41 points relative to per-candidate testing and raises J 20 J_{20} J 20 by about 1% (betting: 0.646 → 0.643, J 20 J_{20} J 20 25.6 → 25.9; compiled + betting: 0.677 → 0.673, J 20 J_{20} J 20 23.4 → 23.7). On the other four models the change in accuracy ranges from −0.59 to +0.14 points. Restarts cost another 0.1–0.4 points on every model (Table 6 and Table 13 ). Paired differences use a 95% bootstrap clustered by template (the 300 templates are resampled) over the 10 seeds × 3 edit sequences. Each instance–version is decoded once per model, so these intervals do not include LLM sampling variance.
Table 13. The price of restarts: the restart-only certificate against the same lifetime ledger without restarts (paired differences with 95% template-bootstrap intervals; stale answers per 10 4 10^4 1 0 4 queries, SpF, folds and restarts per stream).
Replay setting. The replays fix the following setting. Audits reveal the gold answer of the current knowledge-base version at no LLM cost. Templates are given by the benchmark, and each has up to three verbalization patterns; routing errors enter every metric as measured losses (a misrouted macro answer counts as wrong) and are not modeled by the theory. A macro executes a verified relation path exactly, which is the main source of its accuracy gain over live reasoning; text notes and distilled models would need a costlier, noisier verifier. Each instance–version is decoded once per model, so intervals resample templates, streams and edit sequences, not decoding randomness (measured separately in Appendix § 14 .4.3), and calls and latencies are reconstructed from the recorded requests. The main edits are synthetic but structured: correlated across templates that share a relation, and more frequent for longer derivations; Appendix § 14 .4.4 adds a natural timeline and Appendix § 14 .§ 6 a code domain with an exact verifier. Edit notices list the templates whose gold answers change; changes of live reasoning are not announced (Appendix § 14 .5.1). Two comparisons are deliberately narrow. Compiled plans re-execute a stored path on the current facts; when such re-execution is cheap it can dominate caching the result, and Table 3 reports this baseline. The VCache-style cache stores unverified live answers, so on this benchmark it inherits live accuracy (Appendix § 14 .2.4); a verified exact-repeat cache is evaluated in Appendix § 14 .4.2. The fundamental limit concerns candidates informed by the outcomes of their own template; transfer across correlated templates, or a macro that a change does not affect, lies outside its model.
Completed coverage and validation. The final analysis includes all five models, three edit sequences and ten seeds, with 57,750 distinct configuration–seed checkpoints after deduplicating identical effective settings. Every checkpoint and its trace-derived summary passed completion and version checks. Recomputing the 80 primary model–policy cells reproduces the exported mean accuracy, calls and J 20 J_{20} J 20 . Paired differences use per-candidate betting + LR–CUSUM as the reference, except the price of restarts (Table 13 ), which is paired against the same ledger without restarts.
All policies and all models. Table 5 adds to Table 3 one-call path generation, the validation-gated Hebbian rule with time decay, and compiled plans certified by the plug-in SPRT. Hebbian decay almost never folds, because its time-to-live starves all but the most popular templates (Appendix A). Table 6 gives accuracy, calls and J 20 J_{20} J 20 for all five models.
Where the accuracy comes from. On Qwen3-8B (Table 3 ), reuse without certification (fold once) adds 15.5 points over live reasoning for macros and 26.1 for compiled plans. Certification with retirement and restarts adds 10.7 and 2.9 more and cuts stale answers 20× and 6×; over the counters, which reuse and retire too, it adds 2.3–2.9. Reuse helps this much because a macro executes a verified relation path symbolically, whereas the live agent re-derives it with a noisy LLM at 38% accuracy. For text or distilled macros this advantage need not hold, so we regard the accuracy gain as specific to this benchmark and the staleness result as the transferable one. On OLMo-3-7B the certificate uses more calls than live reasoning (2.39 → 2.68; Table 6 ). Stale counts also depend on how much a policy folds: SPRT + symmetric serves 20 stale answers per 10 4 10^4 1 0 4 queries against restart only’s 66 on Qwen3-8B, but answers 43% of queries in one step against 51%. This is why the main text compares retirement rules on a matched population (Appendix § 14 .3.2).
Natural template streams
We extracted derivation templates from 106k KQA Pro programs (Cao et al., 2022) and 19.9k MuSiQue decompositions (Trivedi et al., 2022), with entities and values abstracted (details above). Both are heavy-tailed: the Sibuya-type estimator gives s ^ = 1.26 \hat{s}=1.26 s ^ = 1.26 and Heaps’ law s ^ = 1.15 \hat{s}=1.15 s ^ = 1.15 on both corpora. The static branch of Theorem 14 therefore predicts that coverage improves only as T − ( 0.13 − 0.21 ) T^{-(0.13-0.21)} T − ( 0.13 − 0.21 ) , as observed (Figure 4 ): slopes at n 0 = 1 n_0=1 n 0 = 1 are −0.16 (KQA Pro) and −0.18 (MuSiQue), steepening to −0.19 and −0.21 late in the stream. The Good–Turing estimator of
Figure 4. MuSiQue templates: measured coverage gap (markers; mean of 100 stream orders), fitted Zipf law (dashed) and online Good–Turing forecast (solid) for certification sample sizes n 0 n_0 n 0 .
the rare mass ((Good, 1953; Orlitsky et al., 2016)), M ^ ( T ) = ∑ k ≤ n 0 k K k ( T ) / T \widehat{M}(T)=\sum_{k\le n_0} kK_k(T)/T M ( T ) = ∑ k ≤ n 0 k K k ( T ) / T with K k K_k K k the number of templates seen k k k times, predicts the gap online with a median relative error of 0.4–3.4% (2.1–3.4% at n 0 = 1 n_0=1 n 0 = 1 ), without knowing s s s . Raising the certification sample size n 0 n_0 n 0 slows contraction by C s , n 0 / C s , 1 ≈ n 0 − 1 / s / Γ ( 2 − 1 s ) C_{s,n_0}/C_{s,1}\approx n_0^{-1/s}/\Gamma(2-\frac{1}{s}) C s , n 0 / C s , 1 ≈ n 0 − 1/ s /Γ ( 2 − s 1 ) . These streams test the demand side of the theory without an LLM in the loop.
Learning rates, counters, noisy verifiers and a semantic cache
These experiments replay the recorded KQA-Stream outcome tables of the five models; no LLM is called. They use the main setting (200k queries, Zipf s = 1.2 s=1.2 s = 1.2 , Poisson edits at rate 28 / T 28/T 28/ T so that nearly all 24 edit events of a sequence occur, uniform audits p = 0.1 p=0.1 p = 0.1 , L = 20 L=20 L = 20 ) with three edit sequences and ten seeds, i.e. 30 runs per cell. Intervals are 95% bootstraps that resample the 300 templates (1000 resamples), pooled over sequences and seeds, and paired differences use the same template bootstrap as the main text. Here ours is betting + LR-CUSUM at the per-candidate level; it reproduces the per-candidate row of Table 3 exactly (Qwen3-8B: accuracy 0.646, J 20 J_{20} J 20 25.58, 76 stale answers per 10 4 10^4 1 0 4 ).
Definitions. A false retirement (FR) is the retirement of a macro whose true reliability is still ≥ r ⋆ \ge r^\star ≥ r ⋆ ; we count them per 10 4 10^4 1 0 4 folded uses of such healthy macros. The detection delay of a stale episode is the number of folded uses from its onset, the version at which a macro folded while healthy drops below r ⋆ r^\star r ⋆ , to its retirement. Episodes still open at the end of a stream contribute their uses so far, so delays are lower bounds; Appendix § 14 .3.1 gives censoring-aware estimates. At a matched FR , each rule’s delay and stale answers are interpolated linearly in log FR along its threshold grid, at the FR∗ ^{*} ∗ of our LR-CUSUM at its default h = 7 h = 7 h = 7 . Matching uses the true reliabilities. This makes the comparison of detectors fair, but it is not a deployable tuning procedure.
Learning-rate sweep
Rules. A fixed-ratio rule keeps our betting certificate and retires with the clipped score + 1 +1 + 1 per audited failure and − 1 / k -1/k − 1/ k per audited success, retiring at S > h S > h S > h , for k ∈ { 0.1 , 0.25 , 0.5 , 0.75 , 1 , 2 , 3 , 5 , 7 , 10 , 15 , 25 } k \in\{0.1, 0.25, 0.5, 0.75, 1, 2, 3, 5, 7, 10, 15, 25\} k ∈ { 0.1 , 0.25 , 0.5 , 0.75 , 1 , 2 , 3 , 5 , 7 , 10 , 15 , 25 } and 15 thresholds h ∈ [ 0.5 , 80 ] h \in[0.5, 80] h ∈ [ 0.5 , 80 ] . Ours is the same except that the score is the log-likelihood ratio of the macro’s own estimated q ^ 0 \hat{q}_0 q ^ 0 against max ( 1 − r ^ , q ^ 0 + 0.15 ) \max(1-\hat{r}, \hat{q}_0 + 0.15) max ( 1 − r ^ , q ^ 0 + 0.15 ) . The failure rates q 0 q_0 q 0 and q 1 q_1 q 1 of Table 7 are the true failure rates (1 − reliability 1-\text{reliability} 1 − reliability , including routing errors) of the stale episodes of our policy, q 0 q_0 q 0 at the fold version and q 1 q_1 q 1 at the onset version. The prediction 1 / ρ ( q ˉ 0 , q ˉ 1 ) 1/\rho(\bar{q}_0, \bar{q}_1) 1/ ρ ( q ˉ 0 , q ˉ 1 ) uses their means.
Table 7. Learning-rate sweep on KQA-STREAM. Episodes: stale episodes over 30 runs. q 1 > 1 2 q_1 > \frac{1}{2} q 1 > 2 1 : share of stale episodes with q 1 > 0.5 q_1 > 0.5 q 1 > 0.5 . P ( arg min ) P(\operatorname{arg\,min}) P ( arg min ) : bootstrap frequency of the empirical optimum. Best k k k : the fixed ratio with the lowest delay at matched FR over all tested k k k , and with the fewest stale answers over k ≥ 1 k \ge1 k ≥ 1 . Ours: per-macro LR-CUSUM (per-candidate certificate). Delays are naive means over censored episodes. Bold: ours.
Results. Staleness on these streams is nearly total, not partial: 86–97% of stale episodes have q 1 > 0.5 q_1 > 0.5 q 1 > 0.5 (Table 7 ). The predicted weights 1 / ρ 1/\rho 1/ ρ are therefore 0.67–2.14, not 7. On four of five models the delay at matched FR is smallest below k = 1 k = 1 k = 1 (k = 0.1 k = 0.1 k = 0.1 –0.75), consistent with the ordering of the prediction, and it grows with k k k above 1; k = 7 k = 7 k = 7 is 1.3–2.5× slower than the best tested ratio on these models (Figure 5 ). Below 1 the curves are flat, so the optimum there is not sharply identified. Qwen3-8B is the exception: its curve is flat for k ≥ 5 k \ge5 k ≥ 5 and worse at k ≤ 2 k \le2 k ≤ 2 , and the bootstrap spreads its optimum over k = 25 k = 25 k = 25 , 5 and 10. The larger effect is not the tuning of k k k . The per-macro LR-CUSUM detects 1.3–5.9× faster than each model’s best tested fixed ratio (paired intervals exclude 1 on Qwen3-8B, Qwen3-4B and OLMo-3-7B; Appendix § 14 .§ 14.4.6 ) and serves 1.7–2.5× fewer stale answers than the fixed ratio k ≥ 1 k \ge1 k ≥ 1 with the fewest. Every fixed ratio at k = 7 k = 7 k = 7 is significantly slower than ours, and at k = 1 k = 1 k = 1 this holds on three of five models (paired intervals exclude 0). Healthy failure rates are heterogeneous: their medians (0–0.21) lie far below their means. We interpret this, without a direct test, as the reason why one global ratio cannot be likelihood-ratio tuned for all macros at once, whereas the per-macro rule adapts q ^ 0 \hat{q}_0 q ^ 0 to each macro. The first-order delay curve follows the rising trend on Granite, Mistral and OLMo but not on Qwen3-8B. At k = 1 k = 1 k = 1 it underestimates the measured delays by 2.3–17×, and at larger k k k it leaves the logarithmic regime on three models. With the episode-median in place of the mean ( q 0 , q 1 ) (q_0, q_1) ( q 0 , q 1 ) the predicted weights are 0.51–3.01. With only 17–81 stale episodes per model the intervals are wide, and only the large differences are resolved.
Counters in the main setting
ExpeL- and ACE-style counters serve 294–967 stale answers per 10 4 10^{4} 1 0 4 queries (7–13× ours), fold 111–595 spurious macros per run (ours: at most 1.7), and have 10–35 false retirements per 10 4 10^{4} 1 0 4 (ours: 1.8–3.4) with naive mean delays of 307–478 uses (ours: 54–84; lower bounds, see Appendix § 14 .3.1). Their J 20 J_{20} J 20 , however, is not significantly different from ours on any model, and their accuracy is significantly lower only on Qwen3-8B (Table 8 ). The reason is coverage, as the price of safety of Section 4 suggests: the counters skip certification and answer 28–76% of queries in one step, against 21–53% for the restart-only certificate and 20–53% for ours (recommended), so they make fewer LLM calls (e.g. 1.75 and 1.86 against 2.57 on Qwen3-8B, Table 3 ), and in J 20 J_{20} J 20 this saving roughly offsets their stale and spurious answers. The labels-to-fold slowdown is the mean over templates of the number of audited shadow labels a candidate needs before it folds, relative to the uncorrected certificate at ε = 0 \varepsilon= 0 ε = 0 .
Table 8. Main setting: paired differences of the counters against ours (betting + LR-CUSUM, per-candidate level), with 95% template-bootstrap intervals; positive Δ J 20 \Delta J_{20} Δ J 20 is worse. Only the counters’ accuracy on Qwen3-8B differs significantly.
A noise-aware certificate
Setup. Noisy verifiers are the next step named in the Limitations; this experiment measures where the current certificate stands. Each audited judgement (of the live answer, the macro and any other evaluated answer) is flipped independently with probability ε \varepsilon ε . The noisy live verdict also decides which traces count as verified when candidates are formed. The noise-aware variant bets on the paired utility of the observed channel, X = ( 1 − 2 ε ) ( m − 1 ) + L ( Y ~ m − Y ~ L ) X = (1 - 2\varepsilon)(m - 1) + L(\tilde{Y}^{m} - \tilde{Y}^{L}) X = ( 1 − 2 ε ) ( m − 1 ) + L ( Y ~ m − Y ~ L ) , and maps the CUSUM’s alternative into the observed channel, q 1 = max ( ε + ( 1 − 2 ε ) ( 1 − r ⋆ ) , q 0 + 0.15 ( 1 − 2 ε ) ) q_1 = \max(\varepsilon+ (1 - 2\varepsilon)(1 - r^\star), q_0 + 0.15(1 - 2\varepsilon)) q 1 = max ( ε + ( 1 − 2 ε ) ( 1 − r ⋆ ) , q 0 + 0.15 ( 1 − 2 ε )) , with live accuracy corrected as a = ( a o b s − ε ) / ( 1 − 2 ε ) a = (a_{\mathrm{obs}} - \varepsilon)/(1 - 2\varepsilon) a = ( a obs − ε ) / ( 1 − 2 ε ) . It uses either the true ε \varepsilon ε or an estimate from a simulated clean calibration subset of 200 items, drawn per sequence and seed (mean estimates 0.054, 0.103 and 0.201). It corrects the certificate and the CUSUM, not the formation of candidates.
Results (negative). Certification slows faster than ( 1 − 2 ε ) − 2 (1 - 2\varepsilon)^{-2} ( 1 − 2 ε ) − 2 (Table 9 ): the labels-to-fold slowdown is 1.88, 2.56 and 3.67 at ε = 0.05 \varepsilon= 0.05 ε = 0.05 , 0.1 and 0.2, against 1.23, 1.56 and 2.78 predicted, and the slowdown in key-queries is larger still (2.15, 3.20, 5.05). The prediction is for a single-label test; our certificate bets on the difference of two noisy labels. The noise-aware variant, with known or estimated ε \varepsilon ε , is indistinguishable from the uncorrected certificate on accuracy, stale answers and spurious folds, and nearly every per-model accuracy interval contains 0. Noise does not inflate spurious folds (0.71 per run clean, 0.12–0.27 noisy), because far fewer candidates fold at all. What dominates is the loss of accuracy for every variant (0.436 to 0.279 at ε = 0.2 \varepsilon= 0.2 ε = 0.2 ), driven by slower certification and by macros formed from falsely verified live traces, neither of which the correction addresses. Counter rules, which fold nearly everything, keep their accuracy under noise (Qwen3-8B, 15 streams: .592 → .575 and .597 → .580 at ε = 0.2 \varepsilon= 0.2 ε = 0.2 ) but fold more spurious macros (ExpeL 271 → 385, ACE 377 → 601 per stream). A certificate built for the noisy paired channel is left to future work.
Table 9. Noisy verifier, per-candidate betting, means over the five models (30 streams each; at ε = 0 \varepsilon= 0 ε = 0 the mean of the per-candidate column of Table 6 ). Stale: per 10 4 10^4 1 0 4 queries. SpF: spurious folds per run. Slowdown: audited labels a candidate needs before it folds, relative to ε = 0 \varepsilon= 0 ε = 0 . Bold: ours (all rows).
A vCache-style semantic cache
Re-implementation. We re-implemented vCache from Algorithms 1–2 of its paper (Schroeder et al., 2026); the following details are our design choices. A query is looked up against the nearest cached question by cosine similarity (ties go to the newest entry). Each entry fits a sigmoid of similarity by ridge-penalized logistic maximum likelihood (λ = 10 − 3 \lambda= 10^{-3} λ = 1 0 − 3 ), with a delta-method upper confidence bound on its threshold. The exploration probability is the minimum of the paper’s Eq. 11 over a grid of 49 values of its error parameter, and 1 while an entry has no observations. An exploration answers live, evaluates the cached answer in shadow at no cost, and adds the query to the cache only if the cached answer was judged wrong; an exploitation returns the cached answer with no LLM call, and embedding compute is not charged. Labels are vCache’s own (agree : cached answer equals the live answer) or gold correctness on audited queries (audit ). There is no retirement. The plug-in variant uses the point estimate without the confidence band, which is optimistic. The vCache paper used GTE-large, E5-large-v2 and OpenAI embeddings. None was available offline, so we use all-MiniLM-L6-v2 (384 dimensions), with TF-IDF as a sensitivity check; the median nearest-neighbour similarity over the 17,927 unique questions is 0.81 (MiniLM) and 0.66 (TF-IDF). A faithful replication would need a 1024-dimensional embedding and the authors’ code to confirm the confidence band. A cache hit on a different question counts as stale if the cached answer would have been correct for that query when the entry was formed.
Results. With its confidence band, vCache serves only 6–26% of queries from cache for δ c = 0.01 \delta_c = 0.01 δ c = 0.01 –0.05, and 3% with audited labels. Its accuracy equals live accuracy, and its J 20 J_{20} J 20 is 9.2–30.7 worse than ours on every model (Table 10 ). TF-IDF embeddings give similar results. The reason is that this cache stores earlier live answers without verifying them, so here it inherits live accuracy (0.08–0.38), whereas a certified macro re-executes a verified derivation (our accuracy 0.25–0.65). A cache that stores only verified answers was tested for exact repeats (with notice invalidation; Appendix § 14 .4.2): it serves almost no stale answers but stays at live accuracy, because it answers only 13% of queries in one step; a verified semantic cache remains untested. Removing the confidence band raises the hit rate to about 85%, but accuracy falls below live and stale answers rise to 100–536 per 10 4 10^4 1 0 4 . vCache’s δ c \delta_c δ c bounds disagreement with the LLM, not error against gold: 62–92% of its hits are wrong against gold, mirroring live accuracy. An exact-question answer cache beats vCache on J 20 J_{20} J 20 but is still 7.7–27.0 worse than ours. Cache hits are charged no LLM call, which favours the caches.
Table 10. vCache-style cache (MiniLM, agree labels). Hits: share of queries served from cache. Δ J 20 \Delta J_{20} Δ J 20 : against ours (per-candidate betting); all intervals exclude 0. Stale: per 10 4 10^4 1 0 4 queries. Our accuracy is .646, .553, .447, .250 and .283.
Censoring, per-epoch safety and per-memory weights
These replays reuse the recorded outcome tables of the five models in the main setting (30 streams per model and policy); no LLM is called. Intervals are 95% template-clustered bootstraps (1000 resamples); pooled rows resample templates jointly across models.
Censoring-aware detection delays
A stale episode starts when a macro that was above break-even at its fold drops below r ⋆ r^\star r ⋆ after an edit; its onset is the first query of that version. Retirement is the event, and the end of the 200k-query stream censors the episode. The delay is the number of folded uses from onset to retirement, as in Appendix § 14 .§ 2 . We estimate the survival function by Kaplan–Meier. The restricted mean delay within a window w w w is E min ( T , w ) \mathop{\mathrm{E}}\min(T,w) E min ( T , w ) , and “unretired at stream end” is the censored share. This closed-loop analysis covers our LR-CUSUM retirement with the per-candidate certificate and with the SPRT; each rule has its own population of stale episodes. Appendix § 14 .3.2 compares the rules on one matched population, including the restart-only certificate.
On the audited-use clock the restricted means within 10 3 10^3 1 0 3 audited uses are 7.6 (betting), 10.4 (SPRT), 299.9 (ExpeL-style) and 257.6 (ACE-style), with medians of 5, 5, 37 and 21 audited uses. The censored episodes of the LR-CUSUM are onsets near the end of a stream (at most 192 folded uses of follow-up), whereas the counters’ censored episodes include some with 39,467 uses. Per model the counters leave 28–69% of their own stale episodes unretired at stream end (Table 2 gives the matched population). The naive mean delay of Figure 6 counts an open episode with its uses so far. It is therefore a lower bound: 363 and 366 uses for the counters, 7–8× below their restricted means.
Detection on a matched population
The comparison above uses different populations: the counters fold every candidate, so their 1,954 and 1,865 stale episodes include many macros that a certificate would never fold, whereas the LR-CUSUM rows contain 212. Here all rules see the same macros and the same audits. Every macro that a certified policy folded (the restart-only certificate, or per-candidate betting) is replayed open loop from its fold to the end of the stream, on its own audited label stream (the same audit coins; labels of its build instance withheld), under each retirement rule started at the fold: its own LR-CUSUM (reproducing the closed-loop retirement of all 7,385 and 9,448 folded macros exactly), the ExpeL-style rule (importance 2 at the fold) and the ACE-style rule. Counters therefore bank no credit from the shadow phase, which favours them. Stale onset is defined without retirement; spurious folds are excluded. Population. The restart-only certificate makes 7,385 folds over the 150 streams; the 43 spurious ones (below r ⋆ r^\star r ⋆ at the fold version) are not stale episodes. A matched stale episode is a fold above r ⋆ r^\star r ⋆ whose macro is below r ⋆ r^\star r ⋆ at a later version before the stream ends: there are 221. Some rule retired 65 of them before onset (LR-CUSUM 47, ExpeL 27, ACE 41; 24 by the LR-CUSUM alone and 11 by ACE alone), and an episode retired before it began cannot be compared, so the common population is the remaining 156 (49 templates, 25 edited relations, 34 edit events, 3 sequences). Code: paper_figs/acl3_matched.py.
Results. Pooled, the counters leave 50.0% [38.2, 62.8] and 47.4% [36.3, 60.2] of the episodes unretired at stream end, against 1.9% [0.0, 4.7] for the LR-CUSUM (Table 12 , Figure 2 ). Their restricted mean delays are 4,069 [2,924, 5,448] and 3,949 [2,830, 5,296] uses against 67 [46, 99], ratios 60.8 [44.7, 87.1] and 59.1 [43.7, 83.7] (paired template bootstrap, 2,000 resamples; the ratio is computed in each resample); KM medians are 1,750, 1,303 and 43 uses, and on the audited clock the restricted means within 10 3 10^3 1 0 3 audits are 403, 391 and 6.6. Each episode costs 1,359 and 1,346 stale wrong answers under the counters, against 38.5. The ratio interval excludes 1 for Qwen3-8B (49×), Qwen3-4B (95×, 90×) and Granite (75×, 74×); Mistral (8 episodes) and OLMo (11) are not resolved. The matched population thus confirms the closed-loop picture of Table 11 , with a larger gap in delay.
Table 11. Censoring-aware detection, pooled over five models (150 streams per rule). RM delay: restricted mean delay within 10 4 10^4 1 0 4 folded uses; median: Kaplan–Meier median (folded uses). Bold: ours.
Table 12. Matched-population detection: stale episodes of the macros folded by the restart-only certificate (last row: by per-candidate betting), replayed open loop under each retirement rule with identical audits; 30 streams per model. The OLMo LR-CUSUM value comes from one censored episode with long follow-up. Bold: ours.
Robustness of the 60×. Episodes of one template, relation or edit event are correlated, so we also resample these clusters. The ExpeL/LR ratio is 60.8 with 95% intervals [44.7, 87.1] clustered by template, [44.5, 91.0] by edited relation and [41.1, 90.0] by edit event (ACE/LR: 59.1; [43.7, 83.7], [43.1, 89.3], [40.1, 86.6]). With only three edit sequences, sequence clustering is coarse ([31.2, 93.4]); the ratio is 93, 31 and 89× on sequences 101, 202 and 303 alone and 46–92× when one sequence is left out. Without the exclusion, i.e. on all 221 matched episodes with pre-onset retirements counted as zero delay, the ratio is 63.5 [46.9, 88.4] (58.9 for ACE), with 40.7%, 37.6% and 3.2% unretired.
Per-epoch safety
A template epoch is a run, a routed template and an interval between edits that change the gold answer of some instance routed to that template. A false fold is a fold of a candidate whose true reliability (over all instances routed to the template, at stream popularity) is below r ⋆ r^\star r ⋆ at the fold version; this is the SpF event of Table 2. An epoch is at risk if a candidate that is below break-even at some version of the epoch is under test in it, and the per-epoch false-fold frequency is the share of at-risk epochs with at least one false fold. A false fold is carried over if the candidate formed in an earlier epoch.
This subsection uses the standard scoring; Appendix § 14 .4.1 repeats the analysis with answer-only scoring, which the main text reports (Figure 3 ).
Results. At δ = 0.05 \delta= 0.05 δ = 0.05 the per-epoch false-fold frequency is 0.007 [0.005, 0.010] for the SPRT and 0.006 [0.003, 0.010] for betting, both at a fresh level per candidate, 0.005 [0.003, 0.007] for betting with the lifetime ledger and 0.002 [0.001, 0.004] for the restart-only certificate with restarts; all stay below δ \delta δ for every δ ≤ 0.5 \delta\le0.5 δ ≤ 0.5 (Figure 7 ). Carried-over folds are 40 of 106 false folds for per-candidate betting (16 by candidates that were good at formation), 32 of 70 with the ledger (11), 62 of 87 for the SPRT (50), and 6 of 43 with restarts (0). Table 13 gives the price of restarts per model.
Figure 7. Standard scoring (routing errors count as wrong answers): share of at-risk epochs with a task-level bad fold (reliability below r ⋆ r^\star r ⋆ ) for five certificates; the dotted line y = δ y=\delta y = δ is a reference line , not a guarantee for these curves. Proposition 23(iv) bounds by δ \delta δ only folds that violate a certificate’s own null (paired utility ≤ 0 \le0 ≤ 0 ; Figure 3), and per epoch only for the restarted certificate (blue), when notices cover every change of that null; the per-candidate variants are valid per candidate, the ledger without restarts over a template’s lifetime, and the no-notice variant for folds on post-change evidence (Proposition 25). Five models, 150 streams per policy and δ \delta δ , 95% template-bootstrap intervals.
The scoring convention behind most false folds. KQA-Stream scores a macro answer as correct only if the query was also routed to the right template, and a template’s true reliability averages over every query routed to it, including misrouted ones. The certificate instead tests the paired utility of its own shadow evaluations. The two notions of “bad” disagree for some candidates: at δ = 0.05 \delta= 0.05 δ = 0.05 , 91 of the 106 false folds of per-candidate betting and all 43 of the restart-only certificate have a positive exact paired-utility drift, so by the test’s own criterion these candidates were useful. Among candidates that are bad under the test’s own null at every version after formation, none folds (0 of 8,434 for per-candidate betting and 0 of 8,084 for the restart-only certificate). Scoring macro answers by the answer alone removes this convention. With answer-only scoring, every remaining false fold of per-candidate betting (15) is carried over by a candidate that was good at formation, which is exactly the event that restarts remove.
Restarts without edit notices
The restart-only certificate restarts a candidate when the replay reports an answer-changing edit of its template. The no-notice certificate (discard on alarm ; “no notice” in Tables 1 and 3) receives no edit information. It runs, on every candidate under test, the retirement detector of its folded macros: a Bernoulli LR-CUSUM on the candidate’s audited shadow outcomes with q ^ 0 \hat{q}_0 q ^ 0 from the current test segment (estimated before each label), q 1 = max ( 1 − r ^ ⋆ , q ^ 0 + 0.15 ) q_1 = \max(1-\hat{r}^{\star}, \hat{q}_0 + 0.15) q 1 = max ( 1 − r ^ ⋆ , q ^ 0 + 0.15 ) and h = 7 h = 7 h = 7 . On an alarm it discards the candidate, and the template’s next candidate forms from a later verified live trace. A retired macro is removed, so its successor starts a fresh test. Proposition 25 covers this rule: a fold is spanning if its test segment began before the edit that opened the fold’s epoch, the event that (iii) of that proposition bounds.
Results. Discard-on-alarm has bad folds in 0.0008 0.0008 0.0008 [0.0003 0.0003 0.0003 , 0.0014 0.0014 0.0014 ] of at-risk epochs at δ = 0.05 \delta= 0.05 δ = 0.05 (9 of 11,375), against 0.0025 0.0025 0.0025 [0.0011 0.0011 0.0011 , 0.0043 0.0043 0.0043 ] for the restart-only certificate (29 of 11,670), and raises accuracy by 1.3 points [0.8, 2.0] and lowers J 20 J_{20} J 20 by 1.06 [0.63, 1.60] relative to it (Table 14). All 9 of its bad folds are spanning folds of candidates that were good at formation, and all 9 are bad under the test’s own null, so they are exactly the residual risk of Proposition 25(iii); no fold rests on post-change evidence of a bad candidate (0 of 13,935 candidates that are bad under the test’s own null at every version after formation fold). The restart-only certificate’s 29 epochs come from the scoring convention above (all with a positive test drift). Spanning folds are frequent (1,174 of 7,766 folds), but the edit left all but 9 of these candidates good. Retirement is unchanged: 195 stale episodes with 5.1% censored and a mean delay of 68.0 uses, against 174, 4.0% and 68.0. The accuracy gain is positive on every model, because an alarm replaces a candidate whose cached answers broke by one formed on the current facts, while a restarted candidate keeps its stale answers. At every tested level δ ∈ { 0.01 , 0.05 , 0.2 , 0.5 } \delta\in\{0.01, 0.05, 0.2, 0.5\} δ ∈ { 0.01 , 0.05 , 0.2 , 0.5 } , discard-on-alarm has fewer bad-fold epochs than the restart-only certificate (0.0003–0.0040 against 0.0018–0.0054; Figure 7) and 1.1–1.3 more accuracy points.
Partial staleness on real streams
Half of the edits of each sequence change 25% of the affected subjects (f = 0.25 f = 0.25 f = 0.25 ), and some of them leave a macro partially stale. We test the phase diagram on these episodes open loop: every macro that per-candidate betting folds is re-scored on its full audited label stream from its fold to the end of the stream (9,448 macros over the five models). Ground truth is the macro’s exact failure rate q v = 1 − R v q_v = 1 - R_v q v = 1 − R v at each knowledge-base version. An episode starts at the first version after the fold at which q q q rises by at least 0.1 over its value q 0 q_0 q 0 at the fold, has failure rate q 1 q_1 q 1 there, and ends at the next version at which q q q moves by more than 0.02, or at the stream end. We keep episodes with q 0 ∈ [ 0.02 , 0.15 ] q_0 \in[0.02, 0.15] q 0 ∈ [ 0.02 , 0.15 ] , since with q 0 = 0 q_0 = 0 q 0 = 0 every rule can alarm at the first failure without false alarms, and call them partial if q 1 ∈ [ 0.15 , 0.5 ] q_1 \in[0.15, 0.5] q 1 ∈ [ 0.15 , 0.5 ] and near-total if q 1 > 0.5 q_1 > 0.5 q 1 > 0.5 . Each rule restarts at the change (Lorden’s worst case for a CUSUM); its delay is the number of folded uses from the change to its alarm, censored at the episode end, summarized by the Kaplan–Meier mean restricted to 1,000 uses. Thresholds are matched to 1, 3 and 10 false alarms per 10 4 10^4 1 0 4 healthy uses, measured on the uses between fold and change of all folded macros with q 0 q_0 q 0 in the same band. Intervals are 95% template-clustered bootstraps with thresholds re-matched in every resample.
Table 14. Discard-on-alarm (no edit notices) against the restart-only certificate (edit-notified restarts), δ = 0.05 \delta= 0.05 δ = 0.05 : paired differences with 95% template-bootstrap intervals; share of at-risk epochs with a bad fold (no notice / restart only); detector alarms per stream; stale answers per 10 4 10^4 1 0 4 queries (no notice ← restart only).
Results. Of the 2,076 single-change episodes, 217 are partial episodes in the band (63 templates; 32–53 per model) with mean q 0 = 0.067 q_0 = 0.067 q 0 = 0.067 and q 1 = 0.331 q_1 = 0.331 q 1 = 0.331 , for which Corollary 2 predicts the failure weight 1 / ρ = 4.8 1/\rho= 4.8 1/ ρ = 4.8 . At 1 false alarm per 10 4 10^4 1 0 4 healthy uses the best tested weight is 7 (195 uses [152, 246]); the delay is U-shaped in the weight, as the efficiency (3) predicts: the symmetric rule is 1.49× [1.18, 1.82] slower and detects 90% of the episodes within 1,000 uses (weight 7: 99.8% and weight 25 is 2.09× [1.71, 2.65] slower (Figure 8 ). At 3 and 10 false alarms the best weight is 5, and the symmetric rule is 1.22× [1.03, 1.50] and 1.29× [1.04, 1.45] slower. In the bootstrap the best weight is 5 or 7 in 98.6%, 93.2% and 46.3% of re-samples at the three rates (3: 52.5% at the highest rate). On the 170 near-total episodes of the same band (mean q 1 = 0.690 q_1 = 0.690 q 1 = 0.690 , predicted 1 / ρ = 2.0 1/\rho= 2.0 1/ ρ = 2.0 ) the optimum moves down to 3–5 and the symmetric rule is within 1.04–1.19× of it (intervals contain 1), so the advantage of failure-heavy weights is specific to partial staleness, as Theorem 1 predicts. The per-memory LR-CUSUM tuned at the low end q 1 = q ^ 0 + 0.15 q_1 = \hat{q}_0 + 0.15 q 1 = q ^ 0 + 0.15 (Proposition 8) is within 1.21× [0.90, 1.64] of the best fixed weight; the deployed LR-CUSUM, tuned for a drop below break-even (q 1 = max ( 1 − r ^ ∗ , q ^ 0 + 0.15 ) q_1 = \max(1 - \hat{r}^{*}, \hat{q}_0 + 0.15) q 1 = max ( 1 − r ^ ∗ , q ^ 0 + 0.15 ) ), is 1.59× [1.20, 2.16] slower on these smaller changes, for which it is not tuned.
Figure 8. Partial staleness on real streams: delay (Kaplan–Meier mean within 1,000 uses) of fixed-weight counters against the failure weight k k k at 1 false alarm per 10 4 10^4 1 0 4 healthy uses (95% template-bootstrap bands), with the weight 1 / ρ 1/\rho 1/ ρ predicted by Corollary 2 from the mean failure rates. Left: 217 partial episodes (q 1 ∈ [ 0.15 , 0.5 ] q_1 \in[0.15, 0.5] q 1 ∈ [ 0.15 , 0.5 ] ); right: 170 near-total episodes; both with q 0 ∈ [ 0.02 , 0.15 ] q_0 \in[0.02, 0.15] q 0 ∈ [ 0.02 , 0.15 ] .
Per-memory weights against the best fixed ratio
The learning-rate sweep of Appendix § 14 .2.1 compares the per-memory LR-CUSUM with fixed-ratio counters on the same certificate, closed loop, at matched false retirements (Table 7 ). Delays here are naive means that count open episodes at their length so far (as in Appendix § 14 .§ 2 ); slower rules are censored more often, so this bias favours the fixed-ratio rules over the LR-CUSUM. With k k k down to 0.1, the closed-loop optimum lies below 1 on four of five models (k = 0.75 , 0.25 , 0.1 k = 0.75, 0.25, 0.1 k = 0.75 , 0.25 , 0.1 and 0.25; 25 for Qwen3-8B), consistent with the predicted 1 / ρ 1/\rho 1/ ρ of 0.67–2.14 under near-total staleness. The LR-CUSUM remains 5.8, 5.9, 2.0, 1.3 and 2.0× faster than the best tested ratio. Paired intervals of this ratio at each model’s best k k k exclude 1 for Qwen3-8B (5.8 [3.2, 9.4]), Qwen3-4B (5.9 [2.3, 11.2]) and OLMo-3-7B (2.0 [1.1, 4.6]), but not for Granite (2.0 [0.9, 3.4]) or Mistral (1.3 [0.9, 3.4]) (paper_figs/acl3_bestk.py). The weights the LR-CUSUM assigns differ across memories and models: the median per-memory weight ratio is 1.90, 1.33, 0.92, 0.50 and 0.67 (Qwen3-8B to OLMo-3-7B).
The replays of Appendices § 14 .4.1 and § 14 .4.2 reuse the recorded outcome tables of the five models in the main setting (30 streams per model and policy; no shard is missing). Intervals are 95% template-clustered bootstraps; pooled rows resample templates jointly across models.
Safety scored as the certificate tests it
Scoring. Under the standard scoring of KQA-STREAM, a macro answer counts as correct only if the query was also routed to the right template, so a template’s reliability averages over misrouted queries, which the certificate’s paired test does not see (Appendix § 14 .3.3). Here a one-step answer is correct if and only if it equals the gold answer (answer-only scoring ). A candidate is then bad for the task if its answer-scored reliability is below r ⋆ = a − ( m − 1 ) / L r^\star= a-(m-1)/L r ⋆ = a − ( m − 1 ) / L (L = 20 m ˉ L = 20\bar{m} L = 20 m ˉ ), and bad under its own null if the exact drift EZ \operatorname{EZ} EZ of its paired utility on its routed queries is ≤ 0 \le0 ≤ 0 (with the certificate’s own L L L , B B B and clipping; build instance excluded). An epoch is an interval between answer-changing edits of a template, and it is at risk if a candidate that is bad at some version of it is under test. We count three events: (i) a false certification , a fold of a candidate that is bad under its own null at the fold; it is on null evidence if the null held at every version of the fold’s test segment (the event bounded by Proposition 23(i)–(ii) and Proposition 25 (ii)); (ii) a task-level bad fold, below break-even; (iii) a wrong answer among the one-step answers served.
Results. The restart-only certificate makes no false certification at δ ≤ 0.1 \delta\le0.1 δ ≤ 0.1 on any model (0 of 6,657 at-risk epochs at δ = 0.05 \delta= 0.05 δ = 0.05 ; Table 15 , Figure 3 ); at δ = 0.2 \delta= 0.2 δ = 0.2 and 0.5 the shares are 0.0003 [0, 0.0009] and 0.0019 [0.0006, 0.0036], all on null evidence and in fresh test segments, as Proposition 23(ii) allows. Intervals clustered by relation or by edit sequence are comparable. The two notions of “bad” nearly coincide: at δ = 0.05 \delta= 0.05 δ = 0.05 , of 27,339 candidates, 3,611 are bad for the task, 3,619 under their own null and 3,571 under both; the task-level counts in Table 15 differ from the own-null counts by at most three epochs. Without notices, no false certification rests on null evidence at δ ≤ 0.1 \delta\le0.1 δ ≤ 0.1 ; every task-level bad fold at these levels (5, 13 and 15) spans an edit, i.e. its test segment began before the change, which is the residual risk that Proposition 25 (iii) bounds. Every point estimate of both certificates is below δ \delta δ .
Table 15. Safety under answer-only scoring (pooled, 150 streams per row). (i), (ii): epochs with the event / at-risk epochs; on null ev.: epochs with a false certification on null evidence; (iii): wrong answers among served one-step answers; stale: stale answers per 10 4 10^4 1 0 4 queries. Restart only: the restart-only certificate; no notice: discard on own alarm; ours (the recommended deployment): Appendix § 14 .5.2. Bold: ours (both rows).
False certification is not the error rate. At every δ \delta δ , 11.2–12.8% of the one-step answers that the restart-only certificate serves are wrong (7.6–8.7% on Qwen3-8B, 13.2–17.1% on Mistral-7B). Stale answers are only 14–17% of them; the rest are errors of macros that were above break-even when folded, which a fold accepts by design (r > r ⋆ r > r^\star r > r ⋆ allows r < 1 r < 1 r < 1 ). δ \delta δ therefore controls whether a bad memory is trusted, not how often a trusted memory errs; the second is set by r ⋆ r^\star r ⋆ and by the detection delay of § 3 .
Standard scoring. With routing errors counted as wrong answers, the restart-only certificate has bad folds in 0.0025 [0.0011, 0.0043] of at-risk epochs at δ = 0.05 \delta= 0.05 δ = 0.05 (29 of 11,670), all of them candidates with a positive paired-utility drift, and discard-on-alarm has 0.0008 [0.0003, 0.0014] (9 of 11,375; Appendices § 14 .3.3 and § 14 .§ 14.4.4 , Figure 7 ). The order of the two certificates flips between the scorings because the routing convention creates most of the restart-only certificate’s standard-scoring bad folds, whereas the no-notice certificate’s bad folds are carried across edits under both. Both scorings stay below δ \delta δ at every level.
Same-information baselines
The restart-only certificate receives an edit notice: the templates whose gold answer an edit changes. It uses the notice only to restart candidates under test; folded macros are retired by the LR-CUSUM alone. The baselines below receive the same notices, on the same streams, audits and edits, with the same certificate parameters (δ = 0.05 \delta= 0.05 δ = 0.05 , seven bets, h = 7 h = 7 h = 7 ) where they certify. Invalidate on notice drops the folded macro or the candidate under test of a notified template; a later verified live trace forms a fresh candidate, tested under the lifetime ledger, and folded macros are retired by notices only or also by their LR-CUSUM. Because carried-over candidates are discarded at every announced change, Proposition 23(iv) gives per-epoch safety for those epochs. Drop only sends the template back to live reasoning for the rest of the stream. The answer caches evict notified entries: a verified-answer cache, which stores a question’s live answer only when that run was audited and verified correct and returns it on an exact repeat, and the vCache-style cache of Appendix D.2.4. To model missed notices, each answer-changing edit is announced independently with probability f f f (the same draws for all policies). The compiled plan row is the restart-only certificate on compiled plans (with restarts).
Results. With perfect notices, invalidation matches the restart-only certificate’s accuracy and serves no stale answers (Table 16 ); its J 20 J_{20} J 20 differs by −0.12 [−0.82, +0.51]. Dropping without reforming loses 9.8 points, and the answer caches stay at live accuracy (0.19, the pooled live accuracy) because they answer only 10–13% of queries in one step. With missed notices, invalidation alone degrades fast: at f = 0 f = 0 f = 0 every one of its 218 stale episodes is still in service at stream end, and its accuracy falls by 4.4 points [2.2, 6.9]. Adding the LR-CUSUM keeps stale answers at or below the restart-only certificate’s at every f f f , and at f = 0 f = 0 f = 0 the two policies coincide. The share of at-risk epochs with a bad fold rises as notices are missed, because carried-over evidence is no longer discarded (Proposition 23(iv)): 0.0026, 0.0030, 0.0036 and 0.0047 for invalidate + LR at f = 1 f = 1 f = 1 , 0.8, 0.5 and 0 (restart-only certificate: 0.0025–0.0047), all below δ \delta δ . On Qwen3-8B, invalidate + LR adds 0.6 points [0.15, 1.1] over the restart-only certificate (Table 3 ).
Table 16. Same-information baselines, pooled over five models (150 streams per row; standard scoring). Top: perfect notices, paired differences with 95% template-bootstrap intervals. Bottom: missed notices. Bold: ours.
Compiled plans with restarts. With restarts, compiled plans keep +2.5 points over macros and 11.8 stale answers per 10 4 10^4 1 0 4 queries, and they halve the bad folds of plans without restarts: 0.0032 against 0.0064 of at-risk epochs (29 of 9,179 against 59 of 9,172) and 0.29 against 0.63 bad folds per stream, for 0.6 accuracy points. Per model the gain over macros is 1.2–4.0 points (Table 6 ).
Decoding variance
Each instance–version of the main runs is decoded once, so the intervals elsewhere resample templates, streams and edit sequences, not decoding randomness. To measure the latter we re-decoded a Qwen3-8B subset (60 templates × 10 instances, edit sequence 101, knowledge-base versions 0, 8, 16 and 24) with three decoding seeds. Live accuracy per version is 0.368/0.343/0.322/0.312, 0.367/0.338/0.320/0.312 and 0.368/0.335/0.313/0.305 for the three seeds: the standard deviation across seeds is at most 0.0044 per version, against a template-bootstrap 95% half-width of 0.09–0.10 for one seed. Two seeds give the same final answer on 91.9% of instance–versions and the same correctness on 97.6%. Replays of each seed’s tables (20 streams each) rank the six policies (live, fold once, Expel- and ACE-style counters, the restart-only certificate and its no-notice variant) in the same order of accuracy for every seed. The restart-only certificate’s accuracy is 0.447–0.452 and its stale answers 32–33 per 10 4 10^4 1 0 4 queries, against 698–771 for fold once and the counters. On the matched population of its folded macros, the LR-CUSUM leaves 0% unretired and the counters 57–75%, a delay ratio of 131–155× on this small subset (32–35 episodes). Decoding noise is thus two orders of magnitude below the template variation that our intervals already include, and no conclusion changes on the subset.
Natural edits from Wikidata temporal qualifiers
Timeline. Of the 207,851 facts of the knowledge base, 15,290 (7.4%) carry time information (7,017 start or end dates and 8,273 dated events). The 300 main templates are too sparse for a natural timeline: only 321 of their instances change answer between 1992 and 2016 while staying answerable. We therefore built a natural subset with the construction rules of Appendix § 14 : of 2,250 candidate paths, 1,769 are valid at every date, 88 change at least 5% of their answers, and 72 templates (68 new, 4 from the main set; 4,304 instances) remain after the diversity caps. The stream applies the 1992 state at query 0 and one knowledge-base version per year, 1993–2016, at uniform stream times (8,000 queries per year). Real changes are small and partial: 43.6 answer changes and 8.8 templates touched per year; in the median template-year only 3.3% of the template’s answers change, and no change is total (main synthetic edits: median 40%, 3% total; Figure 9 b). We ran four models (Qwen3-8B, Qwen3-4B, Granite-3.3-8B, Mistral-7B); OLMo-3-7B was not run on this timeline. The offline exact check reproduced all 111,904 traces at all 26 versions. Policies and settings are those of the main replays (30 streams of 200k queries per model, δ = 0.05 \delta= 0.05 δ = 0.05 ).
Figure 9. Natural-edit transfer (Wikidata temporal qualifiers, 1992–2016; four models, 30 streams each). (a) Real fact changes per year. (b) Share of a template’s instances whose answer changes in one edit: half of the real changes touch under 5% of the template, most synthetic ones 20–75%. (c) Stale answers per 10 4 10^4 1 0 4 queries: counters serve 3.0× more than the restart-only certificate. (d) The same 70 stale memories under three retirement rules (Kaplan–Meier). (e) Delay to detect at 3 false alarms per 10 4 10^4 1 0 4 healthy uses on 1,322 real episodes: fixed failure weights against the per-memory LR-CUSUM. (f) Share of at-risk epochs with a bad fold against δ \delta δ (“answers”: answer-only scoring; no notice: discard at the own alarm). Bands and bars: 95% template bootstrap.
Table 17. Natural edits, pooled over four models (30 streams of 200k queries each; standard scoring). Stale: per 10 4 10^4 1 0 4 queries. Bold: ours.
Results. Counters. Counters serve 3.0× [2.2, 4.0] more stale answers than the restart-only certificate (4.0, 2.8, 2.2 and 3.2× per model) and make 149–207 bad folds per stream, against 0.10. Replayed on the same macros as in Appendix § 14 .3.2, 70 of the 142 stale episodes remain after removing those that some rule retired before the change; the counters leave 84.3% [46.3, 100] in service at stream end and the LR-CUSUM 37.1% [4.5, 55.3], with a restricted-mean delay ratio of 20.5× [13.2, 72.9] and 405 against 30 stale answers per episode. The LR-CUSUM leaves more episodes open here than on synthetic edits because real staleness is mostly partial and 26 of its 70 episodes are cut off by the end of the stream; Appendix § 14 .5.3 reports the sensitivity to the event set and to leaving out one year or one relation. Weights. On 1,322 single-change episodes (35 templates; mean q 0 = 0.121 → q 1 = 0.330 q_0 = 0.121 \to q_1 = 0.330 q 0 = 0.121 → q 1 = 0.330 , optimal weight 1 / ρ = 3.7 1/\rho= 3.7 1/ ρ = 3.7 ), the per-memory LR-CUSUM is faster than the best fixed weight at every matched false-retirement rate: 1.08× [1.01, 1.32], 1.56× [1.34, 1.85] and 1.14× [0.93, 1.56] at 1, 3 and 10 false alarms per 10 4 10^4 1 0 4 healthy uses (1.72× on the 907 partial episodes at 3). The best fixed weight is about 2, not the 5–7 of the synthetic partial episodes (Appendix § 14 .§ 14.4.5 ), and on the 170 near-total episodes the symmetric rule is best, as Corollary 2 predicts (1 / ρ = 0.73 1/\rho= 0.73 1/ ρ = 0.73 ). Safety. Bad-fold epochs of the restart-only certificate are 0.0008, 0.0013, 0.0021 and 0.0062 of at-risk epochs at δ = 0.01 , 0.05 , 0.2 \delta= 0.01, 0.05, 0.2 δ = 0.01 , 0.05 , 0.2 and 0.5 (4/4,790, 6/4,770, 10/4,744, 29/4,686), and 0 up to δ = 0.2 \delta= 0.2 δ = 0.2 under answer-only scoring. Every point estimate is below δ \delta δ ; one per-model upper bound exceeds it (Qwen3-4B at δ = 0.01 \delta= 0.01 δ = 0.01 , 2 of 690 epochs). Accuracy and cost. The restart-only certificate adds 18.1 points [14.7, 21.7] over live reasoning with 10% fewer calls (on Mistral-7B it uses slightly more, 5.31 against 5.04), and certified compiled plans serve 2.8 stale answers per 10 4 10^4 1 0 4 queries. The counters are 3.5 points more accurate than the restart-only certificate (5.4 than the recommended deployment, Appendix § 14 .5.3), with lower loss, because when real staleness is this mild, folding everything without certification pays; this is the price of safety of Section 4, bought here with 149–207 bad folds per stream. The synthetic ratios of the main text (7.0–13.5×, 60×, a best weight of 5–7) are not claimed for natural edits.
Silent changes of the null, the recommended deployment, natural-edit sensitivity
When the null changes without a notice
What triggers a notice. In the replays, the no-notice of version v v v lists the templates k k k for which the gold answer of some instance routed to k k k differs between versions v − 1 v - 1 v − 1 and v v v (notice_tables); nothing else restarts a test or invalidates a memory. Epochs are the intervals between such notices. The certificate’s null, however, is the paired-utility drift E Z ≤ 0 E_Z \le0 E Z ≤ 0 , which depends on live reasoning as well: with C L − C M = 2 C^L-C^M=2 C L − C M = 2 , L = 50 L=50 L = 50 and a macro of reliability 0.9, a live accuracy of 0.8 gives E U = + 7 EU=+7 E U = + 7 , and 0.95 gives E U = − 0.5 EU=-0.5 E U = − 0.5 . Live reasoning can thus make a memory useless without any change of its answers or of the gold answers. Proposition 23(iv) therefore gives per-epoch safety only if notices cover every change of the null, including changes of live reasoning; across a change without a notice, the evidence banked before it is covered only by the carried-over bound min { 1 , δ j K c } \min\{1,\delta_jK_c\} min { 1 , δ j K c } of Proposition 23(iii). Two events must be kept apart: a candidate that is null at the fold, and a test segment that was null throughout (“on null evidence”). Only the second is bounded by δ \delta δ without further assumptions.
How often it happens. Over the three edit sequences and five models, 16,827 of 107,496 template-versions (15.7%) change some routed instance’s live trace (answer, correctness or call count) without a notice, 1,828 change a live correctness and 1,715 the routed live accuracy; 5,179 carry a notice (Table 18, top). Within the replays (δ = 0.05 \delta=0.05 δ = 0.05 , 150 streams per row), we tracked the exact drift of every candidate’s own test at every version of its life. Table 18 (bottom) counts the candidates whose null flips without a notice while they are under test, and the folds whose test segment spans such a flip. Flips are rare (0.3–0.7% of candidates), and of 7,385–9,835 folds per row at most 2 span one, all of candidates that are useful at the fold; no fold of a candidate that is null at the fold occurs at δ = 0.05 \delta=0.05 δ = 0.05 . So on these streams the per-epoch statement holds as measured, but the assumption it needs is not automatic.
The recommended deployment
The main tables and Figure 3 report the recommended deployment (“ours”: the restart-only certificate plus invalidation on notice, invalidate + LR of Appendix D.4.2); restart only (the restart-only certificate) is the comparison row. Under answer-
caption: tbl:18 : Silent changes of the null. Top: template-versions (three sequences, routed templates) with a notice and without one but with a change of live reasoning. Bottom: candidates whose own null flips without a notice while under test (flip events by direction), and folds whose test segment spans such a flip; δ = 0.05 \delta= 0.05 δ = 0.05 , 150 streams per row, pooled over five models. Bold: ours (all policies).
:::
only scoring, ours makes 0 own-null false certifications at δ ≤ 0.1 \delta\le0.1 δ ≤ 0.1 (0/5,814, 0/5,779, 0/5,758 at-risk epochs at δ = 0.01 , 0.05 , 0.1 \delta= 0.01, 0.05, 0.1 δ = 0.01 , 0.05 , 0.1 ), 1/5,718 at δ = 0.2 \delta= 0.2 δ = 0.2 and 11/5,614 (0.0020 [0.0006, 0.0038]) at δ = 0.5 \delta= 0.5 δ = 0.5 , all on null evidence; task-level bad folds are 0, 0, 0, 1 and 8. Of the one-step answers it serves, 9.6–10.6% are wrong (restart only: 11.2–12.8%), and none is stale. In Table 2 its stale answers are reported with every notice missed (the counters’ information; then it coincides with the ledger certificate without restarts); its bad folds per stream are those with perfect notices (0.00, 0.07, 0.43, 0.63, 0.30). The matched retirement comparison (Figure 2 ) uses the macros that restart only folds, because their folded macros, like ours after a missed notice, are retired by detection alone.
Natural edits: sensitivity
All numbers below reuse the natural replays of Appendix § 14 .4.4; the recommended deployment was replayed in addition (same streams). Recommended deployment. It serves no stale answers, has bad folds in 0.0007, 0.0013, 0.0029 and 0.0060 of at-risk epochs at δ = 0.01 , 0.05 , 0.2 , 0.5 \delta= 0.01, 0.05, 0.2, 0.5 δ = 0.01 , 0.05 , 0.2 , 0.5 (4/5,493, 7/5,498, 16/5,492, 33/5,487), and 0.11 bad folds per stream, but it is 1.9 points [1.0, 2.8] less accurate than restart only (0.337 against 0.356): when an edit changes 3% of a template’s answers, invalidation discards a memory that is still mostly right.
Event set. The matched retirement comparison uses the 70 of 142 stale episodes that no rule retired before onset. On all 142, counting a pre-onset retirement as detection at 0 uses, the counters leave 70.4% (Expel) and 62.7% (ACE) in service at stream end against 26.8% for the LR-CUSUM, with a delay ratio of 13.6× [5.4, 88.7]; each rule on its own episodes gives 90.1%, 89.0% and 45.2% unretired and a ratio of 10.3×.
Leave one out. Leaving out the episodes whose onset falls in one year, the counters leave 57.7–100% and the LR-CUSUM 3.8–45.6% in service, and the delay ratio is 18.5–32.0×; leaving out the templates that use one changing relation (21 relations), 56.0–100% against 21.2–45.6% and 17.2–38.1×. Most common episodes (44 of 70) start in the last year, 2016, and are censored early; without them the shares are 58% against 4%, so the unretired shares depend on censoring, while the delay ratio is stable. Leaving out one relation, the counters serve 2.5–3.2× more stale answers than restart only (2.3–2.9× than the ledger without restarts, i.e. ours with every notice missed), every certificate’s bad-fold share stays below δ \delta δ at every level (largest: 0.0080 at δ = 0.5 \delta= 0.5 δ = 0.5 ), and the per-memory LR-CUSUM stays faster than the best fixed weight at 1, 3 and 10 false alarms per 10 4 10^4 1 0 4 healthy uses (1.01–1.17×, 1.33–1.74×, 1.04–1.29×). The weight comparison uses the 1,322 single-change episodes; episodes with several changes do not have one change point and are not used.
Which variant for which goal
Table 19. Decision guide (pooled evidence; main text: § 6 ). Bold: ours.
A code domain with an exact verifier: CodeStream
CodeStream tests the theory on a second real domain, chosen so that the verifier is exact and memories are what tool-building agents store: a verified program, reused as a tool (Wang et al., 2024a; Cai et al., 2024; Wang et al., 2024c; Yuan et al., 2024). It writes the same potential-outcome tables as KQA-STREAM, so every policy, metric and replay setting of Appendix § 14 runs on it unchanged; only the domain, the stream length and the cost unit differ. The setting was fixed after a two-model pilot, before the full run.
Tasks, queries and the verifier. We use 521 EvalPlus tasks (Liu et al., 2023): 359 from MBPP+ (v0.2.0; Austin et al., 2021) and 162 from HumanEval+ (v0.1.10; Chen et al., 2021). We exclude 21 tasks: 17 with a special oracle or a failing canonical solution, and 4 with fewer than 10 usable hidden inputs. A query is a task plus one hidden plus-test input, 20 per task (10,420 queries); its answer is the function’s output. The verifier is EvalPlus’s own check against the reference output of the task version in force: exact equality, or closeness within the task’s tolerance for floating-point outputs. Each (program, version, input set) runs once and is cached, so every policy sees the same verdicts; re-executing the 6,330 sandbox runs of the table build in fresh processes changes 57 of 126,600 verdicts (0.05%), from programs whose output is not deterministic (e.g. set order).
Live reasoning and memories. The live reasoner is a solve–test–repair agent. It writes the function from the task prompt (temperature 0.7, at most 768 new tokens; Qwen3 with thinking disabled), runs it on the visible tests (the EvalPlus base inputs) in a sandbox of the current version, and, if a test fails, gets the failing call, the expected output and the output or exception it produced. It makes at most three attempts; the final program is run on the query input. Each task has 20 samples, one per query, so live outcomes of different queries are independent samples. A memory is the final program of a live trace whose answer was audited correct; folded, it is executed directly on later queries of the same task, in the current environment. Memories are thus compiled plans in the sense of § 6 : an environment change can break them, and a requirement revision changes the answers they are checked against. Some programs pass the visible tests but fail other hidden inputs, EvalPlus’s own finding that base tests under-specify tasks; they are the domain’s candidates that are bad at formation, so certification has real work to do.
Edit catalogue. Each timeline has 14 edits (15 versions) at uniform stream times, in the order A1, S1, A2, A3, S2, A4, S3, A5, A6, S4, A7, S5, A8, S6. Requirement revisions S1–S6 are the main source of staleness. Each batch revises 22 tasks (6% of the revisable tasks; 132 per timeline, each at most once) by appending one natural post-processing change to the prompt as “Requirement update: …”: sort, deduplicate, lowercase, reduce modulo 10 9 + 7 10^{9}+7 1 0 9 + 7 , clamp negatives to 0, round to two decimals, return ’Yes’/’No’, or return a list instead of a tuple. The reference output changes exactly on the inputs whose output the change affects, so staleness is partial or total by construction from the real input distribution (in the design-time catalogue the share of a revised task’s queries whose answer changes ranged from 0.05 to 1, median about 0.6). The three timelines (seeds 101, 202, 303) revise different tasks. API edits A1–A8 re-enact documented Python breaking changes in the sandbox (Table 20 ); they change no reference output, and a memory goes stale only if its own program changes behavior. Error messages carry the migration hint, as real deprecations do, so live reasoning can repair from test feedback.
Table 20. API edits of CodeStream. Programs broken: distinct verified programs whose behavior the edit changes, out of 1,494 (Qwen3-4B) / 1,380 (Qwen3-8B) in the two-model pilot.
Notices. A requirement revision bumps the task’s version: this is the answer-changing notice of the main experiments. API edits are unannounced: they are the domain’s unannounced changes, and for them the LR-CUSUM is the only safety net. They also change live reasoning (in the pilot, after A1 the mean number of attempts on the 210 affected Qwen3-4B traces rose from 1.21 to 2.13) without changing any answer, a silent change of the certificate’s null in the sense of Appendix § 14 .5.1. The changelog variant additionally invalidates, at each API edit, every memory whose source mentions a changed symbol, a static match that real maintainers would make: it is exact for removals but flags many unaffected programs for semantic edits.
Streams, policies and statistics. Streams have T = 10 6 T = 10^{6} T = 1 0 6 queries, Zipf demand over tasks (s = 1.2 s = 1.2 s = 1.2 ), audits with p = 0.1 p = 0.1 p = 0.1 , L = 20 m ˉ L = 20\bar{m} L = 20 m ˉ and δ = 0.05 \delta= 0.05 δ = 0.05 ; the certificates, the bet grid and the LR-CUSUM threshold h = 7 h = 7 h = 7 are those of the main experiments. Each model is replayed on 10 stream seeds per timeline. All memory policies store programs. Labels: fold once ; ExpeL- and ACE-style counters; per candidate , the per-candidate certificate of Table 1 , without notices or restarts, i.e. the counters’ information; restart only , the restart-only certificate, which restarts at requirement notices; ours , the recommended deployment (invalidate on notice and re-form, ledger, restarts, LR-CUSUM), as in the main text; and ours+changelog . A stale answer is a folded answer that is wrong although the same memory answered this query correctly when it was formed. 95% intervals resample templates (clusters) with 2,000 bootstrap draws, pooled over seeds and timelines; pooled intervals resample (model, template) clusters.
Models and compute. All five models ran all three timelines, so pooled numbers rest on 150 streams, 30 per model; every stream has the same weight.
Two cost accountings. Writing, testing and re-pairing a program costs more than running a stored one, and the domain admits two units. Step accounting , our main setting and faithful for tool libraries, charges a live query its attempts (LLM calls) plus one execution step, and a folded memory one execution step; live reasoning costs 2.68 steps per query. Call accounting , the unit of KQA-STREAM, charges live reasoning its LLM calls (1.68 per query) and a folded memory one call. J 20 J_{20} J 20 is computed in each unit with L = 20 m ˉ L = 20\bar{m} L = 20 m ˉ , as in the main text. Every cost statement below names its unit.
(a) Counters leave stale memories in service. The counters serve 518 [471, 567] (ExpeL) and 510 [463, 561] (ACE) stale answers per 10 4 10^{4} 1 0 4 queries, against 10.1 [8.8, 11.4] for the certificate with the counters’ information (per candidate): 51× pooled (95% intervals within [43, 60]) and 35–73× on every model, with every per-model lower confidence bound at least 25. Per folded answer, i.e. after dividing each policy’s stale answers by its one-step coverage, the ratio is still 36× pooled (27–48× per model), so the gap is not an artifact of the counters’ higher coverage. Against restart only (11.0 [9.0, 13.2]) the ratio is 47× [39, 58] (ExpeL) and 47× [38, 57] (ACE); against ours (2.0 [1.4, 2.7]) it is 258× [191, 363] (ExpeL). Ours with changelog notices serves 0.01 per 10 4 10^{4} 1 0 4 (all on Mistral-7B). Each policy’s own stale memories remain in service at stream end in 59% [56, 61] (ExpeL) and 57% [54, 59] (ACE) of cases, against 10% [7, 12] for per candidate; fold once retires none. These shares compare each rule on its own folded memories, not on a matched population as in Figure 2 ; the matched comparison is claim (b). In call accounting the stale answers of the certified policies are 9.2 (per candidate), 12.3 (restart only) and 2.0 (ours) per 10 4 10^{4} 1 0 4 ; the counters serve 55–56× more than per candidate pooled (38–86× per model), and the counter/restart-only ratio is 42× [32, 56] (ExpeL).
(b) Per-memory weights at matched false retirements. All rules run on the same per-candidate certificate and differ only in how they retire a folded memory. The per-memory LR-CUSUM uses its default threshold h = 7 h = 7 h = 7 . Each fixed failure:success weight k : 1 k\!:\!1 k : 1 (score +1 per audited failure, − 1 / k -1/k − 1/ k per success), for k ∈ { 1 , 2 , 7 , 25 , 50 , 100 , 200 , 500 , 1000 , 5000 } k \in\{1, 2, 7, 25, 50, 100, 200, 500, 1000, 5000\} k ∈ { 1 , 2 , 7 , 25 , 50 , 100 , 200 , 500 , 1000 , 5000 } , gets its best threshold (between 1 and 2,584 failure units; a finer grid from 34 to 89 for 7:1 and 5000:1) among those with no more false retirements per stream than the LR-CUSUM (a retirement of a memory at or above break-even), a choice that favors the fixed rules. We measure stale exposure : folded uses of a memory while it is stale, per stream. Pooled, the LR-CUSUM has 702 stale uses per stream at 33.5 false retirements; the best fixed weight (5000:1, threshold 78, 31.7 false retirements) has 7,300, i.e. 10.4× [7.7, 13.7] more, and the symmetric 1:1 rule 29.1× [14.6, 51.7] more (Table 22 ). On every model the best fixed weight is 7.6–11.4× worse, with every lower confidence bound at least 3.5. On the shared threshold grid, exposure falls from 25:1 to 100:1 and is flat from 100:1 to 1000:1 (within 3%): there a success barely discounts a failure, and all weights converge to one rule, a failure count that never forgets; 5000:1, this limit tuned on a finer threshold grid, is lower still. The optimum is interior on Mistral-7B (7:1) and this limit on the other four models.
Table 22. CodeStream claim (b), step accounting. FR: false retirements per stream; stale uses: folded uses while stale per stream; × \times × LR: the fixed rule’s stale uses over the LR-CUSUM’s at no more false retirements. 5000:1 is the no-forgetting limit, tuned on a finer threshold grid; on the shared grid exposure is flat from 100:1 to 1000:1. Bold: ours.
The theory predicts both the limit and the gap. In 86% of the 1,456 stale episodes the memory was perfect before the change (q 0 = 0 q_{0} = 0 q 0 = 0 ): a failure cannot occur before the change, so the optimal weight 1 / ρ ( q 0 , q 1 ) 1/\rho(q_0,q_1) 1/ ρ ( q 0 , q 1 ) of Equation (4) is infinite, and the best global weight moves to the no-forgetting limit. The other episodes want the opposite: 1 / ρ = 0 1/\rho= 0 1/ ρ = 0 when q 1 = 1 q_1 = 1 q 1 = 1 (9%) and a median of 1.0 otherwise (5%). No single weight fits both groups, and the limit is still 10× worse because a global rule also needs a global threshold. To spare the healthy memories that do fail now and then, it must wait for about 78 failures. The per-memory LR-CUSUM instead charges each failure ln ( q 1 / q ^ 0 ) \ln(q_1/\hat{q}_0) ln ( q 1 / q ^ 0 ) of its own memory, which is large when the memory never failed on its shadow labels. Among retired episodes of perfect memories, it retires after a median of 30 stale uses, about three audits; the best fixed rule needs 874. This is also why the gap is far larger than on KQA-STREAM (1.3–5.9× in detection delay) and on natural edits (1.1–1.6×), where few memories are perfect before the change. 42% of the episodes are partial (q 1 < 0.95 q_1 < 0.95 q 1 < 0.95 ; median q 1 = 1 q_1 = 1 q 1 = 1 ).
Figure 10. CodeStream (EvalPlus; five models, 150 streams of 10 6 10^6 1 0 6 queries). (a) Stale answers per 10 4 10^4 1 0 4 queries (step accounting; dots: models); ours+CL: ours with changelog invalidation. (b) Share of each policy’s own stale memories not retired by stream end (numbers: stale episodes). (c) Stale exposure at matched false retirements: folded uses while stale against false retirements, both per stream, for the per-memory LR-CUSUM (threshold sweep; star: h = 7 h = 7 h = 7 ) and fixed failure:success weights, all on the same certificate (weights 1:1–5000:1 were run; above 25:1 the curves coincide with 5000:1, the no-forgetting limit). (d) Accuracy gain over live reasoning (points) against cost per query relative to live reasoning, in steps (filled) and in LLM calls (hollow). Bars: 95% template-clustered bootstrap; in (d) on the filled markers only, since Δ \Delta Δ acc in LLM calls is within 0.1 points of it.
12 of 946,678 at δ = 0.05 \delta= 0.05 δ = 0.05 (1.3 · 10 − 5 10^{-5} 1 0 − 5 ; Clopper–Pearson upper bound 2.2 · 10 − 5 10^{-5} 1 0 − 5 ), 16 of 934,466 at δ = 0.1 \delta= 0.1 δ = 0.1 (1.7 · 10 − 5 10^{-5} 1 0 − 5 ) and 21 of 917,079 at δ = 0.2 \delta= 0.2 δ = 0.2 (2.3 · 10 − 5 10^{-5} 1 0 − 5 ): the rate rises with δ \delta δ and stays more than 1,000× below it. Per model, every rate is at least 250× below δ \delta δ ; the closest to δ \delta δ is Mistral-7B’s at δ = 0.01 \delta= 0.01 δ = 0.01 (6 of 161,262). With changelog notices it is 0 of 941,085 at δ = 0.05 \delta= 0.05 δ = 0.05 , and in call accounting 10 of 968,421. The counters fold a below-break-even candidate in 4.8% (ExpeL, 4,625/97,172) and 5.4% (ACE, 5,733/106,424) of their epochs under test, fold once in 3.7%; these policies fold at formation, so their epochs under test are formation epochs. The guarantee of Proposition 23(iv) does not cover the API edits, which change live reasoning silently; the measured rates show that, here too, this boundary is not where certification fails.
(c) Per-epoch false certification. An epoch under test is a (task, version) pair in which a candidate is under test, from its formation to its fold or discard; a bad fold folds a candidate whose reliability at that version is below break-even, the task-level event of Figure 3 b. Ours has bad folds in 6 of 965,730 epochs at δ = 0.01 \delta= 0.01 δ = 0.01 (6.2 · 10 − 6 10^{-6} 1 0 − 6 ),
(d) Accuracy and cost. Live reasoning is right on 76.2% of queries (57.5–83.1% per model). Ours gains 8.7 points [7.1, 10.5]: 2.4 (Qwen3-4B), 3.1 (Qwen3-8B), 7.2 (OLMo-3-7B), 10.0 (Granite-3.3-8B) and 21.0 (Mistral-7B) per model, because a certified program has passed hidden inputs that the live agent’s visible tests do not cover. The cost depends on the unit. In steps ours costs 0.62 fewer per query [0.52, 0.71] (−23%) and lowers J 20 J_{20} J 20 by 5.3 [4.4, 6.3]; in LLM calls it costs 0.29 more per query [0.20, 0.39] (+17%), because shadow mode pays for live reasoning while a candidate is under test, and still lowers J 20 J_{20} J 20 by 2.6 [2.0, 3.3]. The certified policies have the highest accuracy and the lowest J 20 J_{20} J 20 in both units. Counters gain 6.0–6.2 points at a lower cost in both units (on Qwen3-8B and Qwen3-4B they are 0.4–0.8 points below live reasoning) while serving 47× \times × more stale answers than restart only; fold once is within noise of live reasoning (+0.3 points [−1.9, 2.5]).
Table 21. CodeStream, pooled over five models (150 streams of 10 6 10^6 1 0 6 queries). Accuracy and Δ \Delta Δ acc (paired, template-clustered 95% intervals) in step accounting; in call accounting every Δ \Delta Δ acc is within 0.1 points of these. One-step: share of queries answered by a folded memory. Stale: per 10 4 10^4 1 0 4 queries (step accounting). Unretired: share of the policy’s own stale episodes still in service at stream end (step accounting; 14,826, 14,704, 1,456, 1,328 and 96 episodes for the counters, per candidate, restart only and ours; fold once never retires). Bold: ours.
Ties: the certification load on a real domain. The cost unit changes how much certified reuse the stream allows, and Theorem 6(ii) says why. Audited memory–live pairs of the certified policies agree on the outcome in 94–97% of cases (84–99% per model), and live reasoning re-derives the memory’s exact program in 49–59% (21–79% per model; 21–33% for Mistral-7B and OLMo-3-7B). In call accounting, a tie in which live reasoning succeeds at its first attempt has paired utility exactly 0; this holds for 84–86% of audited pairs (67–89% per model). The utility law then has a large atom at zero, so K L inf ( P Z ) \mathrm{KL}_{\inf}(P_Z) KL i n f ( P Z ) is small and certification is slow, and one-step coverage drops to 0.32, against 0.61 in step accounting, where every tie is positive evidence because live reasoning costs at least one step more than the memory. For ours, the drop tracks the share of zero-utility pairs across models: Qwen3-8B and Qwen3-4B (88–89%) keep 34–36% of their step-accounting coverage, Granite-3.3-8B and OLMo-3-7B (86–87%) 52–53%, and Mistral-7B (68%) 81%. This is the certification load Θ ∝ 1 / ( p K L inf ) \Theta\propto1/(p\mathrm{KL}_{\inf}) Θ ∝ 1/ ( p KL i n f ) of Sections 4 and 5 observed on a real domain: an exact verifier and a strong live reasoner make audits nearly uninformative, and safe contraction must wait for the queries on which the two differ.
Scope. API edits break few programs: in the pilot, A1 breaks 3.7–4.9% of the distinct verified programs and the other seven edits together at most 7 programs per model, because MBPP and HumanEval programs mostly use builtins. They test the unannounced channel and changelog notices, but we claim no staleness magnitudes for real library drift; a benchmark with version-specific APIs would measure them. Requirement revisions are controlled changes of real tasks, as the fact edits of KQA-STREAM are.
Worked examples from KQA-Stream
This appendix follows real Qwen3-8B macros through the replays of Table 3 (main setting). Questions, unedited facts, LLM outputs, routing decisions and audit outcomes come from the logs; post-edit facts are counterfactual (Appendix § 14 ). Cases are named by edit sequence, stream seed and policy; t t t is the query index in the stream. Every replay used here was re-run with an instrumented recorder and matched the stored run exactly. The values r r r , a a a , m m m and r ⋆ r^\star r ⋆ are exact popularity-weighted values over the instances routed to the template, with L = 20 m ˉ L = 20\bar{m} L = 20 m ˉ (m ˉ \bar{m} m ˉ : the stream’s mean live calls). A stale answer is a folded answer that was correct at formation and is wrong now. “Betting” and “SPRT” denote betting + LR-CUSUM (per-candidate level δ \delta δ , fold threshold ln 20 \ln20 ln 20 , no ledger; the “per candidate” row of Table 5 ) and SPRT + LR-CUSUM. These are mechanism examples: the main-text results use the restart-only ledger certificate and the recommended deployment, whose first threshold is ln 20 + ln ( π 2 / 6 ) = 3.49 \ln20 + \ln(\pi^2/6) = 3.49 ln 20 + ln ( π 2 /6 ) = 3.49 (so the 33-label fold of Table 23 , at log-wealth 3.43, is a per-candidate fold).
Table 23. Lifecycle of one real macro under betting + LR-CUSUM, and the same macro under other rules (last row). t t t : query index in the 200k-query stream. Stale answers include the retiring query. Post-edit facts are counterfactual by construction.
One real macro passes through every stage of the lifecycle and illustrates Equation (1) , Theorem 6 , Corollary 2, and Proposition 9. Template T118 maps a university to the people living in its state (edit sequence 303, seed 6). It is the fifth most popular template in this stream (π = 0.036 \pi= 0.036 π = 0.036 ).
Formation and certification. The macro forms at t = 44 t = 44 t = 44 from the first audited T118 query (Table 23 ). At its second step the live agent outputs {"action": "hop", "relation": "residence (backward)", "direction": "backward"}. Both one-call baselines fail; the parametric one outputs {"answers": ["State of Louisiana"]}. At v 0 v_0 v 0 the macro is always correct, while live has a = 0.800 a = 0.800 a = 0.800 at m = 2.85 m = 2.85 m = 2.85 calls, so r ⋆ = 0.772 r^\star= 0.772 r ⋆ = 0.772 with L = 66.98 L = 66.98 L = 66.98 . The 26 concordant pairs add 0.010–0.019 each to ln W + \ln W^+ ln W + ; the 7 pairs where only live fails add 0.33–0.52 each. The SPRT plugs in r 0 = 0.756 r_0 = 0.756 r 0 = 0.756 and r 1 = 0.788 r_1 = 0.788 r 1 = 0.788 (true: 0.772 and 0.800) and needs 72 labels instead of 33.
Retirement and re-formation. Edit v 16 v_{16} v 16 lowers the macro’s reliability to 0.367 < r ⋆ = 0.491 0.367 < r^\star= 0.491 0.367 < r ⋆ = 0.491 , while live re-derives answers on the edited facts. The LR-CUSUM was set at the fold to q 0 = 0.0147 q_0 = 0.0147 q 0 = 0.0147 and q 1 = 1 − r ^ ⋆ = 0.294 q_1 = 1 - \hat{r}^\star= 0.294 q 1 = 1 − r ^ ⋆ = 0.294 . It scores +2.995 per failure and −0.333 per success. One failure thus weighs about nine successes (ρ = 0.111 \rho= 0.111 ρ = 0.111 in Equation (4) ), and three failures in four labels retire the macro. The SPRT retires it on the same labels at the same t t t . The re-formed candidate needs only 12 labels, 7 of them discordant, because live accuracy has fallen to 0.517.
Counters and plans. The ExpeL-style, ACE-style and fold-once policies do not retire the macro before the stream ends (last row of Table 23 ). Its 331 successful audits before the edit bank an ExpeL importance of 333, and Proposition 9(a) predicts a delay of 333 / ( 2 ⋅ 0.633 − 1 ) = 1,249 333/(2 \cdot0.633 - 1) = 1{,}249 333/ ( 2 ⋅ 0.633 − 1 ) = 1 , 249 labels; only 346 remain. The compiled plan, which re-executes the path on current facts, has no failure in 677 audited labels.
How typical is this case? Among betting’s 81 stale-after-edit onsets in the 30 streams, this one is at the median of folded uses to retirement (43); their median stale count is 30 (IQR 21–47). The counter side is extreme (98.5th percentile of ExpeL onsets): T118 is popular, and 106,806 queries remain. In seeds 1 and 2 the counters serve 358 and 273 stale answers after this edit, and betting 52 and 40.
Takeaway. Certification took 33 labels, and a likelihood-ratio detector limited a real edit to 29 stale answers. Counters with banked credit kept the stale macro to the end of the stream.
Counters under partial staleness
On one real sequence of audit outcomes, this example compares all retention rules and checks Proposition 9, Theorem 1 , and Corollary 2. The T048 macro maps a film to Academy Awards via producer and nominated for (edit sequence 303, seed 0). It forms at t = 738 t = 738 t = 738 from the trace for “What Academy Awards did the producer of Man of Steel get nominated for?” and passes all 90 audits before the edit. Edit v 5 v_5 v 5 gives a new producer to 25% of the relevant subjects. Goodfellas’ producer Irwin Winkler, for example, becomes Eminem, yet the macro still answers Best Picture. Its reliability falls to 0.733 < r ⋆ = 0.768 0.733 < r^\star= 0.768 0.733 < r ⋆ = 0.768 , so q 1 = 0.267 q_1 = 0.267 q 1 = 0.267 : partial staleness. The 333 post-edit labels contain 93 failures.
Table 24 replays every rule on these labels. By Proposition 9(b), ExpeL (credit 92) and ACE (90/0) are ever retired with probability at most 10 − 40.4 10^{-40.4} 1 0 − 40.4 and 10 − 39.5 10^{-39.5} 1 0 − 39.5 . The symmetric rule is in the negative-drift regime of Theorem 1 (μ 1 = − 0.467 \mu_1 = -0.467 μ 1 = − 0.467 , γ = 0.344 \gamma= 0.344 γ = 0.344 ). At a similar A A A , the +7/−1 rule of Corollary 2 retires at label 44 instead of 152. Every realized delay lies between the 57th and 81st percentile of its exact law. On the longest real onset (T164, sequence 101, seed 5; 4,004 labels), the counters serve 9,997 stale answers. There the symmetric rule with H = 4 H=4 H = 4 needs 610 labels and the LR-CUSUM 8. Over the 30 streams, ExpeL has not retired 95.5% of its 287 partial-staleness onsets by the end of the stream, and ACE 80.8% of its 312. The bounds of Proposition 9(b), computed from each onset’s real credit, average 0.89 and 0.76. The LR-CUSUM detectors leave 1 of 24 (SPRT) and 0 of 11 (betting) unretired.
Table 24. Retention rules on the same 333 real post-edit labels of the T048 macro (edit sequence 303, seed 0). Uses / stale: folded uses before retirement / stale answers incl. the retiring query (to the stream’s end for “not by end”). E τ E_{\tau} E τ : exact mean delay (labels) at q 1 = 0.267 q_1 = 0.267 q 1 = 0.267 . A A A : exact mean labels to a false retirement; .013 is the deployed LR-CUSUM’s in-control estimate. † ^{\dagger} † A real replay retired the macro at label 19. Bold: ours.
Takeaway. Under partial staleness, ± 1 \pm1 ± 1 counters with banked credit are practically never retired: the probability of ever retiring them is small (Proposition 9(b)}), and on real streams they stay in service until the stream ends. A failure must weigh 1 / ρ ( q 0 , q 1 ) 1/\rho(q_0,q_1) 1/ ρ ( q 0 , q 1 ) successes, about 6.5 here.
Certifying utility instead of reliability
Two real candidates show why Theorem 6 bets on the paired utility and how a plug-in break-even misleads the SPRT (Proposition 5 ). The replays bet on Z t = U t / ( L + 7 ) Z_t=U_t/(L+7) Z t = U t / ( L + 7 ) , clipped to [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] , with
U t = ( m t − 1 ) + L ( Y t M − Y t L ) U_t=(m_t-1)+L(Y_t^M-Y_t^L) U t = ( m t − 1 ) + L ( Y t M − Y t L )
and a uniform mixture of seven fixed bets. This differs from the grid mixture of Appendix § 13 but keeps validity; mirrored bets (W − W^- W − ) decide discards.
(a) Less accurate than live, yet worth folding. Template T096 maps a record label to its time zone and has rank 2 in seed 9 of sequence 101 (π = 0.109 \pi=0.109 π = 0.109 ). Its macro forms at t = 100 t=100 t = 100 from the trace for “Which time zone is associated with Imperial Records?”. It follows the gold path, and no edit changes its answers. Still r = 0.997 < a = 0.998 r=0.997<a=0.998 r = 0.997 < a = 0.998 , because 21 misrouted instances (mass 0.003) count as macro failures. For example, “What time zone does the headquarters of Fox Searchlight Pictures observe?” belongs to T281, but the router outputs {"type": 3} and picks T096. Live, which does not route, answers correctly, so the pair enters with U t = − 65.3 U_t=-65.3 U t = − 65.3 . The macro is still above break-even (r ⋆ = 0.968 r^\star=0.968 r ⋆ = 0.968 ) and worth +1.93 steps per query. Betting folds it at t = 22 , 459 t=22,459 t = 22 , 459 after 249 labels: 247 pairs with both correct, one routing loss and one joint failure. No discordant pair favors the macro, so a sign test on discordant pairs would never fold it. Betting folds on the concordant gain η / ( 1 − η ) \eta/(1-\eta) η / ( 1 − η ) of Appendix § 13 . All three numbers below are for the per-candidate certificate at level δ \delta δ (fold threshold ln ( 1 / δ ) = ln 20 \ln(1/\delta)=\ln20 ln ( 1/ δ ) = ln 20 , no ledger term), the version this example ran. Lemma 16 gives KL inf ( P U ) = 0.0244 \operatorname{KL}_{\inf}(P_U)=0.0244 KL i n f ( P U ) = 0.0244 , i.e. ln 20 / KL inf = 123 \ln20/\operatorname{KL}_{\inf}=123 ln 20/ KL i n f = 123 labels to first order (the optimum level of § 5 ); the implemented seven-bet mixture adds ln 7 \ln7 ln 7 nats to the threshold and grows at the rate g B = 0.0223 g_B=0.0223 g B = 0.0223 of its best bet (0.9), which predicts ( ln 20 + ln 7 ) / g B = 221 (\ln20+\ln7)/g_B=221 ( ln 20 + ln 7 ) / g B = 221 (as run : the implementation loss; the overshoot term ln 1.9 \ln1.9 ln 1.9 of Appendix § 13 .§ 2 is not included); the 249 labels it took are the measured level, 13% above the as-run prediction through finite-sample effects. The deployed ledger’s j j j -th test adds 2 ln j + ln ( π 2 / 6 ) 2\ln j+\ln(\pi^2/6) 2 ln j + ln ( π 2 /6 ) nats; for j = 1 j=1 j = 1 the first two levels become ( ln 20 + ln ( π 2 / 6 ) ) / KL inf = 143 (\ln20+\ln(\pi^2/6))/\operatorname{KL}_{\inf}=143 ( ln 20 + ln ( π 2 /6 )) / KL i n f = 143 and ( ln 20 + ln 7 + ln ( π 2 / 6 ) ) / g B = 244 (\ln20+\ln7+\ln(\pi^2/6))/g_B=244 ( ln 20 + ln 7 + ln ( π 2 /6 )) / g B = 244 labels. The SPRT folds earlier (t = 6 , 537 t=6,537 t = 6 , 537 , 67 labels); its plug-in error is harmless here because the macro is good.
(b) A plug-in break-even folds a stale macro. The T010 candidate (sequence 202, seed 1) forms at t = 651 t=651 t = 651 from “Which time zone is associated with the administrative twin of Nottingham?”. Before the edit, r = 0.965 > r ⋆ = 0.947 r=0.965>r^{\star}=0.947 r = 0.965 > r ⋆ = 0.947 : a thin margin that needs about 686 labels, while only 11 arrive. Edit v 7 v_7 v 7 then gives a new time zone to 25% of the relevant subjects. Seattle, for example, moves from Pacific Time Zone to East Africa Time. The cached macro drops to r = 0.597 r=0.597 r = 0.597 , while live stays at a = 0.977 a=0.977 a = 0.977 . Betting sees 9 stale pairs with U t = − 64.4 U_t=-64.4 U t = − 64.4 and discards the candidate at t = 59 , 956 t=59,956 t = 59 , 956 (Table 25 ). The SPRT froze a ^ = 0.345 \hat{a}=0.345 a ^ = 0.345 from one shrunk key label, so r 0 = 0.313 r_0=0.313 r 0 = 0.313 and r 1 = 0.345 r_1=0.345 r 1 = 0.345 . Its zero-drift point, 0.329, lies below the true r r r in every phase. As in the proof of Proposition 18, it therefore folds almost surely. It folds at t = 187 , 133 t=187,133 t = 187 , 133 , 0.51 below break-even, and serves 45 stale answers. Across the 30 streams, the SPRT makes 21 below-break-even folds and betting 6 (SpF in Table 3 and Table 5 ). In all 21 SPRT cases the plug-in r 0 r_0 r 0 lay below the true r ⋆ r^{\star} r ⋆ , and betting folded none of those candidates.
Table 25. Real certificates for the T010 candidate (edit sequence 202, seed 1). #: audited label, shared by betting and the SPRT; labels 1–11 precede edit v 7 v_7 v 7 . Threshold ln 20 = 2.996 \ln20 = 2.996 ln 20 = 2.996 for ln W + \ln W^{+} ln W + (fold), ln W − \ln W^{-} ln W − (discard) and the plug-in LLR (fold).
Takeaway. Pair the macro with live on the same instance. Routing errors and live mistakes then enter the certificate directly, and a a a need not be estimated.
Why rare templates stay uncovered
Six templates of one stream show the mechanism of Theorem 3 : a template is covered only if its epoch outlasts n i ∗ / ( p π i ) n_i^*/(p\pi_i) n i ∗ / ( p π i ) . We use edit sequence 101 and seed 0, with SPRT certification. T048, T027, T110 and T115 have matched difficulty: live solves 59 of 60 instances, the gold-path macro has r = 1.000 r = 1.000 r = 1.000 , and n i ∗ n_i^* n i ∗ is 208–213. Only their popularity ranks differ (Table 26 ).
Table 26. Six templates of one stream (edit sequence 101, seed 0). π i \pi_i π i : share of foldable queries. Epoch: 1 / ( ν s i + 1 / T ) 1/(\nu s_i + 1/T) 1/ ( ν s i + 1/ T ) , s i s_i s i : fraction of harmful edits. One-step: share of the template’s queries answered by a folded macro, stale ones included. Bold: ours. a ^{a} a Edit v19 _{19} 19 (t = 149,426 t = 149{,}426 t = 149 , 426 ); retired at t = 161,145 t = 161{,}145 t = 161 , 145 , re-certified after 77 labels at t = 194,254 t = 194{,}254 t = 194 , 254 . b ^{b} b Edit v7 _7 7 (t = 55,476 t = 55{,}476 t = 55 , 476 ) drops the candidate’s reliability from 1.0 to .733 after 8 of 39 labels.
The head certifies within 38 labels; the tail never does. T110 forms at t = 5,301 t = 5{,}301 t = 5 , 301 from a correct trace for “What record labels are connected to graduates of Radcliffe College?”. It gets 8 of the 39 labels it needs before edit v7 _7 7 lowers its reliability to 0.733 < r ⋆ = 0.952 < r^\star= 0.952 < r ⋆ = 0.952 . T115 and T014 get 5 and 2 labels in the whole stream.
In the 30 main-setting streams, the SPRT needs a median of 39 labels per fold (all 1,201 folds), fewer than the first-order n i ∗ n_i^* n i ∗ (208–213 for the templates above), which assumes the least favorable candidate. Ranks 101–300 get 7.5–14.5 audits per template-stream on average, and none of their 5,771 template-streams was ever folded.
Takeaway. With a fixed audit budget, templates rarer than the load are not certified between changes; coverage comes from popular templates.
Extended related work
Reasoning memory and skill libraries. LLM systems increasingly store reusable reasoning: thought templates (Yang et al., 2024a), strategies and insights (Suzgun et al., 2026; Zhao et al., 2024; Ouyang et al., 2026; Zhang et al., 2026b; Didolkar et al., 2025), workflows and programmatic skills (Wang et al., 2025b,a, 2024a,c), verified lemmas (Wang et al., 2024b), and long-term memories (Zhong et al., 2024; Park et al., 2023; Chhikara et al., 2025; Li et al., 2025). Many never retire an item (Yang et al., 2024a; Ouyang et al., 2026; Wang et al., 2025b). The rest use hand-set rules. Expel (Zhao et al., 2024) keeps an integer importance count that starts at 2, moves by ± 1 \pm1 ± 1 on up- and down-votes and deletes the item at 0. ACE (Zhang et al., 2026b) keeps unbounded helpful/harmful tallies. Other rules include clipped Hebbian strengths with time decay (Singh and Yu, 2025; Zhu et al., 2026), lifetime failure rates thresholded at 1 / 2 1/2 1/2 (Chen et al., 2026), EWMA utilities (Zhang et al., 2026c), Beta counts (Forouzandeh et al., 2026), usage-frequency pruning (Wang et al., 2024c), time-to-live (Li et al., 2025), sliding-window utilities (Pu et al., 2026) and paired with/without-memory audits (Zhang et al., 2026e; Gao et al., 2026). MQuAKE (Zhong et al., 2023), StreamingQA and RealTime QA (Liška et al., 2022; Kasai et al., 2023) evaluate a model after knowledge edits; KQA-STREAM evaluates a memory lifecycle over a stream with recurring templates and interleaved edits. The statistical analyses we know of either prove stationary consistency of a two-counter “memory worth” (Simsek, 2026) or prove that an EMA converges (Zhang et al., 2026c). Sun et al. (2025) recast memory management in decision-theoretic terms but give no tests. Asadolahi et al. [4 ] show that self-graded memory scores are inflated unless verifier errors are independent. Sequential tests enter LLM pipelines only to audit trajectories (Sadhuka et al., 2025) or to stop sampling within one query (Lee et al., 2025). We show that these maintenance rules are change detectors: clipped counters are Page CUSUMs with mis-specified scores, and unclipped tallies have no renewal. We quantify their detection delay and replace them with certified folding and likelihood-ratio retirement.
Step skipping versus system-level contraction. Model-level methods train an LLM to skip or internalize steps (Liu et al., 2024; Yu et al., 2024; Hao et al., 2025), to compress chains of thought (Xia et al., 2025), or to decide when to think (Zhang et al., 2025b); see Sui et al. (2025) for a survey. These methods change what one forward pass can compute. They choose training data offline. At inference time nothing decides whether a template’s one-step answer can be trusted, or notices when it has gone stale. The problem is real. Latent multi-hop composition is unreliable (Yang et al., 2024b), and consensus-based early exit is unsafe (Mo et al., 2026). Contraction is complementary. It treats any distilled routine as a macro and decides per template, over time and with explicit error control, when to serve that macro and when to retire it.
Caching, routing and cascades with guarantees. Semantic caches reuse responses for similar prompts (Bang, 2023), and agent systems cache plan templates (Zhang et al., 2025c). Caching theory gives optimal content under stationary demand (Zhu et al., 2023; Liu et al., 2026). Cascades and routers decide per query [1 ] (Chen et al. 2024a). Where these systems carry guarantees, the guarantees are fixed-sample risk control under exchangeability. Examples are CALM (Schuster et al., 2022), which uses Learn-then-Test [3 ] , PAC and group-conditional reasoning (Zeng et al., 2025; Huang et al., 2026), and conformal early stopping (Wang et al., 2026). Two works are closer.
B-PAC (Yu et al., 2026b) certifies a global thinking/non-thinking router anytime, with inverse-propensity-weighted test supermartingales. Our certificate uses the same tools (betting, inverse-propensity weights, Ville’s inequality); what differs is the object: one certificate per template, restarted at changes and followed by retirement, over a memory’s whole lifecycle.
vCache (Schroeder et al., 2026) bounds the per-request error of cache hits using randomized LLM verification. Its bound assumes i.i.d. prompts and a correct similarity model, and exploration can stop entirely.
Staleness has been studied only empirically (Mansoor et al., 2026; Wu and Canedo, 2026), although model behavior does drift (Chen et al., 2024b).
Anytime-valid monitors watch whole models, not reusable items (Podkopaev and Ramdas, 2022; Richter et al., 2025; Khosravi and Huo, 2026). We certify a reusable derivation with a test that stays valid at all times, under adaptive shadowing and arbitrary drift below the null. The indifference zone comes from the loss. Certification is followed by quickest-detection retirement, and the result yields population-level coverage laws.
Sequential testing and change detection. Certified folding rests on the SPRT (Wald, 1945; Wald and Wolfowitz, 1948), Ville’s inequality (Ville, 1939), and testing by betting (Shafer, 2021; Ramdas et al., 2023; Howard et al., 2021; Waudby-Smith and Ramdas, 2024). Retirement rests on Page’s CUSUM (Page, 1954) and its optimality (Lorden, 1971; Moustakides, 1986; Lai, 1998). Two of our results are instances of older work. The counter identity matches cumulative-score and integer CUSUM charts (Munford, 1980; Brook and Evans, 1972). Our likelihood-ratio learning rates are the Bernoulli CUSUM (Reynolds and Stoumbos, 1999). Analyses of mis-specified CUSUM assume positive post-change drift (Molloy and Ford, 2017; Cooper and Meyn, 2024), or note only qualitatively that delay can exceed the false-alarm time (Molloy, 2021). Wu and Yang (2016, Thm. 2) state that the delay is infinite in the negative-drift regime; their proof exchanges an expectation and a minimum over the CUSUM’s restarts. Observation-controlled detection (Banerjee and Veeravalli, 2013; Xu et al., 2021) and e-detectors (Shin et al., 2024) are the natural comparisons for audited and composite settings. Using Cramér–Lundberg asymptotics (Iglehart, 1972; Siegmund, 1985; Asmussen, 2003), we make explicit the full delay–ARL phase diagram for additive-score detectors. It includes the power law D ≍ A θ 1 / θ 0 D \asymp A^{\theta_1/\theta_0} D ≍ A θ 1 / θ 0 under negative drift, where Wu and Yang (2016) state an infinite delay; Appendix A locates the step of their proof that fails and gives a counterexample.
Occupancy, freshness and scaling laws. Our static amortization law is a corollary of occupancy asymptotics (Karlin, 1967; Gnedin et al., 2007). Its constant follows from rare-mass results (Ohannesian and Dahleh, 2012), and Good–Turing theory estimates and forecasts it (Good, 1953; Good and Toulmin, 1956; McAllester and Schapire, 2000; Orlitsky et al., 2016). For n 0 = 1 n_0 = 1 n 0 = 1 it is the cold-start or characteristic-time miss ratio of caching (Fagin, 1977; Che et al., 2002; Jelenković, 1999).
Admission after k k k hits generalizes this case (Martina et al., 2014), and memorization learning curves share the exponent (Hutter, 2021; Michaud et al., 2023). Under drift, the n 0 = 1 n_0 = 1 n 0 = 1 steady state is the freshness objective of crawling (Azar et al., 2018) and the hit law of TTL and random-replacement caches (Choungmo Fofack et al., 2014; Gallo et al., 2014). Square-root refresh and replication rules are classical (Yates et al., 2017; Cohen and Shenker, 2002; Kolobov et al., 2019), and so is abandoning fast-changing items (Cho and Garcia-Molina, 2003; Bastopcu and Ulukus, 2021). Square-root allocations also appear in label-efficient inference (Xu et al., 2024; Zrnic and Candès, 2024). The law of practice has been explained by chunk recurrence and by averaging over items (Newell and Rosenbloom, 1981; Logan, 1988; Heathcote et al., 2000). We couple sequential-test sample complexity with occupancy. This gives the fundamental limit of safe one-step coverage under drift, M ⋆ ∼ κ s Θ 1 − 1 / s M^\star\sim\kappa_s \Theta^{1-1/s} M ⋆ ∼ κ s Θ 1 − 1/ s , with a first-order matching converse for every δ \delta δ -safe policy.
Safe self-improvement and multi-agent memory. Self-modifying agents accept a change when a benchmark score rises (Zhang et al., 2026a). Per-decision betting gates (Shawn, 2026) and trajectory-level error spending (Wu et al., 2025) control false commits. Earlier antecedents are high-confidence and Seldonian improvement (Thomas et al., 2015, 2019; Chandak et al., 2020) and the “bio-creep” study of approval policies (Feng et al., 2021). Recent work proves limits for classifier-style gates (Scrivens, 2026) and near the reward ceiling (Cai et al., 2026). Shared multi-agent memories admit items through judges, one-shot A/B replay or count-and-mean rules (Zhang et al., 2025a; Xu et al., 2025; Yu et al., 2026a). Yet LLM errors are correlated (Kim et al., 2025), judges are noisy (Zhang et al., 2026d), and shared memory is a poisoning channel (Dong et al., 2025). These gates decide one modification or one shared item at a time. We study a single memory whose items are certified per template from verifier feedback, and leave shared and self-modifying memories to future work.
Speed-up learning and the utility problem. Symbolic AI compiled multi-step reasoning into macro-operators (Fikes et al., 1972; Korf, 1985), explanation-based rules (Mitchell et al., 1986), chunks (Laird et al., 1986) and compiled productions [2 ] (Taatgen and Lee 2003). Program synthesis grows libraries in the same way (Ellis et al., 2021). The utility problem (Minton, 1990) led to statistically gated adoption (Gratch and DeJong, 1992; Greiner, 1996) and PAC analyses of speed-up learning (Tadepalli and Natarajan, 1996). These analyses assume a fixed problem distribution and never un-adopt a rule. We add four things: validity at all times under adaptive schedules and drift, an indifference zone derived from the loss, retirement with optimal detection delay, and closed-form population laws for how much reasoning can be contracted.