kolbrian commited on
Commit
5f6be9b
Β·
verified Β·
1 Parent(s): 8773aa4

Substantial correction: retract the unconditional improvement claim

Browse files

The previous card claimed the gate 'produces a real improvement over an ungated baseline,' replicated six ways. Retracted. Three findings already in the project record were not incorporated at first publication:

1. A 20-run 4-arm x 5-seed matrix against the 2025-01-04_SoftCap modded-nanoGPT record (Aug 2-5 2026, 8xH100) shows the LEARNED gate harms: F-S = +0.0284, CI [+0.0262,+0.0305], t(4)~36.5, zero distributional overlap. Static gating costs only +0.0017 -- the damage is from learning the gate, 16x.
2. At warmup 500 the ungated baseline (4.5663) beats every gate tested, including cheap_qa (4.6130). The headline result is conditional on warmup 2000.
3. The per-dimension bands were reported as 0.70-0.77 / 0.42-0.54. Those are per-LAYER-MEAN bands. Full vectors (4,608 values per condition) are 0.5745-0.8457 and 0.3593-0.6821. The means stay at init; the distributions widen. The 'flat loss direction' mechanism is contradicted by this repo's own per-layer results, where a scalar moves 0.5->0.742 and 12 per-layer values span 0.38-0.65.

Also: the A10 ordering inversion is now shown as contested -- two boards here disagree on midtier_q by 0.0144 and the larger 57-run board does not reproduce it. The 1B result is flagged as under review (sign-test p=0.125; whether the gate trained at all is unresolved). Seed-set sensitivity added (cheap_qa 4.4139 on seeds 0/1/2).

Where two files in this corpus disagree, both are now shown.

Files changed (1) hide show
  1. README.md +227 -233
README.md CHANGED
@@ -7,6 +7,7 @@ tags:
7
  - conditional-computation
8
  - gating
9
  - research-artifact
 
10
  library_name: pytorch
11
  ---
12
 
@@ -16,22 +17,37 @@ Training artifacts from an independent research program on **query-conditioned a
16
  gating** in GPT-2-class transformers. 33 checkpoints, the code that produced them, and the
17
  complete result tables β€” including the runs that did **not** support the hypothesis.
18
 
19
- This repository is an archive first and a model release second. Nothing here is intended
20
- for downstream use as a general-purpose language model.
21
-
22
  **Code, per-phase result tables, and the full experiment history:**
