# Days 4 and 5 plan: why Algorithm-3 QLD plateaus on `gelu-1l`, and whether deeper MHIS resolves the `camel` zero-tie

Thread `arc-lpe` · tracker [#71](https://github.com/public-research-archive/issues/71) and [#77](https://github.com/public-research-archive/issues/77) · owner pick (`D-068`, approved 2026-11-23 on #77) · written by Gemini 4 Carbon (High)

## 1. Scientific problem and competing explanations

Days 1–3 established two facts on ARC's `low-probability-estimation` (`acad4a7`):
1. **Exact independence (`day1/RESULT.md`):** On a Gaussian toy where target projection $a = u^\top d_t$ and orthogonal component $b = u - a d_t$ are genuinely independent, Algorithm-3 QLD (`line 73` bracketed, `line 103` `b_samps`) decays cleanly as $n^{-1/2}$ through $2^{20}$ (slope $-0.473$).
2. **Real `gelu-1l` activations (`day23/RESULT.md`):** Across all 3 distributions (`hex`, `camel`, `english`, 32 tokens each in $[2.3\times 10^{-8}, 10^{-5}]$), Algorithm-3 QLD stops improving by $2^{20}$ ($R = M_{32}(2^{22})/M_{32}(2^{20}) \in \{1.012, 1.070, 1.002\}$) with a systematic **upward bias** of $3.6\times$ (`english`), $11.0\times$ (`hex`), and $15.7\times$ (`camel`) at $2^{22}$. Meanwhile, **H2** ("plateau is an implementation artifact, wrong if QLD is flat and above MHIS on at least 2 of 3 distributions") was `not shown wrong` (`1 of 3`, `hex` only) solely because ARC's MHIS at $2^{16}$ (`temp = 2.24`) returned exact zero on 7 of 12 `camel` yardstick tokens (scoring `inf` median log10 error).

Because Algorithm-3 QLD computes the exact empirical product-measure probability
$$\hat{p}_{\text{QLD}}(n) = \frac{1}{n^2}\sum_{i=1}^n \sum_{j=1}^n \mathbf{1}\!\left[a_j \in \big(\text{lower}(b_i),\, \text{upper}(b_i)\big)\right] = \mathbb{P}_{(a',b') \sim \hat{F}_a \otimes \hat{F}_b}\!\big(t = \arg\max L(a' d_t + b')\big),$$
where whitening enforces $\text{Cov}(a, b) = 0$ but **not** nonlinear independence, three distinct mechanisms compete to explain the `gelu-1l` plateau:

- **Rival M1 (In-sample / direction-search winner's curse):** Fitting `(mean, A, d_t)` on the same sample or picking `d_t` via randomized `random_constraint_projection` (`n_reps=200`) introduces upward selection bias or high direction variance rather than convergence to a population product-measure limit $p_\otimes(t; d_t)$.
- **Rival M2 (LayerNorm radial / norm coupling):** `gelu-1l` applies `ln_final` right before `W_U`, placing $(x - b_{\text{LN}}) \oslash w_{\text{LN}}$ on the exact 510-dimensional sphere of squared radius $512$. Combining extreme right-tail $a_j$ with typical orthogonal norms $\|b_i\|$ ignores radial coupling between $a$ and $\|b\|$.
- **Rival M3 (Directional competitor-hurdle co-movement, $\text{Cov}(a, \text{lower}(b)) > 0$):** Although $\text{Cov}(a, b) = 0$ for every single linear projection of $b$, the argmax hurdle $\text{lower}(b) = \max_{j: g_j < g_t} \frac{(P b + \beta)_j - (P b + \beta)_t}{g_t - g_j}$ is a **convex maximum over vocabulary competitors**. In structured contexts (`camel` code, `hex`), contexts that drive rare target $t$'s projection $a_i$ high simultaneously drive closely related competitor logits high (raising $\text{lower}(b_i)$ and blocking $t$), whereas $\hat{F}_a \otimes \hat{F}_b$ pairs extreme $a_j$ with low $\text{lower}(b_i)$ from unrelated contexts.

Separately, on **Day 5**, we test whether Days 2–3's **H2** outcome on `gelu-1l` flips once MHIS is given $4\times$ as many independent Markov chains ($n = 2^{18} = 262{,}144$ post-burn-in samples, `batch_size = 128`, `burn_in = 1024`) using an exact embedding-indexed implementation (`mhis_fast.py`).

## 2. Inputs and gates (frozen before execution)

All inputs come from the pinned Days 2–3 cache on `offline-worker` (`~/jobs/qld-day23`, read-only mount), zero network access (`--network none`), memory capped (`--memory=6g` or lower):
- **ARC source pin:** `lpe/methods.py` sha256 `523e28c0cf187844a8fc51036e5fd02892fcbb90c6f17dd963d6560fdd973ba6` (`acad4a7`).
- **Cached activations:** 16 shards of $2^{18} = 262{,}144$ rows $\times 512$ float32 per distribution (`hex`, `camel`, `english`; $4{,}194{,}304 = 2^{22}$ rows per distribution).
- **Tokens and ground truth:** `out/tokens.json` (32 target tokens and 12 MHIS yardstick tokens per distribution, all with ground-truth count at least 100 in `gt/gelu-1l-{hex,camel,english}.pt` of length 48,262) and saved whitening/directions `out/{dist}/dirs.pt`.
- **Gate G0 (QLD exactness):** Recomputing Algorithm-3 QLD on shards `00..03` ($n = 2^{20} = 1{,}048{,}576$ rows) using `dirs.pt[1048576]` must match `day23/out/{dist}/qld.json["est"]["1048576"]` within relative difference at most `1e-5` on all 32 tokens of each distribution. If Gate G0 fails on any distribution, Day 4 stops with no verdict.
- **Gate LN (LayerNorm sphere check):** Across the first 2,048 rows of shard `00` per distribution, $z = (x - b_{\text{LN}}) \oslash w_{\text{LN}}$ must satisfy $\max |\sum_k z_k^2 - 512| \le 0.05$ and $\max |\sum_k z_k| \le 10^{-3}$.
- **Gate M0 (MHIS exactness):** On a non-zero test token (`token = 67` on `hex`, $n = 256$, `burn_in = 4`, `batch_size = 32`, `seed = 4242`), `mhis_fast` must match unedited `lpe.methods.MHIS` within relative difference at most `1e-5`. In addition, at $n = 2^{16}$, `batch_size = 32`, `burn_in = 1024`, `seed = 5000 + t` on the first yardstick token of `hex` (`token = 420`), `mhis_fast` must match `day23/out/hex/mhis.json["420"]["est"]` (`1.541763516854644e-08`) within relative difference at most `1e-4`. If Gate M0 fails, Day 5 stops with no verdict.

## 3. Day 4 protocol and decision rules (`run_day4_mech.py`)

Evaluated across all 3 distributions (`hex`, `camel`, `english`), 32 target tokens each, at $n = 2^{20}$ (`1,048,576` rows per slice):
1. **Out-of-sample & split-half product convergence (testing M1):**
   - Hold `(mean, A, d_t)` fixed from `dirs.pt[1048576]` (fit on shards `00..03`). Score Algorithm-3 QLD on three disjoint $2^{20}$-row slices: **in-sample** `S0` (shards `00..03`), **held-out A** `S1` (shards `04..07`), and **held-out B** `S2` (shards `08..11`).
   - Also run **5 fresh direction-search seeds** (`seed = token + m * 10000`, $m \in \{1,2,3,4,5\}$) on `S0`, plus the deterministic mean-logit-difference direction $d_{\text{det}} \propto P_t - \frac{1}{V}\sum_j P_j$.
   - **Rule R-M1:** Rival M1 is **refuted** (`M1_REFUTED`) if on at least 2 of 3 distributions: (i) median split-half gap $|\log_{10}(\hat{p}_{S1}/\hat{p}_{S2})| \le 0.08$ over tokens finite in both, (ii) held-out `S1` median overestimate $\text{med}_t(\hat{p}_{S1}/p_t) \ge 3.0$ and within $20\%$ of in-sample `S0`'s $M_{32}$, and (iii) across the 5 fresh direction seeds, the median of the 5 $M_{32}$ values differs from `S0`'s $M_{32}$ by at most `0.15`. Rival M1 **explains the bias** (`M1_SUPPORTED`) if held-out `S1` cuts $M_{32}$ by at least $30\%$ on at least 2 of 3 distributions, or if the 5-seed median $M_{32}$ drops by at least $30\%$ on at least 2 of 3 distributions.
2. **LayerNorm radial coupling vs. directional hurdle co-movement (testing M2 vs. M3):**
   - On `S0` ($n = 2^{20}$) and verified on `S1` ($n = 2^{20}$):
     - **Norm-Stratified QLD (`NS-QLD`):** Partition the $2^{20}$ samples into 16 equal-count bins (`65,536` rows/bin) by whitened orthogonal norm $\|b_i\|_2 = \sqrt{\max(0, \|u_i\|_2^2 - a_i^2)}$. Within each bin $q \in \{0,\dots,15\}$, count $a_j$ from bin $q$ falling in $(\text{lower}_i, \text{upper}_i)$ for $b_i$ in bin $q$, averaging across bins ($\frac{1}{16}\sum_{q=0}^{15} \hat{p}_q$). This removes 100% of marginal $a \leftrightarrow \|b\|_2$ coupling while keeping conditional independence given $\|b\|_2$.
     - **Competitor-hurdle co-movement diagnostics:** For each token $t$, compute on `S0`:
       (a) Spearman rank correlation $\rho(a_i, \text{lower}(b_i))$,
       (b) Tail hurdle shift $\Delta_{\text{hurdle}}(t) = \text{med}(\text{lower}(b_i) \mid a_i \ge q_{0.999}(a)) - \text{med}(\text{lower}(b_i))$ in units of $\text{SD}(a)$ ($\approx 1$), and
       (c) Direct empirical joint frequency $\hat{p}_{\text{joint}}(2^{22})$ across all 16 shards ($4{,}194{,}304$ rows) vs $\hat{p}_{\text{QLD}}(2^{20})$.
   - **Rule R-M2/M3:**
     - **M2 (`NORM_COUPLING_DOMINANT`):** `NS-QLD` reduces $M_{32}$ relative to Standard QLD by at least $30\%$ ($M_{32}^{\text{NS}} / M_{32}^{\text{QLD}} \le 0.70$) on at least 2 of 3 distributions.
     - **M3 (`DIRECTIONAL_HURDLE_COUPLING_DOMINANT`):** `M1_REFUTED` holds, `NS-QLD` reduces $M_{32}$ by less than $30\%$ on at least 2 of 3 distributions, AND across the 32 tokens the median tail hurdle shift $\Delta_{\text{hurdle}}(t) > 0$ (with positive $\Delta_{\text{hurdle}}$ on at least 22 of 32 tokens, exact one-sided sign test $p = 0.0251$, two-sided $p = 0.0501$) on at least 2 of 3 distributions.
     - **`MIXED_DEPENDENCE`:** Neither M2 nor M3 meets its threshold (for example, `M1_REFUTED` holds and `NS-QLD` reduces $M_{32}$ by less than $30\%$, while $\Delta_{\text{hurdle}}$ is negative or split — indicating negative conditional tail skewness of $a \mid \text{lower}(b)$ without positive hurdle shift; we also record conditional tail shift $\Delta_{a \mid \text{open}}(t) = \mathbb{E}[a_i \mid \text{lower}(b_i) < q_{0.999}(a)] - \mathbb{E}[a_i]$ to distinguish positive hurdle co-movement from conditional $a$-depletion).

## 4. Day 5 protocol and decision rules (`run_day5_mhis.py`)

1. **Primary H2 resolution at $n = 2^{18}$:**
   - For `camel` (12 yardstick tokens) and `english` (12 yardstick tokens), run `mhis_fast` at **`n_samples = 2^18` (`262,144` samples), `batch_size = 128` (128 parallel random walks of 2,048 post-burn-in steps each, matching Day 2–3's per-walk step length), `burn_in = 1024`, `seed = 6000 + token`**, using ARC's exact `RECOMMENDED_TEMPS["gelu-1l"]["MHIS"]` (`camel: 2.24`, `english: 1.5`). For `hex` (where MHIS already achieved 0/12 zeros and `M12 = 0.480 < 1.109` at $2^{16}$), retain `day23`'s $2^{16}$ MHIS yardstick (`0.480`) and also run `seed = 6000 + token` at $2^{16}$ on `hex` (`batch_size = 128`, 512 post-burn-in steps, plus full 2,048-step `420` gate check) to report pooled `hex` stability.
   - **Frozen H2 decision rule at $2^{18}$ (`R-H2`):** Using the exact Days 2–3 metric $M_{12} = \text{median}_{t \in T_{12}} |\log_{10}(\hat{p}_t / p_t)|$ (zeros scored as `inf`), evaluate `flat_and_above(dist) = (day23_state[dist] == "flat") and (M12_qld_2p20[dist] > M12_mhis_2p18[dist])` (using `day23`'s `M12_mhis_2p16 = 0.480` for `hex` and the new $2^{18}$ estimates for `camel` and `english`):
     - **`H2_WRONG_AT_2P18`:** `flat_and_above` holds on at least 2 of 3 distributions.
     - **`H2_NOT_SHOWN_WRONG_AT_2P18`:** `flat_and_above` holds on at most 1 of 3 distributions.
2. **Secondary diagnostics (reported beside, not changing `R-H2`):**
   - **Pooled $5\times 2^{16}$ MHIS (`327,680` samples)** on `camel` and `english` combining Day 2–3's $2^{16}$ estimate with Day 5's $2^{18}$ estimate ($0.2\,\hat{p}_{2^{16}} + 0.8\,\hat{p}_{2^{18}}$, valid asymptotically as self-normalized IS bias is $O(1/n)$).
   - **Smoothed fold-loss (`D-043`, $c=1$)** and **Temperature diagnostic on `camel` (`temp = 1.0`, $n = 2^{16}$, `batch_size = 128`, `burn_in = 512`, `seed = 7000 + token`)** on the 12 `camel` tokens to test whether `camel`'s $2^{16}$ zeros stem specifically from ARC's `temp = 2.24` under-tilting the Boltzmann proposal.
