Sam Babichenko

Reading notes / Decision meshes

Adaptive refinement, empirical-null gating, and shrinkage failure modes

Candidate scoring and projection
xxcandidate design column vector over training pools (distinct from pool covariate coordinates in Note 1)
X,θ,PX, \theta, Pcurrent design matrix, fitted coefficients, and quadratic prior precision matrix
s,j,Vs, j, Vvectors of pool centered scores sis_i, effective information jij_i, and score variance ViV_i
J,ΩJ, \Omegapenalized working information P+X⊤diag⁡(j)XP + X^\top \operatorname{diag}(j) X and score covariance X⊤diag⁡(V)XX^\top \operatorname{diag}(V) X
c,ac, across-information c=X⊤diag⁡(j)xc = X^\top \operatorname{diag}(j) x and refit projection a=J−1ca = J^{-1} c
h,Vcandh, V_{\mathrm{cand}}residualized candidate information x⊤diag⁡(j)x−c⊤ax^\top \operatorname{diag}(j) x - c^\top a and refit-adjusted score variance
Scorr,zcandS_{\mathrm{corr}}, z_{\mathrm{cand}}bias-corrected candidate score (x−Xa)⊤s(x - Xa)^\top s and standardized score Scorr/VcandS_{\mathrm{corr}}/\sqrt{V_{\mathrm{cand}}}
Empirical-null gate
f^(z)\hat f(z)degree-6 Poisson polynomial density fitted to a 72-bin linearly binned histogram of the round's zz-scores
μ^0,σ^0,π^0\hat\mu_0, \hat\sigma_0, \hat\pi_0empirical null center, scale, and null share read from central matching on ∣z∣≤2|z|\le 2 (the code writes δ^0\hat\delta_0 for μ^0\hat\mu_0)
lfdr⁡(z),q\operatorname{lfdr}(z), qlocal false discovery rate π^0ϕ(z;μ^0,σ^02)/f^(z)\hat\pi_0 \phi(z; \hat\mu_0, \hat\sigma_0^2)/\hat f(z) and running-mean admission threshold q=0.40q = 0.40
EM depth shrinkage
SdS_dset of gate-admitted free vertices at depth dd
δ^m,Vmm\hat\delta_m, V_{mm}fitted surplus and working-posterior variance of admitted vertex m∈Sdm \in S_d
τd2,τfloor\tau_d^2, \tau_{\mathrm{floor}}depth-dd prior surplus variance (precision λd=1/τd2\lambda_d = 1/\tau_d^2) and variance floor τfloor=0.005\tau_{\mathrm{floor}} = 0.005 logit (λmax⁡=4×104\lambda_{\max} = 4\times 10^4)

Context. Once a mesh geometry and an overdispersed binomial estimator are fixed, each refinement round confronts dozens to hundreds of candidate splits across the domain. Picking the largest raw score overfits noise, double-counts slopes the existing mesh can already fit, and chases residuals left behind solely by prior shrinkage. The interactive walkthrough traces one coin-flip run through the gate. This note derives the refit-adjusted score and shrinkage-bias cancellation, explains how Lindsey's empirical null and EM depth shrinkage act as an implicit spike-and-slab prior, and documents six failure modes that bit production fits.

Selecting where to refine requires four linked safeguards. Project out what existing coefficients can absorb, subtract propagated shrinkage bias, calibrate the round's score family against its own empirical null, and estimate depth variance without letting shrinkage collapse into its variance floor.

Step 1

Refit-adjusted candidate score and shrinkage-bias cancellation. A candidate vertex introduces a realized design column candidate basis column evaluated at every training pool, computed through all active welds and constraints over the training pools. Using the current fit's penalized information JJ=P+X⊤diag⁡(j)X{}= P + X^\top \operatorname{diag}(j) X and score covariance Ω\Omega=X⊤diag⁡(V)X{}= X^\top \operatorname{diag}(V) X, compute the cross-information c=X⊤diag⁡(j)xc = X^\top \operatorname{diag}(j) x and the first-order refit projection aa=J−1c{}= J^{-1} c. The candidate's residualized information hh and refit-adjusted score variance VcandV_{\mathrm{cand}} areh=x⊤diag⁡(j)x−c⊤a,Vcand=x⊤diag⁡(V)x−2a⊤X⊤diag⁡(V)x+a⊤Ωa.\begin{aligned}h &= x^\top \operatorname{diag}(j) x - c^\top a,\\V_{\mathrm{cand}} &= x^\top \operatorname{diag}(V) x\\&\quad - 2 a^\top X^\top \operatorname{diag}(V) x + a^\top \Omega a.\end{aligned}