23
  [github.com/briantkolb/qgate](https://github.com/briantkolb/qgate)
24
 
25
- **What the data supports, in one paragraph.** A single small gate at one seam of the
26
- attention block produces a real improvement over an ungated baseline β€” replicated at 124M
27
- and at 1B, on four hardware configurations, significant at both scales. Almost nothing
28
- beyond that survives contact with a second measurement. Which signal the gate is
29
- conditioned on, how it is parameterized, and how the variants rank against each other all
30
- change when the hardware changes or the scale changes, and seven of the variants sit
31
- inside the seed noise floor of one another at 124M. The most useful result in this corpus
32
- is the mechanism for that: on the one family where the parameters are directly
33
- observable, the loss is flat along the axis being tuned, and training never moves the
34
- parameters off their initialization.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ## The intervention
37
 
@@ -45,86 +61,72 @@ gate = torch.sigmoid(self.qa_gate_proj(torch.cat([q, y], dim=-1)))
45
  y = y * gate # before c_proj (W_O)
46
  ```
47
 
48
- At the 124M scale this costs **98,304 parameters (+0.079%)**.
 
 
49
 
50
- `code/model_cheap_qa_minimal.py` is a self-contained single-variant reference
51
- implementation with the port surface marked by `G1 SEAM` banner comments.
52
 
53
- ## Relation to published work
 
54
 
55
- Gating the SDPA output at the G1 seam is established. **This is a small-scale replication
56
- and mechanism study, not a novelty claim.**
57
-
58
- - **Qiu et al. 2025**, [*Gated Attention for Large Language Models*](https://arxiv.org/abs/2505.06708)
59
- (NeurIPS 2025 Oral). Establishes the G1 gate at 15B-MoE and 1.7B-dense scale on up to 3.5T
60
- tokens. Their formulation is `Y' = Y βŠ™ Οƒ(XΒ·WΞΈ)` β€” the gate is computed from **X, the layer
61
- input**, in all fifteen variants they report. Their SDPA-elementwise G1 winner adds 201M
62
- parameters. `full_x` / `x_full_headspec` here are that formulation ported to nanoGPT.
63
- - **Bu et al. 2025**, [*Value-State Gated Attention*](https://arxiv.org/abs/2510.09017).
64
- Moves the gate input from X to **V**, arguing a reactive gate (computed from the value
65
- state) decouples value and attention updates better than a predictive one.
66
- - **Zhou et al. 2026**, [*Hybrid Gated Attention*](https://arxiv.org/abs/2608.11805)
67
- (Tencent Hunyuan, 12 Aug 2026). Adds an **H-gate** computed from the SDPA output `H`,
68
- fused with the X-gate, on the observation that *"the output H contains richer
69
- token-interaction information after attention"* that X does not capture. Validated on
70
- MoE-5B over 500B tokens.
71
-
72
- **Where `cheap_qa` sits.** Its gate is computed from `cat(q, y)` β€” the query and the SDPA
73
- output being gated. The `y` term is the same signal Zhou et al. call `H`. On the gate-input
74
- axis the published sequence is X β†’ V β†’ X+H, and `cat(q, y)` is a point on it that none of
75
- the three tested: one `Linear(2Β·head_dim β†’ head_dim)`, 98,304 parameters at 124M.
76
-
77
- **Chronology.** This work reached G1 gating independently and found the prior art
78
- afterward. `cheap_qa` was confirmed 2026-03-20
79
- (`results/csv/cheap_qa_confirmation_runs_20260320_1854.csv`). Qiu et al. was located days
80
- later, at which point the project was reclassified from a novelty claim to a replication
81
- and mechanism study, and their X-conditioned formulation was implemented as `full_x`
82
- *specifically to run head-to-head against* `cheap_qa`
83
- (`results/summaries/full_x_seed123_result_20260324_1712.txt`, 2026-03-24). Zhou et al.
84
- appeared 2026-08-12, five months after `cheap_qa`. **None of this establishes priority** β€”
85
- these results were private until publication. It is recorded only because the dates are
86
- checkable in the files.
87
-
88
- **What replicates here.** Two of Qiu et al.'s qualitative findings reproduce at 124M on one
89
- RTX 3060, at roughly 1/10,000 of their token budget:
90
-
91
- | claim | Qiu et al. (15B MoE, 400B tok) | here (124M, ~41M tok) |
92
- |---|---|---|
93
- | G1 gating beats baseline | 6.026 β†’ 5.761 PPL | 4.4708 β†’ 4.3897 CE |
94
- | input-*dependent* gating beats input-*independent* | 5.917 β†’ 5.761 | 4.4483 β†’ 4.3897 |
95
 
96
- The input-independent control is an exact structural match: Qiu's is a zero-initialized
97
- learnable `(q Γ— dk)` parameter through a sigmoid; `static_prehead` here is
98
- `nn.Parameter(torch.zeros(n_head, head_dim))` through a sigmoid. In both cases it recovers
99
- roughly a third of the gain (41% there, 28% here), confirming that part of the effect is
100
- non-linearity alone and the rest requires input dependence.
101
 
102
- **What is *not* claimed.** Qiu et al. also find head-specific gating beats head-shared. The
103
- variants here that would test it (`x_headshared`, 4.4346, versus `full_x`, 4.3950) differ in
104
- gate *input width* as well as head-sharing β€” `Linear(64β†’64)` on a per-head slice versus
105
- `Linear(768β†’768)` on the full hidden state β€” so the comparison is confounded and is not
106
- offered as a replication. The unconfounded pair
107
- (`dynamic_x_g1_headspecific_elementwise` vs `dynamic_x_g1_headshared_elementwise`) was only
108
- run under the earlier, superseded recipe.
109
 
110
- ## Headline results
 
 
 
111
 
112
- **nanoGPT 124M, OpenWebText, 10k iters, warmup 2000, seeds 42/1337/123** (val CE).
113
- Source: `results/csv/priority1_runs_20260322_1355.csv`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
- | variant | added params | val CE | vs baseline | best-at-final |
116
- |---|---|---|---|---|
117
- | baseline | β€” | 4.4708 Β± 0.0074 | β€” | 0/3 |
118
- | **cheap_qa** (gate on `cat(q, y)`) | +98,304 (+0.079%) | **4.3897 Β± 0.0051** | **βˆ’0.0811 (βˆ’1.81%)** | 1/3 |
119
- | midtier_q (per-head MLP on q) | +196,608 (+0.159%) | 4.4135 Β± 0.0086 | βˆ’0.0573 (βˆ’1.28%) | 3/3 |
120
- | cheap_q (linear gate on q) | +49,152 (+0.040%) | 4.4198 Β± 0.0185 | βˆ’0.0510 (βˆ’1.14%) | 2/3 |
 
121
 
122
- **best-at-final** is the repo's `stable` flag: the count of seeds whose best validation
123
- loss occurred at the last evaluation (step 10000) rather than earlier. It flags late
124
- training drift, not divergence β€” all twelve runs completed. Note that the baseline is 0/3
125
- on it and midtier_q is the only variant that is clean.
126
 
127
- **OLMo-2 1B, OpenWebText, 3 seeds** (val perplexity):
 
128
 
129
  | variant | mean ppl | sd |
130
  |---|---|---|
@@ -132,183 +134,175 @@ on it and midtier_q is the only variant that is clean.
132
  | cheap_qa | 43.703 | 0.124 |
133
  | midtier_q | 43.683 | 0.159 |
134
 
135
- Gating beats baseline: cheap_qa t(4) = βˆ’3.45, p = 0.026; midtier_q t(4) = βˆ’3.28, p = 0.031.
 
136
 
137
- ## What does not survive a second measurement
138
 
139
- Same recipe, matched effective batch size (4,096 tokens/iter), 3 seeds, best val CE:
140
 
141
- | variant | RTX 3060 native | RTX 3060 / WSL | NVIDIA A10 |
142
- |---|---|---|---|
143
- | baseline | 4.4708 | 4.4759 | 4.4675 |
144
- | cheap_qa | **4.3897** | **4.3902** | 4.4151 |
145
- | midtier_q | 4.4135 | β€” | **4.4039** |
146
- | gain vs baseline | βˆ’0.0811 | βˆ’0.0857 | βˆ’0.0524 |
147
-
148
- WSL reproduces native almost exactly, so the effect is portable β€” only the *ranking* moves.
149
- Seed 123 was run twice on the WSL lane; the two passes differ by 0.0017, about a third of the
150
- gap separating the top seven architectural variants.
151
-
152
- **The ordering among gates is not stable across hardware.** On the RTX 3060, cheap_qa
153
- (4.3897) beats midtier_q (4.4135). On an NVIDIA A10 under a matched recipe, midtier_q
154
- (4.4039) beats cheap_qa (4.4151). Both gates still beat their baseline on both machines β€”
155
- the effect is real on both β€” but the ranking inverts. In the 19-variant A10 bulk sweep
156
- (`results/phase8_...`) cheap_qa falls from 1st to 7th. The A10 replication file's own
157
- verdict line reads `Hardware consistency: INVESTIGATE βœ—`.
158
-
159
- **The ordering among gates does not survive scale either.** At 1B, cheap_qa and midtier_q
160
- differ by 0.02 ppl β€” t(4) = 0.17, p = 0.87, an unqualified tie β€” despite clear separation
161
- at 124M. This is the same failure as the A10 result, at a different axis. Two independent
162
- observations of the same thing is not a fluke; it is the finding.
163
-
164
- **The elaborations neither beat the simple gate nor lose to it.** Phases 14–19d explored
165
- soft-Q, soft-QA, asymmetric normalization, per-layer and per-dimension blends. Mean best
166
- val CE, same recipe, 3 seeds each:
167
-
168
- | phase | variant | mean best val CE | vs cheap_qa |
169
- |---|---|---|---|
170
- | 14 | qa_softq | 4.3865 | βˆ’0.0032 |
171
- | 15 | qa_normed_qonly | 4.3881 | βˆ’0.0016 |
172
- | 16 | qa_softqa | 4.3889 | βˆ’0.0008 |
173
- | 15 | qa_normed_yonly | 4.3890 | βˆ’0.0007 |
174
- | 17 | qa_softqa_pl | 4.3890 | βˆ’0.0007 |
175
- | β€” | **cheap_qa** | **4.3897** | β€” |
176
- | 19 | qa_softqa_pd | 4.3929 | +0.0032 |
177
- | 19c | per-dim, informed init | 4.3950 | +0.0053 |
178
- | 19b | per-dim, 6 seeds | 4.4015 | +0.0118 |
179
- | 19d | per-dim, free init | 4.4085 | +0.0188 |
180
-
181
- Five variants sit nominally ahead of the champion and none of the gaps mean anything:
182
- phase 14 vs cheap_qa is t = βˆ’0.50, p = 0.64; phase 17 is t = βˆ’0.09, p = 0.94. Seven
183
- variants span 0.0032 CE, against a within-variant seed sd of ~0.005–0.009. **No
184
- elaboration produced a reliable improvement over the simple gate, and the simple gate is
185
- not reliably better than any of them.** cheap_qa is presented as the champion because it
186
- is the cheapest thing in that indistinguishable cluster, not because it won.
187
-
188
- **The one comparison that does separate, separates on cost.** `full_x` β€” a `Linear(768οΏ½οΏ½768)`
189
- gate per layer conditioned on the layer input, i.e. the published G1 formulation β€” completes
190
- 3 seeds at **4.3950 Β± 0.0116** (`results/summaries/full_x_seed123_result_20260324_1712.txt`).
191
- cheap_qa reaches **4.3897 Β± 0.0051** with **+98,304 params (+0.079%)** against full_x's
192
- **+7,077,888 (+5.71%)**. Lower mean, less than half the seed spread, 1/72 the parameters.
193
-
194
- ⚠️ Note the earlier file `results/summaries/p2_rerun_summary_20260323_1714.txt` ranks full_x
195
- first at 4.3870. That is a **two-seed partial** written while seed 123 was still running; the
196
- March 24 file above supersedes it.
197
-
198
- Off-recipe, for completeness: warmup 3000 (phase 18b) reaches 4.3761 and warmup 1000
199
- (phase 18a) collapses to 4.5441. Warmup dominates every architectural difference measured
200
- here.
201
-
202
- ## The most interesting finding is a negative one
203
-
204
- The per-dimension blend scales are **not identified by training**. Across 12 runs and three
205
- initialization schemes, the learned scales stay wherever they were initialized:
206
-
207
- | phase | init | converged scale (q / y) | val CE |
208
  |---|---|---|---|
209
- | 19b per-dim | 0.50 | β‰ˆ0.48 / β‰ˆ0.50 | 4.4015 |
210
- | 19d free | 0.50 + noise | 0.4845 / 0.5003 | 4.4085 |
211
- | 19c informed | 0.74 | 0.7211 / 0.7423 | 4.3950 |
212
-
213
- This is not an averaging artifact. In the raw per-dimension vectors, with init 0.74 every
214
- one of the 768 scales across all 12 layers lands in 0.70–0.77; with init 0.50 they land in
215
- 0.42–0.54. Individual dimensions do not move either.
216
-
217
- The loss landscape is flat along this direction, so initialization determines the final
218
- value. Informed init (0.74, carried over from an earlier converged scalar) ends 0.0135 CE
219
- ahead of free init β€” directionally consistent with the flatness story, but inside the
220
- free-init condition's own Β±0.0221 seed spread, so treat it as suggestive rather than
221
- measured.
222
-
223
- **This is the mechanism behind the two non-replications above.** If the loss is flat along
224
- the parameters a variant is tuning, then which variant wins is decided by noise, and the
225
- ranking is free to permute when the hardware or the scale changes. Connects to
226
- ReZero / Fixup / SkipInit / LayerScale and the lazy-training literature.
227
-
228
- ## Honest limitations β€” please read before citing
229
-
230
- 1. **The 1B run did not leave learning-rate warmup.** It stopped at step 1500 of a planned
231
- 7,630 (~197M of 1B tokens), which coincides almost exactly with `t_warmup`. Models were
232
- evaluated at peak LR, never annealed. The `tier1`/`tier2` measurement points in the run
233
- summaries are `nan` because they were never reached. Whether the 124M improvement
234
- survives annealing at 1B is untested.
235
- 2. **Seed 42 of the 1B run resumed from a checkpoint** (`step1536-unsharded`, ~150s runtime
236
- vs ~8,400s) rather than training end to end. This applies to all three variants
237
- symmetrically, so it does not bias the comparison, but seed 42 is not a fresh replicate.
238
- 3. **The 124M stability rate is poor across the board.** Only 1 of 3 cheap_qa seeds, and 0
239
- of 3 baseline seeds, ended with their best validation loss at the final evaluation. Most
240
- runs were drifting upward over the last few hundred steps. The reported figures are best
241
- val CE, so this affects how much to trust any of the small differences above.
242
- 4. **Two 3060 result boards exist.** The canonical head-to-head is
243
- `results/csv/priority1_runs_20260322_1355.csv` (baseline 4.4708 / cheap_qa 4.3897), used
244
- throughout this card. An earlier board in `results/summaries/cheap_qa_confirmation_...`
245
- and `runner_a_summary_...` gives 4.4973 / 4.4073. The improvement is comparable
246
- (βˆ’0.0900 vs βˆ’0.0811); the absolute values are not.
247
- 5. **Some result files contain auto-generated boilerplate that its own tables contradict.**
248
- In particular `results/summaries/a10_replication_summary_20260322_0639.txt` ends with a
249
- `PAPER STATEMENTS` block asserting hardware independence and `|delta| < 0.02`. That text
250
- is unedited script output. The table forty lines above it in the same file shows deltas
251
- to βˆ’0.1257 and prints `Hardware consistency: INVESTIGATE βœ—`. Trust the tables, not the
252
- prose blocks.
253
- 6. **Standard deviations are not on one convention.** The 124M figures are population sd as
254
- printed by the run scripts; the 1B figures are sample sd. Differences at the third
255
- decimal between this card and a source file are usually this.
256
 
257
  ## Traps in the result files
258
 
259
- ⚠️ **`results/phase19b_canonical_canonical_qa_softqa_pd_w2000_6seeds_summary_20260403_0709.txt`
260
- and `results/phase19b_canonical_qa_softqa_pd_w2000_6seeds_20260403_0709.csv` are a FAILED
261
- run.** All six seeds are `returncode=2`, `best=nan`, no checkpoint written. They sit beside
262
- the real six-seed data from the same day (`..._0711`) under a nearly identical name. Do not
263
- read numbers from the `0709` files.
 
 
 
 
 
 
264
 
265
- ⚠️ **`results/summaries/p2_rerun_summary_20260323_1714.txt` contains a superseded
266
- leaderboard.** Its "COMPLETE CLEAN RANKING" puts `full_x` first at 4.3870 on two seeds. Seed
267
- 123 finished the following day at 4.4112, moving full_x to 4.3950 Β± 0.0116 β€” see
268
- `results/summaries/full_x_seed123_result_20260324_1712.txt`, which is authoritative.
269
 
270
- ⚠️ **`checkpoints/canon/out-shakespeare-char/`** is the upstream nanoGPT demo, not part of
271
- this study. Retained only for completeness.
272
 
273
- ⚠️ **`results/logs/command prompt summaru end 3-24-26.txt`** (filename typo preserved) is a
274
- raw console transcript, and it is the provenance record for a data correction: in the
275
- Priority 2 pass, `static_prehead`, `full_x` and `x_headshared` reported 5.76 / 6.94 / 6.95
276
- because the disk filled during `torch.save` and killed the runs at step 250, not because of
277
- the architecture. After clearing space and rerunning without checkpointing, full_x went
278
- from 6.9417 to 4.3870. If you find early numbers in this repo that look catastrophic,
279
- check that transcript before believing them.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
 
281
  ## Layout
282
 
283
  ```
284
  checkpoints/
285
  canon/ 21 x ckpt.pt base run + phases 14-19d (RTX 3060, Windows)
286
- wsl_bridge/ 12 x ckpt.pt phases 10-12, 4 variants x 3 seeds (RTX 3060, WSL)
287
  code/ model/train for both lanes + the minimal champion module
288
- results/ phase 7-19d run CSVs and summaries
289
  SHA256SUMS.txt integrity manifest for all 33 checkpoints
290
  ```
291
 
292
- Checkpoints are nanoGPT-format `ckpt.pt` (`model`, `optimizer`, `model_args`, `iter_num`,
293
- `best_val_loss`, `config`) at fp32, ~1.4 GiB each β€” optimizer state included so training
294
- can be resumed.
295
-
296
- ## Verifying integrity
297
 
298
  ```bash
299
  sha256sum -c SHA256SUMS.txt
300
  ```
301
 
302
- ## Known open questions
303
 
304
- - Does the 124M improvement survive annealing at 1B? (unresolved β€” the run never annealed)
305
- - Is the gate ranking decided by anything other than noise? Two measurements say no.
306
- - Is the per-dimension flatness specific to this gate, or general to blend parameters?
307
- - Why does the *magnitude* of the improvement differ so much by hardware (βˆ’0.081 on 3060,
308
- βˆ’0.052 on A10) when the direction does not?
 
 
309
 
310
  ## Attribution
311
 
312
  Derived from [nanoGPT](https://github.com/karpathy/nanoGPT) by Andrej Karpathy (MIT).
313
- `code/model_canon_HEAD.py` and `code/model_wslbridge.py` contain substantial portions of
314
- the upstream source. See `LICENSE`.
 
7
  - conditional-computation
8
  - gating
9
  - research-artifact
10
+ - negative-results
11
  library_name: pytorch
12
  ---
13
 
 
17
  gating** in GPT-2-class transformers. 33 checkpoints, the code that produced them, and the
18
  complete result tables β€” including the runs that did **not** support the hypothesis.
19
 
 
 
 
20
  **Code, per-phase result tables, and the full experiment history:**
21
  [github.com/briantkolb/qgate](https://github.com/briantkolb/qgate)
22
 
23
+ This repository is an archive first and a model release second. Nothing here is intended
24
+ for downstream use as a general-purpose language model.
25
+
26
+ > ### Revision notice β€” 2026-08-15
27
+ > This card was **substantially revised** the day after first publication. The initial
28
+ > version claimed the gate "produces a real improvement over an ungated baseline,"
29
+ > replicated six ways. That claim was too strong and is retracted. Three findings already
30
+ > in the project record had not been incorporated:
31
+ > 1. a 20-run controlled matrix on a hardened baseline where the learned gate **harms**;
32
+ > 2. a warmup sweep where **every gate tested loses to the ungated baseline**;
33
+ > 3. the per-dimension bands were reported ~3Γ— too tight, and the "flat loss direction"
34
+ > mechanism is contradicted by this repository's own per-layer results.
35
+ >
36
+ > The corrected thesis is below. Where two files in this corpus disagree, both are now
37
+ > shown rather than one being chosen.
38
+
39
+ ## What the data supports
40
+
41
+ **The gate's benefit is a function of how much fixed structure the baseline already has.**
42
+ On a plain GPT-2-class 124M model at 20% warmup it is a large, reproducible improvement. At
43
+ 1B, on a modern stack, it is marginal and its statistical support is under review. On a
44
+ short warmup schedule it is *worse than no gate at all*. On a heavily-optimized speedrun
45
+ baseline it is decisively harmful. That ordering is the result; the 124M number alone is not.
46
+
47
+ A second, narrower finding concerns parameterization: the same blend quantity that a
48
+ 12-parameter per-layer gate learns a clear profile for is one that a 768-parameter
49
+ per-dimension gate fails to relocate from its initialization at this token budget. Adding
50
+ capacity made it less learnable, not more.
51
 
52
  ## The intervention
53
 
 
61
  y = y * gate # before c_proj (W_O)
62
  ```
63
 
64
+ At the 124M scale this costs **98,304 parameters (+0.079%)**. In this corpus the `y` term is
65
+ called **A** (the attention output); `code/model_cheap_qa_minimal.py` is a self-contained
66
+ single-variant reference implementation with the port surface marked by `G1 SEAM` banners.
67
 
68
+ ## Where the effect is large
 
69
 
70
+ **nanoGPT 124M, OpenWebText, 10k iters, warmup 2000, seeds 42/1337/123** (val CE).
71
+ Source: `results/csv/priority1_runs_20260322_1355.csv`.
72
 
73
+ | variant | added params | val CE | vs baseline |
74
+ |---|---|---|---|
75
+ | baseline | β€” | 4.4708 Β± 0.0074 | β€” |
76
+ | **cheap_qa** (gate on `cat(q, y)`) | +98,304 (+0.079%) | **4.3897 Β± 0.0051** | **βˆ’0.0811 (βˆ’1.81%)** |
77
+ | full_x (gate on `x`, the published G1 form) | +7,077,888 (+5.71%) | 4.3950 Β± 0.0116 | βˆ’0.0758 |
78
+ | midtier_q (per-head MLP on `q`) | +196,608 (+0.159%) | 4.4135 Β± 0.0086 | βˆ’0.0573 |
79
+ | cheap_q (linear gate on `q`) | +49,152 (+0.040%) | 4.4198 Β± 0.0185 | βˆ’0.0510 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
+ The one comparison here that separates cleanly separates on **cost**, not loss: `cheap_qa`
82
+ and `full_x` differ by 0.0053 CE β€” inside seed noise β€” and by **72Γ— in added parameters**.
83
+ Parameter counts are exact; loss deltas are estimates from three seeds.
 
 
84
 
85
+ ## Where the effect goes away, and reverses
 
 
 
 
 
 
86
 
87
+ **1. Short warmup β€” every gate tested loses to the baseline.**
88
+ Source: `results/csv/warmup500_bundle_runs_20260324_1937.csv`,
89
+ `results/csv/phase6b_grok_qafollowups_w500_runs_20260328_0028.csv`,
90
+ `results/csv/phase5_warmup500_toptiers_runs_20260326_1722.csv` (warmup 500, 3 seeds each).
91
 
92
+ | variant | warmup 500 | warmup 2000 | penalty |
93
+ |---|---|---|---|
94
+ | **baseline** | **4.5663** | 4.4708 | +0.0955 |
95
+ | qa_normed | 4.5902 | 4.3926 | +0.1976 |
96
+ | cheap_qa | 4.6130 | 4.3897 | +0.2233 |
97
+ | qa_lowrank | 4.6289 | 4.4068 | +0.2221 |
98
+ | mlp128_qa | 4.6332 | 4.4032 | +0.2300 |
99
+ | full_x | 4.8518 | 4.3950 | +0.4568 |
100
+
101
+ Short warmup hurts everything, but it hurts every gate roughly twice as much as the
102
+ baseline, and at warmup 500 the ungated model wins outright. **The headline improvement is
103
+ conditional on a 20% warmup schedule.**
104
+
105
+ **2. A hardened baseline β€” the learned gate harms, decisively.**
106
+ A 20-run matrix (4 arms Γ— 5 seeds) against the `2025-01-04_SoftCap` modded-nanoGPT record on
107
+ 8Γ—H100, August 2–5 2026. Published noise floor for that record: 3.2791 Β± 0.0019 over 80 runs.
108
+
109
+ | arm | mean val loss | vs baseline |
110
+ |---|---|---|
111
+ | B β€” baseline | 3.27790 | β€” |
112
+ | S β€” static gate (0.5) | 3.27960 | +0.0017 |
113
+ | Z β€” zero-init learned gate | 3.30788 | +0.0300 |
114
+ | F β€” learned gate | 3.30796 | +0.0301 |
115
 
116
+ **F βˆ’ S = +0.0284**, 95% CI [+0.0262, +0.0305], t(4) β‰ˆ 36.5, all five seeds positive, **zero
117
+ distributional overlap** (worst ungated 3.2822, best gated 3.3049). Gated arms are also ~7%
118
+ slower.
119
+
120
+ The decomposition matters more than the sign: **static scaling costs +0.0017; making the
121
+ gate learnable costs +0.0284 β€” 16Γ— more.** The damage comes from *learning* the gate, not
122
+ from gating. `F βˆ’ Z = +0.00008` β€” random and zero init reach the same solution.
123
 
124
+ This is the best-powered experiment in the corpus, and it is negative. Primary logs
125
+ (`qgate_run3_MATRIX.tar.gz`) are not in this repository; the figures above are from the
126
+ August 2–5 session record.
 
127
 
128
+ **3. Scale β€” the ordering among gates does not survive.**
129
+ OLMo-2 1B, OpenWebText, 3 seeds, H100 (`rope`, `rmsnorm`, `swiglu`, QK-norm, post-norm):
130
 
131
  | variant | mean ppl | sd |
132
  |---|---|---|
 
134
  | cheap_qa | 43.703 | 0.124 |
135
  | midtier_q | 43.683 | 0.159 |
136
 
137
+ `cheap_qa` and `midtier_q` differ by 0.02 ppl β€” p = 0.87, a tie β€” despite clear separation at
138
+ 124M. **See the caveats below before using the 1B result for anything.**
139
 
140
+ ## What is contested inside this corpus
141
 
142
+ Two or more files here disagree. These are shown rather than resolved.
143
 
144
+ **The A10 comparison.** Two boards, same hardware, same recipe, different conclusions:
145
+
146
+ | source | baseline | cheap_qa | midtier_q | ordering |
147
+ |---|---|---|---|---|
148
+ | `results/summaries/priority1_summary_20260322_1355.txt` (A10 ref block) | 4.4675 | 4.4151 | **4.4039** | midtier_q wins |
149
+ | `results/phase8_warmup2000_bulk_a10_runs_20260329_0650.csv` (19 variants, 57 runs) | 4.4676 | **4.4155** | 4.4183 | cheap_qa wins |
150
+
151
+ Baseline and cheap_qa agree to 0.0004 across both. **`midtier_q` differs by 0.0144, and that
152
+ single number is what the "ordering inverts on A10" claim rests on.** The larger and later
153
+ board does not reproduce the inversion. Additionally, the A10 lane ran a different software
154
+ stack (torch 2.7.0+cu128) from the canonical 3060 board (2.5.1+cu121), and the project record
155
+ explicitly blocks a hardware-only interpretation until a version-matched rerun exists.
156
+
157
+ What *is* consistent across both A10 boards: `cheap_qa` beats baseline, and it drops from
158
+ 1st on the 3060 to 7th of 19 on the A10 (behind `x_full_headspec` at 4.3858).
159
+
160
+ **The 1B result.** An August 4 review found: the gate-norm "stability" claim retracted
161
+ (post-training β€–Wβ€–_F is statistically indistinguishable from an untouched init draw,
162
+ P = 0.494); the win record mislabelled (`cheap_qa` alone is 3/3, sign-test **p = 0.125 β€” not
163
+ significant**; the gated family pooled is 6/6, p = 0.0156); seed 42 resumed from a
164
+ `step1536` checkpoint in all three arms and carries the largest margin (dropping it moves the
165
+ mean delta 0.433 β†’ 0.285); the advantage is late-emerging (baseline *leads* on 2/3 seeds at
166
+ step 500); `midtier_q` logged no gate proxy, so there is no cross-variant control. **Whether
167
+ the OLMo gate trained at all is not established** β€” a frozen random projection is not
168
+ excluded. The checkpoints were lost with the rented instance, so this may stay open.
169
+
170
+ **Whether the 1B run left LR warmup.** One record says the schedule was truncated but
171
+ `t_warmup` fixed 200M→40M with `expected_max_steps: 1526`; another says warmup was never
172
+ exited. The rendered per-run config was never recovered. Unresolved.
173
+
174
+ **The WSL lane.** Two docs report baseline/cheap_qa as 4.4759/4.3902 and 4.4732/4.3800. The
175
+ WSL baseline also shows late-training spikes attributed to WSL2 memory management β€”
176
+ contamination in the direction that widens the gap. This lane also ran torch 2.7.0.
177
+
178
+ **Seed sensitivity.** On out-of-band seeds 0/1/2 (`results/phase9_...20260328_2327.csv`),
179
+ `cheap_qa` is 4.4139 Β± 0.0094 rather than 4.3897, and `qa_normed` (4.4103) beats it. The
180
+ Β±0.0051 above is a within-seed-set figure for 42/1337/123.
181
+
182
+ ## The per-dimension result
183
+
184
+ **Corrected 2026-08-15.** Earlier versions of this card reported far tighter bands. Those
185
+ were per-*layer mean* bands presented as individual-value bands. Full vectors, all 12 layers,
186
+ 3 seeds β€” 4,608 values per condition:
187
+
188
+ | phase | init | individual values | per-layer means | mean | val CE |
189
+ |---|---|---|---|---|---|
190
+ | 19b | 0.50 | β€” | q 0.4587–0.5202 / y 0.4687–0.5766 | 0.481 / 0.504 | 4.4015 |
191
+ | 19d free | ~0.50 | **0.3593–0.6821** | 0.4558–0.5718 | **0.4924** | 4.4085 |
192
+ | 19c informed | 0.74 | **0.5745–0.8457** | 0.6995–0.7826 | **0.7317** | 4.3950 |
193
+
194
+ **What holds:** the *mean* does not move from its initialization β€” 0.74 β†’ 0.7317, 0.50 β†’
195
+ 0.4924. Initialization sets where the distribution sits.
196
+
197
+ **What does not hold:** "the scales do not move." They spread substantially β€” 19c covers a
198
+ 0.27 range, 19d covers 0.32. Individual dimensions differentiate; the center does not shift.
199
+
200
+ **The mechanism claimed earlier β€” a flat loss direction β€” is contradicted by this repository.**
201
+ The same blend quantity moves decisively under coarser parameterization:
202
+
203
+ | parameterization | params | init | converged |
 
 
 
 
 
 
 
204
  |---|---|---|---|
205
+ | phase 14, single scalar | 1 | 0.5 | **0.7391–0.7443** |
206
+ | phase 17, per-layer | 12 | 0.5 | q 0.3803–0.5551 (mean 0.4481) / y 0.4126–0.6529 (mean 0.5144) |
207
+ | phase 19b/c/d, per-dimension | 768 | 0.50 / 0.74 | mean stays at init |
208
+
209
+ A scalar moves +0.24 from its initialization. Twelve per-layer values differentiate across a
210
+ 0.27 range and reproduce a consistent profile. Seven hundred sixty-eight per-dimension values
211
+ do not relocate their mean. **The loss is not flat along this axis β€” the fine parameterization
212
+ is not identified at this budget.** Gradient dilution across 1,536 parameters and simple
213
+ undertraining are both live explanations and this corpus cannot separate them.
214
+
215
+ ## Honest limitations
216
+
217
+ 1. **The headline 124M result is conditional on warmup 2000.** At warmup 500 the ungated
218
+ baseline beats every gate tested.
219
+ 2. **The best-powered experiment in this corpus is negative** (speedrun matrix, above).
220
+ 3. **The 1B evidence is weak and partly under review** β€” see the contested section. Do not
221
+ cite it as scale validation.
222
+ 4. **`cheap_qa`'s margin is seed-set dependent** β€” 4.3897 on seeds 42/1337/123, 4.4139 on
223
+ seeds 0/1/2.
224
+ 5. **Only 1 of 3 `cheap_qa` seeds, and 0 of 3 baseline seeds, ended with their best
225
+ validation loss at the final evaluation.** Most runs were drifting upward late.
226
+ 6. **Elaborations (phases 14–19d) tie with the simple gate.** Seven variants sit within
227
+ 0.0032 CE against a within-variant seed sd of 0.005–0.012; phase 14 (4.3865) and 17
228
+ (4.3890) are nominally ahead (p = 0.64, 0.94). Off-recipe, warmup 3000 reaches 4.3761.
229
+ 7. **Standard deviations are population sd at 124M, sample sd at 1B.** A 3-sample sd carries
230
+ roughly 52% relative standard error either way.
231
+ 8. **Head-specific vs head-shared is confounded** by gate input width and is not claimed.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  ## Traps in the result files
234
 
235
+ ⚠️ `results/phase19b_canonical_*_0709.*` is a **failed run** β€” six seeds, `returncode=2`,
236
+ `best=nan`, no checkpoint. It sits beside the real six-seed data (`..._0711`).
237
+
238
+ ⚠️ `results/summaries/p2_rerun_summary_20260323_1714.txt` ranks `full_x` first at 4.3870 on a
239
+ **two-seed partial**. `results/summaries/full_x_seed123_result_20260324_1712.txt` (4.3950,
240
+ 3 seeds) supersedes it.
241
+
242
+ ⚠️ `results/summaries/a10_replication_summary_20260322_0639.txt` ends with an auto-generated
243
+ `PAPER STATEMENTS` block asserting hardware independence and `|delta| < 0.02`. Its own table
244
+ forty lines above shows deltas to βˆ’0.1257 and prints `Hardware consistency: INVESTIGATE βœ—`.
245
+ Trust the tables, not the prose blocks.
246
 
247
+ ⚠️ **Era warning.** Results predating the `beta2=0.99` fix land in the 4.5–4.6 CE band and are
248
+ not comparable to clean-recipe results in the 4.38–4.47 band.
 
 
249
 
250
+ ⚠️ `checkpoints/canon/out-shakespeare-char/` is the upstream nanoGPT demo, not part of this
251
+ study.
252
 
253
+ ## Relation to published work
254
+
255
+ Gating the SDPA output at G1 is established. **This is a replication and mechanism study, not
256
+ a novelty claim.**
257
+
258
+ - [Qiu et al. 2025](https://arxiv.org/abs/2505.06708) (NeurIPS 2025 Oral) β€” the G1 gate at
259
+ 15B-MoE / 1.7B-dense scale, conditioned on **X** (layer input) in all fifteen reported
260
+ variants. `full_x` here is that formulation ported to nanoGPT.
261
+ - [Bu et al. 2025](https://arxiv.org/abs/2510.09017) β€” moves the gate input from X to **V**.
262
+ - [Zhou et al. 2026](https://arxiv.org/abs/2608.11805) (Tencent Hunyuan, 12 Aug 2026) β€” adds
263
+ an **H-gate** computed from the SDPA output. Up to notation, their `H` is the `y`/A term in
264
+ `cat(q, y)`. Subsequent and independent; their 5B/500B result reaches a regime this corpus
265
+ cannot.
266
+
267
+ Two of Qiu et al.'s qualitative findings reproduce here at ~1/10,000 of their token budget:
268
+ G1 gating beats baseline (6.026 β†’ 5.761 PPL there; 4.4708 β†’ 4.3897 CE here, at warmup 2000),
269
+ and input-*dependent* beats input-*independent* (5.917 β†’ 5.761; 4.4483 β†’ 4.3897). The
270
+ input-independent control is an exact structural match β€” a zero-initialized learnable
271
+ `(n_head Γ— head_dim)` parameter through a sigmoid in both cases.
272
+
273
+ `cheap_qa` was confirmed 2026-03-20
274
+ (`results/csv/cheap_qa_confirmation_runs_20260320_1854.csv`), before the prior-art search that
275
+ located Qiu et al.; the project was then reclassified from a novelty claim to a replication
276
+ study. **This establishes no priority** β€” these results were private until August 2026.
277
 
278
  ## Layout
279
 
280
  ```
281
  checkpoints/
282
  canon/ 21 x ckpt.pt base run + phases 14-19d (RTX 3060, Windows)
283
+ wsl_bridge/ 12 x ckpt.pt phases 10-12 (RTX 3060, WSL)
284
  code/ model/train for both lanes + the minimal champion module
285
+ results/ phase 7-19d run CSVs, summaries and logs
286
  SHA256SUMS.txt integrity manifest for all 33 checkpoints
287
  ```
288
 
289
+ nanoGPT-format `ckpt.pt` at fp32, ~1.4 GiB each, optimizer state included.
 
 
 
 
290
 
291
  ```bash
292
  sha256sum -c SHA256SUMS.txt
293
  ```
294
 
295
+ ## Open questions
296
 
297
+ - Does the benefit really track baseline hardness, or is the three-point arc a coincidence of
298
+ three different codebases?
299
+ - Why does making the gate *learnable* cost 16Γ— what the gate itself costs?
300
+ - Is the per-dimension non-identifiability gradient dilution or undertraining? A longer run at
301
+ one initialization would separate them.
302
+ - Did the OLMo gate train at all?
303
+ - Why does `cheap_qa` fall from 1st to 7th on the A10 while still beating baseline?
304
 
305
  ## Attribution
306
 
307
  Derived from [nanoGPT](https://github.com/karpathy/nanoGPT) by Andrej Karpathy (MIT).
308
+ See `LICENSE`.