Participant: oleg_vasiliev · Code: single-file estimator v3_cumulant (sha e785a0b698a8), MIT license, in the first reply to this topic.
Eligibility note. Our final bundle passed
whest validateand a local replica of the client–server grader, but it was never uploaded during Phase 2. Our first upload attempt, on 24 October, was rejected with “Phase 2 is completed — submissions are closed”. We understand that this write-up therefore does not meet the formal requirement for the algorithmic-contribution prize (one graded Phase 2 submission). We publish it because the diagnostics may be useful to ARC and to other participants. All numbers below are our own local measurements, not leaderboard scores.
TL;DR
We propagate the pre-activation mean, covariance, third cumulant and two slices of the fourth cumulant through the network. The third cumulant is stored as a sum of sources: one is born at every ReLU and is carried forward on three “legs”. A first version of this chain underestimated per-neuron skewness by about 30 % (regression slope 0.65–0.72 against Monte Carlo) and stalled at MSE 4.6e-7. Four leading-order corrections bring the slope to 0.97 at L2 and 0.994–1.002 on L3–L16, and the final-layer MSE on MLPs 1001–1002 to 3.19e-8 (numpy float64 prototype) and 3.33e-8 (flopscope estimator, 50 % of the FLOP budget). On four MLPs the flopscope estimator gives 3.65e-8. Gaussian closure with the exact bivariate Price series gives 4.0e-6 on the same networks.
- Repeated-index gain. An index that appears twice in a cumulant is transported through ReLU with gain γ = Φ − d₀d₂, not Φ². Using Φ² doubles the MSE. For completeness we also derive a cross term d₀(1−Φ)·d₂ for κ₃(z_i,z_k,z_k) and the diagonal gain g₃ = Φ − (m₂/2)d₃ − d₀d₂ + d₀²d₃; at this width their effect is within noise.
- Exact Gaussian semi-diagonal at birth, to all orders of the covariance: κ₃(a_i,a_i,a_k) = Σ_{r≥1} C_ik^r/r! · d_r(k) · (2d_{r−1}(i) − 2d₀(i)d_r(i)). The C² terms summed over i are coherent (all positive), so truncating the series at r = 1 (first order in C) loses an O(1/n) contribution and multiplies the MSE by 10.
- Pair slice of κ₄, Q_ik = κ₄(z_i,z_i,z_k,z_k). It is coherent, effectively rank one, and enters κ₃ transport as ½·Q·γ·d₂. It is itself transported with γ_iγ_k and receives 2γ_i·e_k·κ₃(z_i,z_i,z_k) with e = d₀(1−Φ). Without these terms the chain does not reproduce the input-norm (“global”) mode.
- (3,1) slice of κ₄ in scale-mixture form, R_ik = κ₄(z_i,z_i,z_i,z_k) ≈ (K_i/s_i²)·C_ik. It is used in the post-ReLU covariance and in κ₃ transport: −22 % MSE.
We also report diagnostics that we think are useful to others: where the remaining error lives, what the “global mode” of κ₃ really is, and which compressions and windows of the source chain are lossless or catastrophic.
All MSE numbers are final-layer MSE against our own Monte-Carlo ground truth. We used 4.2 M inputs per MLP; the networks are generated exactly as in the official bake (seed protocol 3.0, SeedSequence(seed).spawn(3), He-init float32), and we checked this bitwise. The MSE is debiased by subtracting mean(var)/N. The MC noise floor at the final layer is ≈1.8e-8 before debiasing.
1. Notation
At layer t the pre-activation is z (width n = 1024) with mean m and covariance C. Write s_i = √C_ii, α_i = m_i/s_i, φ = φ(α), Φ = Φ(α). The post-activation is a = relu(z) with mean μ.
Hermite table of ReLU under the Gaussian marginal N(m_i, s_i²):
d_k(i) = E[relu^(k)(z_i)]: d0 = s(αΦ + φ), d1 = Φ, d_k = (−1)^k He_{k−2}(α) φ / s^{k−1} (k ≥ 2)
He are the probabilists’ Hermite polynomials. Raw moments m_j = E[relu(z)^j]: m₂ = s²((α²+1)Φ + αφ), and so on.
Bivariate Price series, used everywhere, with K = 12 terms:
e_pq(i,k) = Σ_r C_ik^r / r! · d_{r+p}(i) · d_{r+q}(k)
Gaussian closure: Cov(a_i,a_k) = Σ_{r≥1} C_ik^r/r! d_r(i)d_r(k), μ = d₀, then m’ = Wᵀμ and C’ = WᵀCov(a)W. MSE 4.0e-6 (4 MLPs, 2.3 % of the budget).
2. What is propagated
Mean (Edgeworth to 4th order):
μ_i = d0 + D3_i·d3/6 + K_i·d4/24
E[a_i²] = m2 + D3_i·d2/3 + K_i·d3/12
Here D3_i = κ₃(z_i,z_i,z_i) and K_i = κ₄(z_i,z_i,z_i,z_i).
Post-ReLU covariance (bivariate Edgeworth; complete at O(1/n) given the slices):
Cov(a_i,a_k) = Σ_{r≥1} C^r/r! d_r d_r
+ ½ (G_ik e21(i,k) + G_ki e21(k,i)) G_ik = κ3(z_i,z_i,z_k)
+ (D3_i e30(i,k) + D3_k e30(k,i)) / 6 (e30, e40 start at r = 1)
+ ¼ Q_ik e22(i,k) Q_ik = κ4(z_i,z_i,z_k,z_k)
+ R_ik e31(i,k)/6 + K_i e40(i,k)/24 + (i↔k) R_ik = κ4(z_i,z_i,z_i,z_k)
Third cumulant as a sum of sources. Each ReLU gives birth to one source, with hubs h at the birth layer. In post-activation coordinates of the birth layer:
κ3(a)_born = Σ_h [ wa_h Sym(e_h, V_h, V_h) + wb_h Sym(e_h, e_h, V_h) + Sym(e_h, e_h, B_h) + wc_h e_h⊗e_h⊗e_h ]
V = C·diag(Φ), so V_hk = C_hk Φ_k, and wa = d₂. This is the first-order hub term d₂(h)·C_hk C_hl Φ_k Φ_l. After the linear map the legs become P = W, A = VW and B = Bmat·W. At every later layer each leg is multiplied column-wise by Φ and then by W. Contracting the legs gives the slices we need:
D3_j = Σ_sources Σ_h [ 3 wa P A² + 3 wb P² A + 3 P² B + wc P³ ]_hj
G = Σ_sources [ (2wa P∘A + wb P∘P)ᵀ A + (P∘P)ᵀ B + (wa A∘A + 2wb P∘A + 2P∘B + wc P∘P)ᵀ P ]
The cost is one n³ product per leg per source per layer. That makes the method quadratic in depth, which is its main weakness (section 5).
Fourth cumulant: diagonal K and pair slice Q, mapped coherently through W∘W: Q’ = (W∘W)ᵀ(Q_a + diag K_a)(W∘W) and K’ = 3·diag((W∘W)ᵀQ_a(W∘W)) + (W^{∘4})ᵀK_a.
3. The corrections (the algorithmic contribution)
3.1 Repeated indices are transported with γ = Φ − d₀d₂, not Φ²
Plain leg transport multiplies every index by Φ. That is the zeroth-order-in-C transport of an index that appears once. Take z with Gaussian part C plus a small third cumulant T, and expand E[F(z)] to first order in T: δE[F] = (1/6) Σ T_abc E_G[∂_abc F]. Apply this to κ₃(a_i,a_i,a_k) = E[ã_i² ã_k] with ã = a − μ:
- T_iik is multiplied by ½·E[∂²_i (relu − μ)²]·Φ_k = (Φ_i − d₀(i)d₂(i))·Φ_k = γ_i Φ_k. The reason: E[relu’²] = Φ and E[(relu − μ)·relu’'] = −μ·φ/s.
- T_ikk (k appears twice, i once) gives a cross term E[∂_i (relu − μ)²]·½E[relu’'_k] = d₀(i)(1−Φ_i)·d₂(k).
- The diagonal T_iii is multiplied by g₃ = Φ − (m₂/2)d₃ − d₀d₂ + d₀²d₃.
Leg transport already supplies Φ per index. So the newborn source receives the difference through its B leg and its wc weight:
Bmat += (γ_i − Φ_i²) G_ik Φ_k + d0_i(1−Φ_i) G_ki d2_k
wc += (g3 − Φ³) D3
The same gains apply to κ₄: Q_a ⊃ γ_iγ_k Q, and the diagonal gain is g₄ = Φ − d₀d₂ − (m₃/6)d₄ − (m₂/2)d₃ + d₀m₂d₄ + d₀²d₃ − d₀³d₄.
Measured effect: with Φ² instead of γ the MSE rises from 3.19e-8 to 6.67e-8 (×2.1). Removing the cross term or the diagonal gain gives 3.12e-8 and 3.21e-8, the same as the reference within noise. What matters is γ on the semi-diagonal; the other two terms are kept because they are the correct leading-order terms.
3.2 Exact Gaussian semi-diagonal at birth
The first-order hub term puts only 2wa_iV_iiV_ik + wa_kV_ki² on κ₃(a_i,a_i,a_k). The exact Gaussian value, from the Price series of (relu − μ)² against relu, is
κ3(a_i,a_i,a_k) = Σ_{r≥1} C_ik^r / r! · d_r(k) · (2 d_{r−1}(i) − 2 d0(i) d_r(i))
The r = 2 term is C_ik²·γ_i·d₂(k). It is positive for every pair, so Σ_i C_ik² γ_i is coherent and of order 1. After the next linear map it gives an O(1/n) contribution to D3_j, of the same order as D3 itself. We put the difference (exact − hub part) into the B leg. Measured effect: keeping only the r = 1 term of this series, κ₃(a_i,a_i,a_k) ≈ 2d₀(i)(1−Φ_i)Φ_k C_ik, gives 3.25e-7 instead of 3.19e-8 (×10). This is the single most important correction. The B leg is an n×n matrix per source. We store it as a “V-proportional” part that rides on leg A with hub weight wb (the β-split) plus a rank-40 remainder, found with a randomized range finder with one power iteration.
3.3 Pair κ₄ and its exchange with κ₃
Q_ik = κ₄(z_i,z_i,z_k,z_k) is born from the Gaussian pair (all orders of C): Q_a = c₂₂ − 2c₁₁² + 4μ_iμ_k c₁₁ − 2μ_i c₁₂ − 2μ_k c₂₁, with c_pq the Price covariances of relu^p and relu^q. Two exchange terms keep κ₃ and κ₄ consistent:
- κ₄ → κ₃:
Bmat += ½·Q_ik·γ_i·d2_k - κ₃ → κ₄:
Q_a += 2γ_i·e_k·G_ik + (i↔k)with e = d₀(1−Φ), andK_a += D3·(4d0(1−Φ) − (2/3)m3 d3 − 2 m2 d2 + 4 d0 m2 d3 + 4 d0² d2 − 4 d0³ d3)
Q is coherent: replacing Q_a by its leading eigenpair (rank 1) changes the MSE from 3.19e-8 to 3.19e-8. So in a cheaper implementation κ₄ costs O(n²) per layer instead of 2 n³ products.
3.4 (3,1) slice of κ₄ in scale-mixture form
For a Gaussian scale mixture z = ρ·g with Var(ρ²) = v, the cumulants are K_i = 3v s_i⁴ and R_ik = κ₄(z_i,z_i,z_i,z_k) = 3v s_i² C_ik, hence R = (K/s²)·C. We use this form both in the covariance (terms e31/6 and e40/24) and in κ₃ transport: Bmat += R_ik (d2_i − d0_i d3_i) Φ_k / 3 + R_ki d0_i (1−Φ_i) d3_k / 3. Effect: 4.1e-8 → 3.19e-8 (−22 %) on the same two MLPs.
3.5 Performance impact
| variant (numpy float64 prototype unless noted) | final-layer MSE |
|---|---|
| Gaussian closure, exact bivariate Price series (K = 12) | 4.0e-6 |
| + third-cumulant sources (first-order births, every index transported with Φ, no κ₄) | 4.6e-7 |
| + 3.1, 3.2, 3.3 (full chain without R) | 4.65e-8 (4 MLPs); 4.1e-8 on MLPs 1001–1002 |
| + 3.4 (R slice) | 3.19e-8 (MLPs 1001–1002) |
| final flopscope version (rank-40 B leg, float32; local evaluation) | 3.33e-8 on MLPs 1001–1002; 3.65e-8 on 4 MLPs; 0.50 of budget, local score ≈ 1.8e-8 |
Ablations from the full chain (3.19e-8, MLPs 1001–1002), removing one ingredient at a time:
| removed ingredient | MSE | × reference |
|---|---|---|
| none (reference) | 3.19e-8 | 1 |
| 3.2: semi-diagonal birth series truncated at r = 1 (first order in C) | 3.25e-7 | ×10 |
| all of κ₄ (K, Q, R) | 3.54e-7 | ×11 |
| K in the Edgeworth mean and in E[a²] | 2.24e-7 | ×7.0 |
| 3.3: κ₄ → κ₃ exchange (½·Q·γ·d₂) | 2.19e-7 | ×6.9 |
| 3.3: κ₃ → κ₄ exchange (2γ·e·G in Q, D3 terms in K) | 1.71e-7 | ×5.3 |
| 3.1: γ replaced by Φ² for repeated indices | 6.67e-8 | ×2.1 |
| Q in the post-ReLU covariance (¼·Q·e22) | 5.60e-8 | ×1.75 |
| 3.4: R slice | 4.1e-8 | ×1.29 |
| 3.1: cross term d₀(1−Φ)d₂ | 3.12e-8 | ×0.98 (noise) |
| 3.1: diagonal gain g₃ | 3.21e-8 | ×1.01 (noise) |
Skewness check against MC (MLP 1001): the regression slope of predicted standardized D3 on MC κ₃ is 0.97 at L2 and 0.994–1.002 at L3–L16. The reverse regression gives 0.98–1.01, and the correlation is ≥ 0.99 on every layer. The naive chain gives 0.65–0.72. Mean standardized κ₄ is within 3 % of MC up to L8 and 7 % short at L16 (0.0619 vs 0.0664).
4. Where the remaining error is
- It is not the marginal skewness. D3 matches MC to within about 2 % on every layer from L3 on. Injecting the MC pre-activation means and variances at every layer, even into our early κ₃-only chain, gives a final MSE of 1.2e-8 on MLP 1001, which is at the noise level of that test.
- It is in the propagated m and s. At L16 the RMS errors are ≈7.4e-4·s in m and ≈8.7e-4·s in s, after removing the MC noise floors (5.1e-4·s and 3.4e-4·s, measured at L1 where the chain is exact). They grow steadily from about L6 onwards.
- Hypotheses, not verified: two first-order-in-C corrections to κ₃ transport are absent from our chain, and power counting says both are O(1/n) in D3 at the next layer. The first is a “hub with a G leg” term, ½·G_ik·C_il·d₃(i)Φ_kΦ_l, plus the chain term G_ik C_kl d₂d₂Φ. The second is the (2,1,1) slice of κ₄ feeding general κ₃ entries, ½·κ₄(z_i,z_i,z_k,z_l)·d₂(i)Φ_kΦ_l. The fact that D3 already agrees with MC to about 2 % suggests they largely cancel in D3, so they may matter mainly through the covariance. We ran out of time to test this. A width scan (MSE ∝ n⁻⁴ if the chain is exact at O(1/n), ∝ n⁻² otherwise) would settle it.
The “global mode” of κ₃ is not just the input norm
The input norm gives an exact scale mixture: x = r·u with r = |x|/√n independent of the direction u, E r² = 1, Var r² = 2/n. This gives κ₃ = (1/n)·Sym(m⊗C), so D3_j = 3m_j s_j²/n, and K_j = 6s_j⁴/n. In our chain D3 is strongly aligned with this template: correlation 0.70 at L2 and 0.95 at L16. The coefficient is far larger than 1, though: c = 3.3 at L2, growing to 12 at L16. For K the coefficient is only 1.6 → 8.4. So the global structure is not a pure scale mixture. At L2 a back-of-the-envelope estimate (α = 0 and s² ≈ 2 at layer 1, mean-field sums) reproduces the coefficient:
- The diagonal term Σ_i W_ij³ κ₃(a_i) correlates with m_j = Σ_i W_ij μ_i, because corr(ΣW³, ΣW) = 3/√15 ≈ 0.77 for Gaussian W. With weight variance σ² = 2/n its projection is 3σ²·κ₃(a)/μ̄ per unit of m_j, which gives c ≈ 2.4. This is a per-neuron (local) quantity that merely looks global.
- The coherent semi-diagonal Σ_{i≠l} κ₃(a_i,a_i,a_l) ≈ γd₂·Σ_{i≠l}C_il² (from 3.2) gives c ≈ 1.0.
- Total ≈ 3.4, against a measured 3.30.
Consequence for cheap methods: a scalar “scale variance” cannot replace old sources. An oracle that keeps only the last w sources and adds the exact global coefficient for the dropped ones gives:
| last w sources kept | MSE (MLP 1001; full chain 3.46e-8) |
|---|---|
| 1 | 7.0e-7 (1.44e-6 without the global term) |
| 2 | 4.4e-7 (9.4e-7) |
| 3 | 3.2e-7 (6.6e-7) |
| 5 | 1.5e-7 (2.5e-7) |
Per source, the global coefficient decays with age: the source born at layer 1 goes 3.3 → 1.5 → 0.9 → … → 0.2. The local residual (the part not explained by the global template) decays at a similar rate, on average by 15–20 % per layer and faster in the first two layers. A source keeps a sizeable local part for about ten layers. Old sources therefore matter, and the source representation is inherently O(L²·n³).
5. Cost: what compresses and what does not
All rows are on MLPs 1001–1002. Rows marked (a) are relative to the full chain with the R slice, 3.19e-8. Rows marked (b) were run earlier, relative to the chain without the R slice, 4.1e-8.
| change | effect on MSE |
|---|---|
| (a) sources from age 6 on stored in their own rank-256 basis (SVD of [P;A;B] at age 6, then exact transport of the basis) | 3.18e-8: lossless |
| (a) own basis from age 4, rank 384 / rank 256 | 3.20e-8 / 3.52e-8 |
| (a) Q_a of rank 1 / 4 / 16 | 3.19 / 3.17 / 3.14e-8: lossless |
| (b) old sources in one shared evolving basis from age 4, rank 256 / 128 | +46 % / +270 % |
| (b) B leg of rank 32 / 8 / 1 via SVD; hub-averaged B | +7 % / +15 % / +450 %; +34 % |
| (b) drop G of sources of age ≥ 8 / age ≥ 4 | +25 % / ×7.6 |
| (b) drop D3 of sources of age ≥ 4 | ×15 |
| (a) K-terms in the semi-diagonal, hub-weight (1+λ₄/3), K×C in pair κ₄ | < 1 % each |
| κ₃² term in the mean (early κ₃-only chain, 4 MLPs: 4.57e-7 → 4.60e-7) | < 1 % |
Batched Strassen–Winograd written in flopscope primitives cuts counted FLOPs by only a factor of 0.64–0.70, because of the copies, and runs much slower than plain matmul in wall time.
Honest assessment: the corrections lower the MSE of Gaussian closure by ×125, but our implementation spends 50 % of the budget. Its local score (≈1.8e-8) is far from the top of the leaderboard, where MSE ≈ 1.5e-8 is reached at ≤ 10 % of the budget. We estimate that the lossless compressions above (per-source bases, rank-1 κ₄) would bring the cost to roughly 0.3 of the budget; they are measured in the prototype but not built into the final estimator. Going below that needs a representation of old κ₃ sources that is not O(n³) per source and per layer, which we did not find.
6. Implementation notes (flopscope, client–server grader)
- No data-dependent Python branching and no synchronizing calls. Measured on a local replica of the grader (flopscope-client 0.12.0 without numpy, plus flopscope-server): residual time 0.17 s (0.74 s when the same code runs in-process), about 60 s per MLP on 2 cores.
- The Price series is built as elementwise powers C^r/r! from an untagged copy (
C * ones_row). Elementwise series on a symmetric-tagged tensor, broadcast against non-symmetric operands, raised a SymmetryError (“max deviation = inf”) on the server path but not in-process.fnp.ones((n, n))is itself tagged symmetric. - Sources are stacked into (n_sources, n, n) tensors. G and the transport use one reshape + matmul each, about 3× faster in wall time than the equivalent einsum.
sum(axis=(0,1))works in-process but fails with a TypeError on the client–server path, so we use two single-axis sums.flops.stats.norm.cdfpromotes float32 input to float64, which is billed at twice the rate, so we cast the result back to float32.
The SymmetryError and the tuple-axis sum behave differently in the in-process backend and on the grader path. They may be worth aligning in flopscope, because an estimator can pass local tests and still fail at grading.
7. Process and use of AI tools
The theory was developed iteratively. We built a numpy float64 prototype, validated each slice (D3, K, the slopes) against per-neuron MC moments, derived the missing transport rules where the slope was off, and then ported the result to flopscope. All derivations and code were produced with the help of an AI assistant (Claude, Anthropic); I take responsibility for the accuracy of this write-up. Statements marked as hypotheses were not verified. Background: Wu, Lecomte, Winer, Robinson, Hilton, Christiano, arXiv:2605.05179. Factorized third-cumulant propagation has also been discussed publicly on this forum. The corrections in section 3 and the diagnostics in sections 4–5 are our own measurements on our own code.