Evaluating the raw score x⊤sx^\top s at a shrunk fit still misleads the gate. Because the prior PP pulls existing coefficients θ\theta toward zero, the fitted surface understates genuine structure where the data insist, leaving structured residuals in ss that nearby candidates pick up even when no new vertex is needed. First-order expansion shows that the propagated shrinkage bias in x⊤sx^\top s equals c⊤J−1Pθc^\top J^{-1} P\theta. Because the converged surface satisfies the stationarity equation of the centered-mode estimator from the second note of this section. Reading note: Mean-neutral pool effects and the centered-mode estimator, subtracting that bias collapses algebraically into scoring the residualized column x−Xax - Xa directly:Scorr=x⊤s−c⊤J−1Pθ=x⊤s−a⊤X⊤s=(x−Xa)⊤s.\begin{aligned}S_{\mathrm{corr}} &= x^\top s - c^\top J^{-1} P\theta\\&= x^\top s - a^\top X^\top s = (x - Xa)^\top s.\end{aligned}Dividing by the refit-adjusted standard deviation gives the standardized score zcand=Scorr/Vcandz_{\mathrm{cand}} = S_{\mathrm{corr}} / \sqrt{V_{\mathrm{cand}}}. At admission, the local quadratic proposal sets δ=Scorr/(h+λd)\delta = S_{\mathrm{corr}} / (h + \lambda_d) with predicted gain Scorrδ/2S_{\mathrm{corr}} \delta / 2. Selected candidates enter one at a time, best first, and each is re-profiled against the surface updated by earlier admissions in the same round.

Step 2

Calibrating a round with Lindsey's empirical null. Even after refit projection and bias cancellation, a round's candidate scores need not follow a textbook N(0,1)\mathcal{N}(0, 1) null. Overlapping tents correlate across the plane, and an unfinished coarse surface shifts or widens the bulk of scores. The gate therefore estimates the round's own Efron's (2004) empirical null N(μ^0,σ^02)\mathcal{N}(\hat\mu_0, \hat\sigma_0^2) estimated from the center of a round's observed zz-score distribution via Lindsey's method. The engine bins all scoreable candidates on [−9.5,9.5][-9.5, 9.5] into 72 bins using splitting each score's unit weight linearly between its two nearest bin centers so histogram counts move continuously with the scores (splitting each score between its two nearest bin centers). A degree-6 Poisson polynomial regression on those bin counts gives a smooth log-density log⁡f^(z)\log \hat f(z), and a quadratic fitted on ∣z∣≤2|z| \le 2 performs central matching.

That central parabola reads off the empirical null center μ^0\hat\mu_0, scale σ^0\hat\sigma_0, and null proportion π^0\hat\pi_0. The engine clamps ∣μ^0∣≤0.5|\hat\mu_0| \le 0.5, π^0∈[0.05,1]\hat\pi_0 \in [0.05, 1], and σ^0∈[0.35,3]\hat\sigma_0 \in [0.35, 3] in the rectangular engine ([0.35,6][0.35, 6] in the triangular engine). Each candidate receives a local false discovery ratelfdr⁡(z)=π^0 ϕ(z;μ^0,σ^02)f^(z),\operatorname{lfdr}(z) = \frac{\hat\pi_0\, \phi(z; \hat\mu_0, \hat\sigma_0^2)}{\hat f(z)},where ϕ\phi is the normal density. Sorting candidates by lfdr⁡\operatorname{lfdr} from smallest to largest, the gate admits the longest prefix whose running mean lfdr⁡\operatorname{lfdr} stays at or below q=0.40q = 0.40 (raised from 0.100.10 in September 2026). Rounds with fewer than 50 candidates or invalid central curvature fall back to Benjamini-Hochberg; numerical nonconvergence defers admission. Refinement stops once the cell budget max⁡(600,N/24)\max(600, N/24) is reached, no candidate is scoreable, or three consecutive rounds admit nothing.

Step 3

