WH route B doc section 5 (git e5ff055)
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340---title: "Witsenhausen route B: does one conditional diffusion model of the x1 law beat lookup as the instance family grows?"date: 2026-10-20status: resultclaim: "With controller 2 computed exactly, one conditional diffusion model of the x1 law transfers controller 1 across an 11-parameter WH family better than nearest-neighbour lookup, by a margin that grows with the bank size (pre-registered confirmation: 52.5% vs 13.5% within 1%). Its own denoiser is not a usable controller 2 (pre-registered KILL)."maps_to: "paper: WH section next to X21 (amortization across plants), if the framing 'generate controller 1, compute controller 2 exactly' is adopted; otherwise appendix"scripts: [witsenhausen/route_b.py, witsenhausen/route_b_gates.py, witsenhausen/tonight.sh, witsenhausen/andromeda_rb.sh, witsenhausen/andromeda_rb_fix.sh, witsenhausen/route_b_ablation.py, witsenhausen/route_b_samp.py, witsenhausen/route_b_qreg_diag.py]artifacts: [results/witsenhausen/route_b_andromeda/ (gate run, N = 1000), results/witsenhausen/route_b_N/ (N grid), results/witsenhausen/route_b_confirm/ (confirmation; gates_s1_N3000.txt), results/witsenhausen/route_b_ablation/ (section 5), HF matCercola18/DiffusionControl]---
# Witsenhausen route B: does one conditional diffusion model of the x1 law beat lookup as the instance family grows?
**TL;DR**- **Question:** when Witsenhausen (WH) instances differ in more than (k, sigma), does a conditional diffusion model of Q (the law of x1) beat nearest-neighbour lookup at the same bank size?- **Answer:** not under the pre-registered primary metric, where each method ships its own controller 2. There the kill rule fires at every bank size, and GEN reaches 0-0.5% of 11-parameter instances within 1% against 4-5.5% for lookup. With controller 2 computed exactly for every method, GEN wins on the 11-parameter family, and the margin grows with the bank: +13 points at N = 1000, +42 at N = 3000. A pre-registered confirmation on 200 fresh test instances with a fresh GEN seed gives 52.5% against 13.5% (+39 points, McNemar p 3.1e-15).- **So what:** the model learns controller 1 (the signalling map) well, but its own denoiser makes a poor controller 2. The claim on offer is "generate controller 1, compute controller 2 exactly". It is confirmed, but the exact-Bayes metric started as a diagnostic, so adopting it as the paper's framing is the user's decision. An ablation (section 5) shows that the multi-noise diffusion training is not what does the work: the same network trained at the channel noise alone ties GEN at m = 4 (57.5% against 52.5%) and beats it at m = 2.
## 1 Problem / Goal
E2 (commit 9370c9f) amortized WH over (k, sigma) and lost: kNN reached 88% of held-out instances within 1% of the ceiling, the generator 7.7%.A 2-parameter family is too small for a generator to matter.Route B asks: **at bank size N and family dimension d, is the generator's within-1% rate higher than kNN's, and does the gap grow with d?**- Confirms: the gap is positive at the largest family and grows with d.- Refutes: kNN ties or wins at the largest family (kill rule below).
**Pre-registered outcomes (fixed 2026-10-20, before any run).**- **C1 (GEN works):** at m = 1, N = 1000, GEN within-1% >= 70%.- **C2 (the claim):** at m = 4, N = 1000, GEN within-1% exceeds KNN-BR by >= 10 points, McNemar p < 0.05.- **C3 (the trend):** gap(m = 4) - gap(m = 1) > 0, where gap = within-1%(GEN) - within-1%(KNN-BR) at N = 1000, with a paired bootstrap 95% CI over the 200 test seeds that excludes 0 (test seed s draws the same (k, sigma) for every m, so the comparison across m is paired); m = 2 is reported, not gated.- **KILL:** at m = 4, N = 1000, KNN-BR >= GEN. Then route B is dropped for WH, and WH stays a route-A (per-instance) result in the paper.- Everything else (N = 300, 3000 rows; data-free training of GEN) is reported as secondary.
## 2 Method
**Family F_m.** Scalar WH, J = k^2 E(x1 - x0)^2 + E(x1 - E[x1|y])^2, y = x1 + w, w ~ N(0, 1).- The source x0 is a Gaussian mixture with m components, then affinely normalized to mean 0 and standard deviation sigma.- Weights ~ Dirichlet(2,...,2); raw means ~ N(0, 1); raw sds ~ LogUniform[0.2, 1]; components sorted by mean.- k ~ LogUniform[0.1, 0.5], sigma ~ LogUniform[2, 10].- Conditioning vector c = (log k, log sigma, weights, means / sigma, log(sds / sigma)).- Effective dimension d = 2 + 3m - 3: m = 1 gives d = 2 (the E2 family), m = 2 gives d = 5, m = 4 gives d = 11.
**Ceiling (per instance, not our method).** Exact-denoiser Lloyd on grids: 1D x0 grid weighted by the mixture density, exact Bayes estimator on a y grid, V(z) = E_w (z - g*(z + w))^2, assignment by argmin.- 5 restarts (identity, 0.5 x identity, staircases of spacing 4, 6.5, 9); the best is continued for 4x more iterations (Lloyd converges sublinearly).- Check: at (k, sigma) = (0.2, 5) it gives 0.1669602, +0.023% over the E1 value 0.1669223 (one point checked; more E1 grid points after the run).- Lloyd with 5 fixed restarts can stop in a local optimum on multimodal sources, so an arm can land below the reference (negative regret). "Within 1%" stays well defined; the report prints the share of instances below the reference per arm.
**Bank.** N solved instances per m, train seeds 0 to N - 1; 200 held-out test instances per m, seeds 1,000,000-1,000,199. The x1 law of each solution is stored exactly (grid support and masses); GEN trains on 2048 quantile nodes per instance. Bank files carry their size in the name (bank_m4_train1000.pkl), so a smaller stale bank is never reused silently.
**Arms (same bank for all).**- GEN: conditional EDM denoiser D(y, s | c) trained by denoising score matching on the bank's x1 nodes, the X21 recipe in Q coordinates (route_b.py:211-262; width 256, depth 6, 30000 Adam steps, batch 4096). - Controller 2: D(y, 1 | c) (Tweedie). - Controller 1: the best response to D, x1 = argmin k^2 (z - x0)^2 + V(z), with V from D on a y grid. - No sampling and no refinement: the deterministic denoiser is the controller (K = 1, S = 0 in the paper's notation). - The run also prints GEN's fit on its first 50 training instances, so an under-fit model can be told from poor generalization.- KNN-BR: nearest bank instance in standardized c (all 2 + 3m dimensions); controller 2 = that instance's exact Bayes estimator; controller 1 = best response to it under the new source. This is the same mechanism as GEN with retrieval in place of generation.- KNN-KS (secondary, added 2026-10-20 before any run): KNN-BR with the neighbour chosen on standardized (log k, log sigma) only. GEN receives the exact (k, sigma); a neighbour chosen in 11 dimensions does not. If KNN-KS >= GEN at m = 4, a C2 pass cannot be read as "generation beats retrieval". At m = 1 KNN-KS equals KNN-BR (sanity check).- KNN-MAP: nearest instance's Q, monotone map from the new source onto it, its Bayes estimator.- AFF: best linear controller 1 (x1 = lambda x0, lambda in [0, 1.2]) with the exact Bayes controller 2 (floor; stronger than an affine pair for m >= 2).
**Metric.** Each policy's J is evaluated exactly on grids in two ways. **Honest:** with the controller 2 the arm ships (the primary metric). **Exact Bayes:** controller 1 is kept and controller 2 is replaced by the exact posterior mean E[x1 | y] of the law that controller 1 induces under the true source (a pre-registered diagnostic; in 1-D it is a grid integral, route_b.py:160 `g_from_law`). Regret = J / J_ceiling - 1. Within-1% = the share of the 200 held-out instances with regret <= 1%. McNemar test between GEN and KNN-BR on the same instances.
**Runs.**
| run | train bank | N | test seeds | GEN seed | where | output ||---|---|---|---|---|---|---|| gate run (pre-registered) | seeds 0-999 | 1000 | 1,000,000+ | 0; m = 4 also 1, 2 | andromeda CPU, 2026-10-21 (m = 4 also move-hpc, identical gates) | route_b_andromeda/ || N grid (secondary) | seeds 0-2999 | 300, 1000, 3000 | 1,000,000+ | 0 | move-hpc CPU (m = 1, 4; m = 2 at N = 300), virgo CPU (m = 2), 2026-10-21/22 | route_b_N/ || post-hoc GEN variants | seeds 0-999 | 1000 | 1,000,000+ | 0 | andromeda CPU, 2026-10-21 | route_b_andromeda/*_ema*.json || confirmation (pre-registered 2026-10-22) | seeds 0-2999 | 3000 | 2,000,000+ | 1 | virgo CPU, 2026-10-22 | route_b_confirm/ || confirmation, extra GEN seeds (post hoc, m = 4 only) | seeds 0-2999 | 3000 | 2,000,000+ | 2, 3 | virgo CPU, 2026-10-22 | route_b_confirm/ |
**Post-hoc GEN variants (decided 2026-10-21, after the gate run).** Weight EMA with decay 0.999 and 100000 steps, at width 256 (RB_EMA) and at width 512 (RB_WIDTH). They test whether GEN's honest loss is an optimization-precision problem. Not gate-eligible.
**Deviation (2026-10-22).** The m = 2 N grid first ran on andromeda in /dev/shm. At 11:06 UTC /dev/shm was emptied and the process ended, after N = 300 and N = 1000 had printed their honest lines (identical to move-hpc at N = 300: 1.5% vs 20.5%, McNemar 2 / 40). It was rerun from scratch on virgo; the table uses the virgo run. The virgo run reproduces both printed lines exactly (N = 300: 1.5% vs 20.5%; N = 1000: 10.0% vs 30.0%).
### Confirmatory run (pre-registered 2026-10-22, 10:41 UTC, before it ran)
**Why.** Under the primary (honest) metric, the gates above fail: C1 FAIL and KILL at every N of the N grid (results/witsenhausen/route_b_N). Under the exact-Bayes diagnostic, GEN beats KNN-BR on the 11-parameter family. The gap is +13 points at N = 1000 and +42 points at N = 3000 (GEN 52.5% vs KNN-BR 10.5%, McNemar p 2.9e-18; route_b_gates). The proposed framing is "generate controller 1, compute controller 2 exactly". GEN supplies controller 1. Controller 2 is the exact posterior mean of the resulting x1 law, a 1-D integral that every arm gets. That reading was a diagnostic, not a gate, so it counts only if it replicates on data it has not seen. Adopting the framing for the paper is the user's decision; this run decides whether it holds.
**What is fixed (identical to the N grid).** Code route_b.py at this commit. Train banks bank_m{1,2,4}_train3000.pkl (seeds 0-2999), N = 3000, 30000 GEN steps, width 256, no EMA.
**What is fresh.** 200 test instances with seeds 2,000,000-2,000,199 (RB_TEST0; the N grid tested on 1,000,000-1,000,199), and GEN seed 1 (the N grid used 0).
**Outcomes (exact-Bayes controller 2 for every arm; within-1% over the 200 fresh test instances).**- **P1 (primary):** at m = 4, GEN exceeds KNN-BR by >= 10 points, McNemar p < 0.05, and KNN-KS < GEN.- **P2:** at m = 1, GEN >= 70%.- **P3:** gap(m = 4) - gap(m = 1) > 0, paired bootstrap 95% CI excluding 0.- m = 2 and the honest metric are reported, not gated.- If P1 fails, the exact-Bayes framing gets no body claim and WH has none.
**How to run.**```bashbash witsenhausen/tonight.sh p2a # gate run, andromeda CPU (m = 1, 2; m = 4 GEN seeds 0-2) p2f post-hoc GEN variantsbash witsenhausen/tonight.sh p2n # N grid {300, 1000, 3000} per m (MS=2 PROCS=30 for m = 2 alone)bash witsenhausen/tonight.sh p2c # confirmation, virgo CPU, hard stop 15:00 UTCpython -m witsenhausen.route_b_gates results/witsenhausen/route_b_confirm 1 "" 3000 # OUT_DIR GEN_SEED TAG N```
**Compute.** Ceiling: 3-15 s per instance on one core; a 3000-instance bank takes about 9 min on 30 processes. GEN training and the 200 test evaluations: 7-22 min per (m, N) on 6-15 CPU threads.
## 3 Results
**Headline.** Under the primary metric GEN loses to lookup at every m and N. With controller 2 computed exactly for every arm, GEN beats lookup on the 11-parameter family by a margin that grows with N and replicates on fresh instances.
**Gate run** (N = 1000, GEN seed 0; within-1% in %, 200 test instances per m). Source: route_b_gates on results/witsenhausen/route_b_andromeda.
| m (d) | honest: GEN | KNN-BR | KNN-KS | exact Bayes: GEN | KNN-BR | KNN-KS ||---|---|---|---|---|---|---|| 1 (2) | 57.0 | 100.0 | 100.0 | 88.5 | 100.0 | 100.0 || 2 (5) | 9.5 | 30.0 | 18.0 | 69.5 | 41.5 | 29.0 || 4 (11) | 0.0 | 5.0 | 4.5 | 24.0 | 11.0 | 13.0 |
- Pre-registered verdict: **C1 FAIL** (57 < 70), **C2 FAIL**, **KILL fires** (KNN-BR 5.0 >= GEN 0.0). C3 passes (+38.0 points, CI [+30.5, +45.5]), but the pass is hollow: GEN loses at both m, and the gap shrinks at m = 4 only because lookup fails there too.- Same table under exact Bayes: C1 88.5% PASS; C2 +13.0 points, McNemar 42 / 16, p 0.00086, PASS; C3 +24.5 [+17.0, +32.0].- GEN seeds 1 and 2 at m = 4: honest 0.0% and 0.0%; exact Bayes 22.0% and 27.5% (KNN-BR 11.0%).
**N grid** (GEN seed 0; within-1% GEN / KNN-BR in %). Source: route_b_gates on results/witsenhausen/route_b_N, N = 300, 1000, 3000.
| m | metric | N = 300 | N = 1000 | N = 3000 ||---|---|---|---|---|| 1 | honest | 68.0 / 100.0 | 58.0 / 100.0 | 49.0 / 100.0 || 1 | exact Bayes | 84.5 / 100.0 | 87.5 / 100.0 | 75.0 / 100.0 || 2 | honest | 1.5 / 20.5 | 10.0 / 30.0 | 22.0 / 41.0 || 2 | exact Bayes | 54.0 / 28.5 | 70.5 / 41.5 | 78.5 / 51.0 (McNemar 77 / 22, p 2.5e-08) || 4 | honest | 0.0 / 4.0 | 0.0 / 5.0 | 0.5 / 5.5 || 4 | exact Bayes | 7.5 / 8.0 | 24.0 / 11.0 | **52.5 / 10.5** (McNemar 94 / 10, p 2.9e-18) |
**Confirmation** (pre-registered; N = 3000, fresh test seeds 2,000,000+, GEN seed 1; within-1% in %). Source: results/witsenhausen/route_b_confirm/gates_s1_N3000.txt.
| m (d) | honest: GEN | KNN-BR | KNN-KS | exact Bayes: GEN | KNN-BR | KNN-KS ||---|---|---|---|---|---|---|| 1 (2) | 46.5 | 100.0 | 100.0 | 76.0 | 100.0 | 100.0 || 2 (5) | 16.0 | 37.5 | 17.5 | 71.5 | 43.5 | 26.5 || 4 (11) | 0.0 | 8.5 | 4.5 | **52.5** | 13.5 | 11.0 |
- **P1 PASS:** GEN - KNN-BR = +39.0 points, McNemar 92 / 14, p 3.1e-15; KNN-KS 11.0 < 52.5.- **P2 PASS:** 76.0% >= 70%.- **P3 PASS:** +63.0 points, paired bootstrap 95% CI [+53.5, +72.5].
**Extra GEN seeds** (added after the confirmation, not pre-registered; m = 4, same train bank and test instances). Source: gates_s2_N3000.txt and gates_s3_N3000.txt in route_b_confirm.
| GEN seed | honest GEN | exact Bayes GEN | KNN-BR (honest / exact) | P1 gap, McNemar ||---|---|---|---|---|| 1 (pre-registered) | 0.0 | 52.5 | 8.5 / 13.5 | +39.0, 92 / 14, p 3.1e-15 || 2 | 2.5 | 54.5 | 8.5 / 13.5 | +41.0, 95 / 13, p 1.5e-16 || 3 | 0.0 | 56.0 | 8.5 / 13.5 | +42.5, 99 / 14, p 6.1e-17 |
Lookup does not depend on the GEN seed, so its column repeats.
**Post-hoc GEN variants** (N = 1000, gate bank; honest / exact Bayes within-1% in %; not gate-eligible). Source: route_b_gates on route_b_andromeda with tags _ema and _ema_w512.
| GEN | m = 1 | m = 2 | m = 4 ||---|---|---|---|| pre-registered (width 256, 30000 steps) | 57.0 / 88.5 | 9.5 / 69.5 | 0.0 / 24.0 || EMA 0.999, 100000 steps, width 256 | - | - | 0.0 / 24.5 || EMA 0.999, 100000 steps, width 512 | 79.0 / 94.0 | 16.0 / 74.0 | 0.0 / 28.5 |
**Reading.**- The weak part of GEN is its controller 2. Keeping GEN's controller 1 and swapping in the exact Bayes estimator lifts m = 4 from 0.0% to 24.0% at N = 1000 and from 0.5% to 52.5% at N = 3000.- More precise training fixes the easy family but not the hard one. EMA at width 512 lifts honest m = 1 from 57% to 79% (C1 would pass), while honest m = 4 stays at 0%.- Lookup fails on the 11-parameter family under both metrics (4-13.5%). Its nearest neighbour in 11 dimensions is far away, so its controller 1 is a best response to the wrong law.- GEN's exact-Bayes rate at m = 4 grows with the bank (7.5%, 24.0%, 52.5% at N = 300, 1000, 3000), while lookup stays at 8-11%. At m = 4 a larger bank helps the generator and does not help lookup.- At m = 2 both improve with the bank. Under exact Bayes GEN goes 54.0%, 70.5%, 78.5% and KNN-BR goes 28.5%, 41.5%, 51.0%, so GEN's lead stays at 25-29 points. Under the honest metric KNN-BR leads by 19-20 points at every N.- At m = 1 lookup is perfect (100% at every N). The 2-parameter family is dense enough to look up, as in E2.- GEN's m = 1 rate falls with N at a fixed 30000 steps (exact Bayes 87.5% at N = 1000, 75.0% at N = 3000; in-bank fit at m = 4 falls from 52% to 10%). The model under-fits larger banks; scaling the steps with N was not tested.- At N >= 1000, KNN-KS stays below GEN under exact Bayes at m = 2 and m = 4, so GEN's edge is not the exact (k, sigma) it receives. At N = 300, KNN-KS beats GEN at m = 4 (14.5% against 7.5%).- The confirmation reproduces the N grid's N = 3000 row on unseen instances with a new GEN seed: 52.5% against 52.5%, and lookup 13.5% against 10.5%.
## 4 Conclusion / Interpretation- **What it means:** one conditional diffusion model of the x1 law, trained on 3000 solved instances, yields controller 1 for unseen instances of an 11-parameter WH family. With the exact estimator as controller 2, it lands within 1% of the per-instance Lloyd reference on half of them; lookup manages about one in seven. Its own denoiser, read as controller 2, is not accurate enough, and that is what the pre-registered metric scored.- **Scope / caveats:** - Scalar WH only; exact Bayes is a cheap grid integral in 1-D but would need its own method at n >= 2. - The reference is Lloyd with 5 restarts, not a certified optimum. - 200 test instances per m. - The pre-registered confirmation uses one GEN seed. Two more seeds, run after it, agree (52.5%, 54.5%, 56.0% under exact Bayes), as do three seeds at N = 1000 (22.0-27.5%). All three share one train bank. - The exact-Bayes framing was chosen after the diagnostic was seen. The confirmation was pre-registered before it ran, but the framing itself is post hoc. - GEN's steps were not scaled with N.- **Claim status change:** the pre-registered claim is dead (KILL at N = 1000 and at every N of the grid; C1 FAIL). The reframed claim, "generate controller 1, compute controller 2 exactly", passes its pre-registered confirmation (P1, P2, P3). If the user adopts that framing, WH route B goes in the body next to X21 as a second amortization result, with the honest-metric failure reported alongside it. Otherwise WH has no body claim and both routes go to the appendix.- **Next:** the user decides on the framing.
## 5 Addendum (2026-12-02): which part of GEN does the work?
Pre-registered in results/witsenhausen/route_b_ablation/PREREG.md (written 13:57 UTC, commit 7a9e7d0; SAMP addendum 14:20 UTC, commit a2152b1), before any number of this experiment existed. Requested by the presentation session and approved by Matteo.
### 5.1 Problem / GoalAt inference, route B reads GEN at one noise level only. Controller 2 is D(y, 1 | c), controller 1 is the best response to it, and the score replaces controller 2 by the exact posterior mean. At s = 1 the population minimizer of denoising score matching (DSM) is E[x1 | x1 + w = y, c], a plain regression target. GEN's other noise levels make it a model of the whole law p(x1 | c), but the pipeline never reads them.
Three questions, each judged at m = 4, seed 1, on exact-Bayes within-1%:1. Does training at many noise levels help? REG1 is GEN's network trained at s = 1 only.2. Does a direct model of the law do as well? QREG predicts 2,048 quantiles of x1 from c.3. Does sampling from GEN beat reading its denoiser? SAMP draws x1 samples from GEN with an ODE sampler and uses their law.
**Verdict rule (symmetric).** Arm A beats arm B if A has the higher within-1%, McNemar p < 0.01, and a median regret no worse than B's. Otherwise the result is a tie. "Replicated" means seeds 2 and 3 at m = 4 give the same verdict. m = 1 and 2 are secondary.- Confirms "the diffusion part matters": GEN (or SAMP) beats REG1 and QREG.- Refutes it: a tie, or an arm beating GEN.
### 5.2 Method
| arm | what the network learns | training | controller 2 g | params ||---|---|---|---|---|| GEN (stored confirmation models) | EDM denoiser D(y, s \| c), s log-uniform on [0.002, 100] for half of each batch and s = 1 for the other half (route_b.py:249) | `route_b.train_gen`, 30,000 Adam steps, batch 4,096 | D(y, 1 \| c) | 349,953 || REG1 | the same network at s = 1 only | as GEN with s = 1 for every sample, so twice the s = 1 pairs | D(y, 1 \| c) | 349,953 || QREG | c to 2,048 nondecreasing quantiles of x1 / sigma (q_1 = a, q_{j+1} = q_j + softplus(b_j)) | quantile MSE (a discretized W2^2), 30,000 Adam steps, batch 256 instances | exact posterior mean of the predicted law | 348,672 || SAMP | GEN, used as a sampler | none (stored GEN) | exact posterior mean of S = 2,048 samples | 349,953 |
- Every arm then runs the same pipeline (`route_b_ablation.job`, route_b_ablation.py:111-123): controller 1 = `Inst.best_response(Inst.V(g))`, scored exact Bayes (primary) and honest (controller 2 = g).- SAMP's sampler is EDM Algorithm 1 (Heun, deterministic): 40 noise levels from 80 to 0.002 with rho = 7, then 0; 79 network evaluations. Initial noise is seeded with 10 x (instance seed) + GEN seed. S256 is SAMP on the first 256 of the same draws, a sensitivity row (route_b_samp.py:70-86).- **Data.** The confirmation's N = 3,000 train bank and its 200 test instances per m (seeds 2,000,000-2,000,199). GEN models are the stored confirmation models; their re-scores are checked against the stored arms.- **Seeds.** 1 at every m; 2 and 3 at m = 4. GEN seed s is compared with arm seed s.- **Commands.**```bashsbatch ~/scratch/wh_abl.slurm # per m: route_b_ablation train {reg1,qreg} M SEED; score M 4; reportsbatch ~/scratch/wh_samp.slurm # per m: route_b_samp run M 4; then route_b_ablation reportpython -m witsenhausen.route_b_qreg_diag 4 1 # post hoc QREG diagnostic (5.4)```- **Compute.** move-hpc-01-cpu. Training with 4 threads; scoring with 4 one-thread processes.
### 5.3 Theory: what route B needs from the model
**Notation.**- Controller 1 is f, with x1 = f(x0). Controller 2 is g, reading y = x1 + w with w ~ N(0, 1).- The cost is J(f, g) = k^2 E(x1 - x0)^2 + E(x1 - g(y))^2.- For a fixed f, p_f is the density of y and g*_f(y) = E[x1 | y] is the exact Bayes controller 2.- BR(g) is the best response to g: every x0 cell takes argmin_z k^2 (z - xbar)^2 + V_g(z), with V_g(z) = E_w (z - g(z + w))^2. `Inst.best_response` computes it exactly over the grid (route_b.py:88-103).- f_ref is the reference solution, with J_ref = J(f_ref, g*_ref).
**(b) A regret bound.** Two facts are exact on route B's grid.- *Orthogonality* (route_b.py:6-7): for any f and g, E(x1 - g(y))^2 = mmse(f) + E_{p_f}(g - g*_f)^2.- *Best response*: f_g = BR(g) minimizes J(., g) over the cell-constant policies on the admissible grid, and f_ref is one of them.
Hence, for any controller 2 g that a model produces,
J(f_g, g*_{f_g}) <= J(f_g, g) <= J(f_ref, g) = J_ref + B(g), where B(g) = E_{y ~ p_ref} (g(y) - g*_ref(y))^2.
The first inequality holds because g*_{f_g} is optimal for f_g. The second holds because f_g is optimal for g. The equality is orthogonality applied to f_ref. Dividing by J_ref:
regret(exact Bayes) <= regret(honest) <= B(g) / J_ref.
What the bound says:- B(g) is the excess s = 1 denoising risk of g on the test instance, under the reference solution's law. At s = 1 the DSM population risk is E(x1 - g(x1 + w))^2 = mmse + B(g). So route B's regret is controlled by one number: how well the model's s = 1 denoiser generalizes to the test instance's reference law. Training at s = 1 on the bank minimizes the bank average of exactly this quantity, up to the per-instance weight (1 + sigma^2) / sigma^2.- Errors of g count only where the reference solution puts y mass.- If g is the exact posterior mean of some law Q_hat, as for QREG and SAMP, Tweedie's formula gives g = y + d/dy log(Q_hat * N(0, 1)). Then B is the Fisher divergence between the noise-1 smoothed reference law and the smoothed Q_hat, up to the clipping of g to the law's support in `g_from_law`. This is the regret of a plug-in posterior mean in empirical Bayes (Jiang and Zhang 2009). We found no simple bound of it in W2(Q_hat, Q_ref) that holds without extra assumptions, and we do not claim one.- The bound is about the honest regret and only bounds the exact arm from above. It does not explain why exact Bayes is so much better than honest, the gap the confirmation saw (52.5% against 0.0% within 1% at m = 4).
**(a) Many noise levels against s = 1 only.**- With enough capacity, the multi-level DSM objective separates across s. Its minimizer at s = 1 is the same E[x1 | y, c] that REG1 targets. Any difference between GEN and REG1 is therefore statistical (finite bank, finite steps) or an inductive bias of the shared network.- The two estimators correspond to Efron's (2014) two empirical Bayes strategies. REG1 regresses the posterior mean directly (f-modeling). GEN models the law at every noise level and reads off its posterior mean (closer to g-modeling).- The analogy is loose in two ways. GEN is not constrained to be one law across levels: nothing ties D(., s) to D(., s') through the heat equation, as consistency or Fokker-Planck penalties would (Daras et al. 2023; Lai et al. 2023). And route B observes every bank law exactly; the learning is across c, not from noisy samples of one prior.- We found no theorem that predicts a better s = 1 estimator from multi-level training with shared parameters. The arguments in the literature are heuristic: large-noise tasks are easier, and parameter sharing may transfer.- So theory predicts no sign. The budget favours REG1, which sees twice as many s = 1 pairs in the same number of steps.
**(c) Law or map.**- Every route B controller 1 is a best response, and the best response is monotone in the cell barycenter by construction: each cell takes the lower-hull vertex whose slope bracket contains 2k^2 xbar (route_b.py:102-103). A monotone controller is fixed by its law: x1 = F_Q^{-1}(F_x0(x0)), the monotone rearrangement in `route_b.mono_map`.- Averaging monotone maps in the u = F_x0(x0) coordinate is averaging quantile functions. In 1-D that is the W2 barycenter of the laws (Agueh and Carlier 2011). So "regress the map" in u coordinates and "regress the quantile function" (QREG) are the same estimator. The useful contrast is not law against map.- The contrast is how a model averages laws that it cannot tell apart in c. QREG, trained by quantile MSE, averages quantile functions: a barycenter, which moves atoms to intermediate positions. A DSM-trained denoiser at its population optimum over instances it cannot separate returns the posterior mean of their mixture: densities are averaged, and atoms stay where they were. REG1 is a DSM denoiser too (at one level), so this contrast separates GEN and REG1 from QREG, not GEN from REG1.- With staircases whose level count or parity changes across c, the barycenter creates levels that neither neighbour has. The mixture keeps both sets of levels at half weight.- Which one hurts more is decided by B, the Fisher divergence at noise 1, and depends on the level spacing relative to the unit noise. The argument gives a reason to expect a difference between denoising and quantile regression, not its sign.
**(d) Where the difficulty sits.**- x1 is scalar, and for a fixed c the law is easy to store; the bank stores it exactly.- The learning problem is the map from c to the law, with c in R^(2+3m): 5, 8 and 14 inputs, and 2, 5 and 11 free parameters after normalization.- The bound adds that the law matters only after smoothing by unit noise. Atom shapes below the noise scale do not matter. Atom positions and masses at the scale of the level spacing do, and so does how they jump with c: level count, parity, the switch from affine to staircase.- So "discontinuous in c" matters more than "spiky". A model earns its keep by placing those jumps in c-space correctly.
### 5.4 Results
**Headline.** The multi-noise diffusion training is not what makes GEN work. The same network trained at s = 1 only (REG1) ties GEN at the pre-registered m = 4 seed and beats it at m = 2. The direct law model (QREG) loses to GEN at every m.
**m = 4** (200 confirmation test instances, N = 3,000 bank; regret in %, exact Bayes unless marked honest). Source: results/witsenhausen/route_b_ablation/report.txt.
| arm, seed | within 1% | within 5% | median regret | honest within 1% | honest median | McNemar vs GEN (arm-only / GEN-only, p) | Wilcoxon p | median B / J_ref | same, 50 train instances | train s ||---|---|---|---|---|---|---|---|---|---|---|| GEN 1 | 52.5 | 81.5 | 0.81 | 0.0 | 12.51 | | | 51.37 | 3.79 | not stored || REG1 1 | 57.5 | 83.5 | 0.71 | 4.5 | 11.91 | 24 / 14, 0.14 | 0.52 | 37.91 | 1.45 | 2367 || QREG 1 | 0.0 | 1.5 | 65.67 | 0.0 | 115.34 | 0 / 105, 4.9e-32 | 2.3e-34 | 1011.52 | 50.86 | 395 || GEN 2 | 54.5 | 79.0 | 0.78 | 2.5 | 14.82 | | | 43.04 | 3.60 | not stored || REG1 2 | 65.5 | 81.0 | 0.55 | 3.0 | 9.99 | 29 / 7, 0.00031 | 0.02 | 49.65 | 1.55 | 2443 || QREG 2 | 0.5 | 6.0 | 59.17 | 0.0 | 115.06 | 0 / 108, 6.2e-33 | 1.7e-31 | 809.14 | 57.35 | 431 || GEN 3 | 56.0 | 74.5 | 0.82 | 0.0 | 14.43 | | | 48.79 | 3.60 | not stored || REG1 3 | 61.0 | 84.5 | 0.62 | 1.5 | 10.76 | 23 / 13, 0.13 | 3.2e-05 | 55.35 | 1.51 | 2372 || QREG 3 | 0.0 | 3.5 | 73.15 | 0.0 | 127.38 | 0 / 112, 3.9e-34 | 8.2e-34 | 1039.35 | 44.83 | 2817 |
- **Pre-registered verdict (m = 4, seed 1).** REG1 vs GEN: tie (p 0.14). Seeds 2 and 3 give "REG1 beats GEN" and "tie", so the tie is not replicated in the strict sense; it never turns in GEN's favour. QREG vs GEN: GEN beats, replicated at seeds 2 and 3.- **Seed bands (within 1% over seeds 1-3).** GEN 52.5-56.0%, REG1 57.5-65.5%, QREG 0.0-0.5%.- **Self-check.** The stored GEN models, re-scored here, match the stored confirmation arms within 1e-9 on 99.3% of instance-seed pairs (max relative difference 2.4e-9).- **Training time.** Wall clock on move-hpc-01-cpu, 4 threads, shared node. GEN's confirmation runs did not record a time. REG1 has GEN's network, batch and step count, so its 2,367-2,443 s is the like-for-like cost. QREG's seed 3 took 2,817 s against 395-431 s for seeds 1 and 2; we did not check the node load at the time.- **Parameters.** GEN and REG1 349,953; QREG 348,672.
**m = 2 and m = 1** (secondary; seed 1). Same source.
| m | arm | within 1% | within 5% | median regret | honest within 1% | honest median | McNemar vs GEN, p | Wilcoxon p | median B / J_ref | train s ||---|---|---|---|---|---|---|---|---|---|---|| 2 | GEN | 71.5 | 89.0 | 0.18 | 16.0 | 6.51 | | | 10.56 | not stored || 2 | REG1 | 82.5 | 95.0 | 0.08 | 31.5 | 3.50 | 28 / 6, 0.0002 | 2.5e-12 | 9.49 | 2320 || 2 | QREG | 0.5 | 7.0 | 35.17 | 0.0 | 70.97 | 0 / 142, 3.6e-43 | 3.8e-33 | 532.50 | 452 || 1 | GEN | 76.0 | 87.5 | 0.04 | 46.5 | 2.38 | | | 2.94 | not stored || 1 | REG1 | 75.5 | 87.5 | 0.02 | 47.0 | 1.30 | 12 / 13, 1 | 0.031 | 1.70 | 2090 || 1 | QREG | 51.5 | 71.0 | 0.77 | 7.0 | 24.10 | 0 / 49, 3.6e-15 | 3.2e-15 | 36.92 | 427 |
- Verdicts by the same rule: at m = 2 REG1 beats GEN and GEN beats QREG; at m = 1 REG1 ties GEN and GEN beats QREG.- GEN self-check: within 1e-9 on 99.5% (m = 2) and 100.0% (m = 1).
**Bound check.** regret(exact) <= regret(honest) <= B / J_ref holds on every instance, arm, seed and m (100.0% in every row). The bound is loose: at m = 4 the median B / J_ref is 38-55% for GEN and REG1, while their median exact regret is below 1%. B ranks instances moderately well: Spearman(B, exact regret) is 0.68-0.79 at m = 4, 0.71-0.83 at m = 2 and 0.86-0.90 at m = 1.
**QREG diagnostic** (post hoc, run after the report above; witsenhausen/route_b_qreg_diag.py, seed 1). The target law is the reference law's own 2,048 quantiles, QREG's training target, fed through QREG's scorer. W2 is between the predicted and the target quantiles, in sigma units. Source: results/witsenhausen/route_b_ablation/qreg_diag_m{4,2,1}_s1.txt.
| m | rows | target-law regret, max | QREG W2 / sigma, median (p90) | QREG median regret | QREG within 1% ||---|---|---|---|---|---|| 4 | 50 train | 0.20% | 0.133 (0.156) | 3.13% | 20.0% || 4 | 200 test | 0.60% | 0.499 (0.937) | 65.67% | 0.0% || 2 | 50 train | 0.21% | 0.132 (0.158) | 2.37% | 32.0% || 2 | 200 test | 0.49% | 0.339 (0.730) | 35.17% | 0.5% || 1 | 50 train | 0.17% | 0.093 (0.155) | 0.60% | 54.0% || 1 | 200 test | 0.34% | 0.102 (0.248) | 0.77% | 51.5% |
- The pipeline is not the problem: the target law scores within 0.6% of the reference on every row.- At m = 2 and 4 QREG generalizes poorly: its W2 error on test instances is 2.6-3.8 times its error on training instances.- At m = 1 there is no such gap (0.093 against 0.102), and QREG still reaches only 51.5% within 1%. A law error of about 0.1 sigma is already costly.- Spearman(W2, QREG regret) is 0.42-0.59: W2 explains part of the regret, not all of it.
**SAMP** (job 17676): pending. Added when it finishes.
**Reading.**- Multi-noise training does not help the s = 1 denoiser that route B reads. REG1 has the higher within-1% at every m = 4 seed (57.5, 65.5, 61.0 against 52.5, 54.5, 56.0) and the lower median regret at every seed. Only seed 2 passes McNemar.- REG1 also fits the bank better. Its median B on 50 training instances is 1.45-1.55% of J_ref against GEN's 3.60-3.79% at m = 4. This fits the budget argument in 5.3 (a): REG1 sees twice as many s = 1 pairs.- REG1's own denoiser is still not a usable controller 2: honest within-1% is 1.5-4.5% at m = 4. The honest-metric failure of section 3 is not specific to diffusion training.- QREG's failure is mostly generalization across c at m = 2 and 4, and fit precision at m = 1. The barycenter-against-mixture argument of 5.3 (c) concerns the population optimum. This experiment does not isolate it, so we do not claim it explains QREG's loss.
### 5.5 Conclusion / Interpretation
- **What it means:** route B works because a network learns E[x1 | y, c] at the channel noise (s = 1) well enough for the best response to recover controller 1. Training the same network as a full diffusion model over many noise levels adds nothing measurable on this metric; at m = 2 it costs 11 points of within-1%. A direct quantile model of the law, at matched parameter count, generalizes far worse across c.- **Scope / caveats:** - One bank (N = 3,000), one step count (30,000) and one width for every arm; QREG's hyperparameters were set once in the PREREG and not tuned. - GEN was not retrained: its models come from the confirmation run on another machine, so GEN's training time is not stored. - Three seeds at m = 4, one at m = 1 and 2. The m = 4 tie between REG1 and GEN rests on seed 1 as pre-registered; the band over seeds favours REG1. - SAMP, the arm that uses GEN as a generator, is still running.- **Claim status change:** "a conditional diffusion model generates controller 1" overstates what the evidence supports. The supported claim is "a learned conditional denoiser at the channel noise, plus a best response and the exact controller 2, transfers controller 1 across the 11-parameter family". The diffusion model is one way to train that denoiser, not a better one. Unless SAMP beats REG1, the deck and any paper text should not credit the multi-noise training.- **Next:** read the SAMP verdict (job 17676), then the user decides how route B is framed.
<!-- Related: [[witsenhausen-route-an]] (witsenhausen_route_an.md), [[witsenhausen-vector-v0]] (witsenhausen_vector_v0.md), plan/witsenhausen_revision_plan_2026-10-20.md -->docs/witsenhausen_routeB.mdAdded+340