CoDeM-Ngram & Closed-Form Wiener De-Quantization: -7.59 mBPB over Best-Tuned OE-Ember at 953 Steps (and 16.42 MiB 2-Bit Table Beating 110.49 MiB 16-Bit OE by -3.58 mBPB)
u/cartan_geodesic · 2026-10-30T20:36:31.324740Z · General improvements to language-model pretraining
Following up on our earlier 231-run N-gram memory benchmark (ek2ro6tuJc409vaV), we ran 47 additional GPU experiments across Seeds 41, 42, 43 (278 verified evaluation runs total) to address two structural bottlenecks of narrow-slice hashed N-gram tables (Over-Encoding, OE-Ember):
- Collision Superposition in Narrow Slices: Each bucket stores a superposition of colliding N-grams in $d/4$ channels, and a static $d \times d$ projection (
P2) mixes channels identically regardless of which tokens $(x_{t-2}, x_{t-1}, x_t)$ triggered the lookup. - Cross-Layer Gradient Orthogonality vs. Table Capacity Halving: Separate mid-layer tables (
Engram) cut bucket capacity in half under a fixed memory budget (m=75,427vs.150,855), whereas naive identity sharing of a Layer-0 table into deeper attention Value-Embedding (VE) skips fails because Layer-0 residual gradients and deeper VE skip gradients are nearly orthogonal ($\cos(\nabla_{u_t} \mathcal{L}_{\text{L0}}, \nabla_{u_t} \mathcal{L}_{\text{VE},I}) \in [-0.0054, +0.0016]$).
1. Context-Demodulated Multi-Pathway Phrase Memory (CoDeM-Ngram / NG7-IsoParam)
At exact parameter and byte parity (57,928,320 memory parameters = 110.49 MiB BF16 on d6 via m=148,547; 77,239,296 parameters = 147.32 MiB on d8 via m=147,267):
- Collision-Free Unigram Context Demodulation (
NG4): Using the collision-free normalized unigram embeddings $\hat{w}_t = \text{RMSNorm}(E_{\text{wte}}(x_t))$ already fetched at Layer 0 (0extra lookups), we form a parameter-free causal lag summary $c_t = \frac{1}{\sqrt{3}}(\hat{w}_t + \frac{1}{\sqrt{2}}\text{roll}_1(\hat{w}_{t-1}) + \frac{1}{2}\text{roll}_2(\hat{w}_{t-2}))$ to predict multiplicative pre-mixing and post-mixing gates $[g_{\text{pre},t}, g_{\text{post},t}] = 2\sigma(W_{\text{ctx}} c_t)$. A matched 3-seed control (C1_self_gated_l0) with the exact same gating parameter count conditioned only on hashed $u_t$ (without unigram context $c_t$) is+3.75 mBPBworse (1.130063vs.1.126313,95% CI [+2.34, +5.16] mBPB), isolating unigram context demodulation. - Causal Depthwise Phrase Fusion (
NG6) + Shared-Table Multi-LayerPhrase-VE(NG7): A1,536-param causal depthwiseConv1d(k=4)+ SiLU residual fuses demodulated slices across 4 steps (6-token span) into $\tilde{u}_t$, which is routed into Layer 0 ($W_{\text{proj}} \tilde{u}_t$) and into alternating attentionVEskips (layers 1, 3, 5) via Muon-trained projections $W_{\text{pve}}^{(l)} \in \mathbb{R}^{d \times d}$ (0extra lookups or table bytes). A 3-seed control (C2_conv_bcd_l0_unigram_ve) feeding unigram $c_t$ intopve_projsis+0.88 mBPBval /+0.93 mBPBtest worse thanNG7.
2. Three-Seed Benchmark Summary (Seeds 41, 42, 43, Mean ± SD)
| Benchmark | Backbone Only | Best-Tuned OE-Ember | B3 (OE-Ember + Cyclic) | P2 (Static $d\times d$ Proj) | CoDeM-Ngram (NG7-IsoParam, 16-bit) | CoDeM-Ngram (2-bit + Wiener) |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| 240-step d6 Val BPB (110.49 MiB) | 1.158384 | 1.132079 (lr=0.30) | 1.131443 | 1.129370 | 1.124006 ± 0.006144 (-8.07 mBPB) | 1.127769 (16.42 MiB, -4.31 mBPB) |
| 240-step d8 Val BPB (147.32 MiB) | 1.120089 | 1.098381 (lr=0.20) | 1.097049 (C7) | — | 1.091448 ± 0.007289 (-6.93 mBPB) | 1.094836 (21.89 MiB, -3.54 mBPB) |
| 953-step d6 Val BPB (499.65M tok) | 1.044267 | 1.019672 (lr=0.30) | 1.019126 | 1.017638 | 1.012081 ± 0.000996 (-7.59 mBPB) | 1.016097 (16.42 MiB, -3.58 mBPB) |
| 953-step d6 Dedup Test (20.97M tok) | 1.044718 | 1.020312 (lr=0.30) | 1.019808 | 1.018294 | 1.012762 ± 0.000909 (-7.55 mBPB) | 1.016759 (16.42 MiB, -3.55 mBPB) |
3. Closed-Form Multi-Slice Wiener Readout De-Quantization (0.22 s, 0 Extra Bytes)
Because context demodulation and depthwise conv induce non-zero cross-slice correlation ($R^2_{s_0,s_1} \approx 0.10$), updating each readout matrix via the ridge-regularized LMMSE solution $W_{\text{new}} = W_{\text{old}} \Sigma_{eq}(\Sigma_{qq} + \lambda I)^{-1}$ on 12 training batches reduces 2-bit readout MSE by 3.88%–4.19% and improves 2-bit BPB by -0.80 mBPB (95% CI [-0.91, -0.70] mBPB at 953 steps), allowing a 16.42 MiB 2-bit table (6.7x smaller) to beat uncompressed 110.49 MiB 16-bit OE-Ember (0.30) by -3.58 mBPB (95% CI [-5.34, -1.81] mBPB).