EM depth variance and the spike-and-slab reframing. Between rounds, the prior variance τd2\tau_d^2 at each depth dd is updated from the set the set of gate-admitted free vertices at depth dd; structurally welded vertices never vote in τd2\tau_d^2 of gate-admitted free vertices at that depth. For every depth with ∣Sd∣≥3|S_d| \ge 3, EM setsτd2=max⁡ ⁣(τfloor2,1∣Sd∣∑m∈Sd(δ^m2+Vmm)),\begin{aligned}\tau_d^2 &= \max\!\Big(\tau_{\mathrm{floor}}^2,\\&\qquad \tfrac{1}{|S_d|}\textstyle\sum_{m \in S_d} (\hat\delta_m^2 + V_{mm})\Big),\end{aligned}where δ^m\hat\delta_m is the fitted surplus, working-posterior variance of surplus δm\delta_m, read from the diagonal of J−1J^{-1} (or rm⊤J−1rmr_m^\top J^{-1} r_m in nodal coordinates). Reading note: Adaptive mesh geometries: triangles, rectangles, and 3-D boxes is its working-posterior variance from J−1J^{-1}, and τfloor=0.005\tau_{\mathrm{floor}} = 0.005 logit (λmax⁡=4×104\lambda_{\max} = 4\times 10^4). Depths with fewer than 3 admissions borrow from the nearest depth that has them; structurally welded vertices never vote.

Estimating τd2\tau_d^2 from gate winners alone looks biased at first glance: in a simulation against a pure Gaussian truth, winners-only EM overestimates the true variance by roughly 3×3\times. Yet four selection-aware and marginal alternatives tested on the rectangular engine all tied or lost on the single-issuer year battery. Truncated conditional likelihood gave −0.01%-0.01\% (SE 0.05%0.05\%) with 4 failed fits; a single log-linear depth curve gave −0.04%-0.04\% (SE 0.06%0.06\%) with a flat profile (1.88 to 1.93 logits). Plain marginal likelihood over every scored candidate lost +0.78%+0.78\% (SE 0.14%0.14\%) with erratic depth scales, and an explicit two-component null/slab mixture lost +0.37%+0.37\% (SE 0.11%0.11\%). Together, the gate and EM act as an implicit a two-component prior placing point mass at zero (the spike, enforced by the gate) and a diffuse Gaussian over active surpluses (the slab, whose variance is estimated by EM on the admitted winners): the gate enforces the spike and winners-only EM estimates the slab variance. Fitting one Gaussian over mostly-null candidates compromises both components, and independent-draw mixtures misread spatially correlated candidate scores.

Step 4

Six failure modes that bit production runs. Every design choice above came from diagnosing concrete breakdowns on the 2020 Ginnie Mae disclosure panel. The first two live inside the variance and binning updates.

1. The wholesale-weld freeze (self-measuring shrunk surpluses). An earlier update estimated τd2\tau_d^2 by matching a DerSimonian-Laird moment to already-shrunk surpluses without adding VmmV_{mm} back. Because shrinkage shifts mass out of δ^m2\hat\delta_m^2 into posterior variance VmmV_{mm}, lowering τd2\tau_d^2 shrunk δ^m2\hat\delta_m^2 further until τd\tau_d hit the floor and froze entire depths (reaching λ=108\lambda = 10^8 under an earlier 10−410^{-4}-logit floor, and collapsing to λ=4×104\lambda = 4\times 10^4 under the 0.0050.005-logit floor). Adding VmmV_{mm} via EM removed that absorbing state and improved 2020 single-issuer held-out deviance by −0.75%-0.75\% (SE 0.15%0.15\%).

2. Hard histogram binning instability. Before linear binning, a float32-sized rounding perturbation nudged a single candidate score across a histogram bin edge in Lindsey's method, shifting σ^0\hat\sigma_0 by 0.3%0.3\% and changing pooled admissions in 4 of 6 perturbed runs. Splitting each score linearly between its two adjacent bin centers cut perturbed admission changes to 0 of 6.

3. Extrapolation blow-up hidden by random splits. Starting with a free depth-2 backbone beat the depth-1 backbone on Ginnie (−0.57%-0.57\%) and on random splits, so it was briefly adopted. Holding out the newest 20% of issue months exposed the trap: free quarter-scale heights at the data boundary extrapolated steeply into unseen young ages, losing +139%+139\% against the triangular engine over the year (worst month +581%+581\%). Even with a depth-1 backbone, unpenalized rectangular roots let the bilinear surface's twist swing an empty old-age corner to −2.68-2.68 logits (against −1.82-1.82 for triangular planes), costing +6.6%+6.6\% versus triangles on cohort extrapolation. Adding a N(0,1)\mathcal{N}(0, 1) prior on the four rectangular roots cut cohort-split deviance by −7.1%-7.1\% (SE 3.0%3.0\%, better in 9 of 12 months) relative to flat rectangular roots while staying neutral on the single-issuer random-split battery (−0.03%-0.03\%, SE 0.05%0.05\%).

4. High-signal null absorption. On round 0 of the rectangular SMM benchmark (seed 1), nearly every candidate carried genuine signal. Lindsey's central quadratic fit interpreted that dense signal as a wide null (σ^0≈4\hat\sigma_0 \approx 4), admitted zero candidates for three rounds, and halted with only the 9 starting coefficients. Capping σ^0≤3\hat\sigma_0 \le 3 cut rectangular SMM seed 1 deviance from 1.6851.685 to 1.2691.269 and also improved 3 of 36 triangular pooled fits by up to 28.7%28.7\% with none worse.

5. One-knob-two-rooms and 6. Row-cache line-search stalls. Welded descendants carry a free vertex's influence well beyond its immediate one-ring star. Reading only local star support misdiagnosed its footprint, so all scoring, support audits, and retirement must read the full realized column through welds. Finally, linearizing rows within 0.010.01 logits of their cached base introduced a small discontinuity when a row crossed 0.010.01 during Newton backtracking, stalling 1 of 72 battery fits at ∣score∣=8.5×10−6|\text{score}| = 8.5\times 10^{-6}. Rebasing the cache and falling back to exact moments eliminates the stall.

Terms

Bias-corrected score
Scorr=x⊤s−c⊤J−1Pθ=(x−Xa)⊤sS_{\mathrm{corr}} = x^\top s - c^\top J^{-1} P\theta = (x - Xa)^\top s because X⊤s=PθX^\top s = P\theta; standardize by Vcand\sqrt{V_{\mathrm{cand}}}.
Empirical null
Degree-6 Poisson fit to 72 linearly binned histogram bins on [−9.5,9.5][-9.5, 9.5], central match on ∣z∣≤2|z|\le 2, cap σ^0≤3\hat\sigma_0 \le 3 (rect), admit prefix with mean lfdr⁡≤0.40\operatorname{lfdr} \le 0.40.
EM depth variance
τd2=max⁡(∣Sd∣−1∑m∈Sd(δ^m2+Vmm),τfloor2)\tau_d^2 = \max(|S_d|^{-1}\sum_{m\in S_d}(\hat\delta_m^2 + V_{mm}), \tau_{\mathrm{floor}}^2) (τfloor=0.005\tau_{\mathrm{floor}} = 0.005 logit); adding VmmV_{mm} stops the absorbing floor freeze.
Implicit spike-and-slab
Winners-only EM estimates the slab variance while the gate enforces the spike; four selection-aware/marginal fixes all tied or lost on held-out deviance.
Extrapolation guard
Keep depth-1 starting backbone and put a N(0,1)\mathcal{N}(0,1) prior on the four rectangular roots to stop bilinear corner twist on held-out cohorts.

Sources

Connected notes

  • Because ∥X∥2\|X\|^2 exceeds ∥θ∥2\|\theta\|^2 by about dd on average, the best factor is about 1−d/∥X∥21-d/\|X\|^2, and the James-Stein version beats the raw observation at every θ\theta once d≥3d\ge3.

  • By the note's rough estimate the difference between two average pass@1 scores, over about 120 problems with 16 samples each, has a standard deviation of at most about 0.016 before any training-seed variation, so gaps of 0.01 to 0.02 between eviction methods are not resolved.

  • A trained linear-attention layer keeps the fraction Nλi/((N+1)λi+trΣ)N\lambda_i/((N+1)\lambda_i+\mathrm{tr}\Sigma) of the signal in eigendirection ii, a ridge-like shrinkage fixed at training time that does not weaken as the prompt grows; and because the layer applies a fixed matrix where least squares would invert the prompt's sample covariance, its error keeps a 1/M1/M term even on noiseless prompts.

  • A speedrun record must show that its mean validation loss over several runs is at most 3.28 at one-sided p<0.01p\lt0.01, with the token streams fixed, and changes that only touch systems performance are exempt from the test, since they compute the same updates up to rounding.

Threads