Correct model card; add LICENSE with nanoGPT attribution
Browse filesModel card corrections, all verified against result files in this repo:
- stability counts were seeds-completed, not seeds-stable (baseline 0/3, cheap_qa 1/3, midtier_q 3/3 per priority1 CSV)
- the A10 result is an ordering permutation, not a sign flip; cheap_qa beats baseline on A10 (4.4675 -> 4.4151)
- phases 14-17 tie with or edge past cheap_qa; phase 19b was not the best elaboration but the second worst
- added the full_x parameter-efficiency comparison (+7.08M vs +98K)
- added LICENSE retaining the nanoGPT (c) 2022 Andrej Karpathy notice
- fixed the docstring's grep string for the G1 seam marker
- LICENSE +34 -0
- README.md +209 -29
- code/model_cheap_qa_minimal.py +2 -2
LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2022 Andrej Karpathy
|
| 4 |
+
Copyright (c) 2026 Brian Kolb
|
| 5 |
+
|
| 6 |
+
This repository is derived from nanoGPT (https://github.com/karpathy/nanoGPT),
|
| 7 |
+
Copyright (c) 2022 Andrej Karpathy, distributed under the MIT License.
|
| 8 |
+
|
| 9 |
+
The following files contain substantial portions of the upstream nanoGPT source,
|
| 10 |
+
modified to add the gating variants studied here:
|
| 11 |
+
|
| 12 |
+
code/model_canon_HEAD.py
|
| 13 |
+
code/model_wslbridge.py
|
| 14 |
+
code/model_cheap_qa_minimal.py
|
| 15 |
+
code/train_canon_HEAD.py
|
| 16 |
+
code/train_wslbridge.py
|
| 17 |
+
|
| 18 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 19 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 20 |
+
in the Software without restriction, including without limitation the rights
|
| 21 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 22 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 23 |
+
furnished to do so, subject to the following conditions:
|
| 24 |
+
|
| 25 |
+
The above copyright notice and this permission notice shall be included in all
|
| 26 |
+
copies or substantial portions of the Software.
|
| 27 |
+
|
| 28 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 29 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 30 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 31 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 32 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 33 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 34 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -19,6 +19,17 @@ complete result tables β including the runs that did **not** support the hypot
|
|
| 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 |
## The intervention
|
| 23 |
|
| 24 |
A single gate applied at the **G1 seam** β post-SDPA, pre-output-projection:
|
|
@@ -34,17 +45,81 @@ y = y * gate # before c_proj (W_O)
|
|
| 34 |
At the 124M scale this costs **98,304 parameters (+0.079%)**.
|
| 35 |
|
| 36 |
`code/model_cheap_qa_minimal.py` is a self-contained single-variant reference
|
| 37 |
-
implementation with the port surface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Headline results
|
| 40 |
|
| 41 |
-
**nanoGPT 124M, OpenWebText, 10k iters, warmup 2000, seeds 42/1337/123** (val CE)
|
|
|
|
| 42 |
|
| 43 |
-
| variant | val CE | vs baseline |
|
| 44 |
-
|---|---|---|---|
|
| 45 |
-
| baseline | 4.4708 | β |
|
| 46 |
-
| **cheap_qa** (
|
| 47 |
-
| midtier_q (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
**OLMo-2 1B, OpenWebText, 3 seeds** (val perplexity):
|
| 50 |
|
|
@@ -54,23 +129,59 @@ implementation with the port surface explicitly marked `# === G1 SEAM ===`.
|
|
| 54 |
| cheap_qa | 43.703 | 0.124 |
|
| 55 |
| midtier_q | 43.683 | 0.159 |
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
## The most interesting finding is a negative one
|
| 76 |
|
|
@@ -83,9 +194,73 @@ initialization schemes, the learned scales stay wherever they were initialized:
|
|
| 83 |
| 19d free | 0.50 + noise | 0.4845 / 0.5003 | 4.4085 |
|
| 84 |
| 19c informed | 0.74 | 0.7211 / 0.7423 | 4.3950 |
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
The loss landscape is flat along this direction, so initialization determines the final
|
| 87 |
-
value
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
## Layout
|
| 91 |
|
|
@@ -102,9 +277,6 @@ Checkpoints are nanoGPT-format `ckpt.pt` (`model`, `optimizer`, `model_args`, `i
|
|
| 102 |
`best_val_loss`, `config`) at fp32, ~1.4 GiB each β optimizer state included so training
|
| 103 |
can be resumed.
|
| 104 |
|
| 105 |
-
β οΈ `checkpoints/canon/out-shakespeare-char/` is the upstream nanoGPT demo, not part of
|
| 106 |
-
this study. It is retained only for completeness.
|
| 107 |
-
|
| 108 |
## Verifying integrity
|
| 109 |
|
| 110 |
```bash
|
|
@@ -114,5 +286,13 @@ sha256sum -c SHA256SUMS.txt
|
|
| 114 |
## Known open questions
|
| 115 |
|
| 116 |
- Does the 124M improvement survive annealing at 1B? (unresolved β the run never annealed)
|
| 117 |
-
-
|
| 118 |
- Is the per-dimension flatness specific to this gate, or general to blend parameters?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
**What the data supports, in one paragraph.** A single small gate at one seam of the
|
| 23 |
+
attention block produces a real improvement over an ungated baseline β replicated at 124M
|
| 24 |
+
and at 1B, on three hardware configurations, significant at both scales. Almost nothing
|
| 25 |
+
beyond that survives contact with a second measurement. Which signal the gate is
|
| 26 |
+
conditioned on, how it is parameterized, and how the variants rank against each other all
|
| 27 |
+
change when the hardware changes or the scale changes, and seven of the variants sit
|
| 28 |
+
inside the seed noise floor of one another at 124M. The most useful result in this corpus
|
| 29 |
+
is the mechanism for that: on the one family where the parameters are directly
|
| 30 |
+
observable, the loss is flat along the axis being tuned, and training never moves the
|
| 31 |
+
parameters off their initialization.
|
| 32 |
+
|
| 33 |
## The intervention
|
| 34 |
|
| 35 |
A single gate applied at the **G1 seam** β post-SDPA, pre-output-projection:
|
|
|
|
| 45 |
At the 124M scale this costs **98,304 parameters (+0.079%)**.
|
| 46 |
|
| 47 |
`code/model_cheap_qa_minimal.py` is a self-contained single-variant reference
|
| 48 |
+
implementation with the port surface marked by `G1 SEAM` banner comments.
|
| 49 |
+
|
| 50 |
+
## Relation to published work
|
| 51 |
+
|
| 52 |
+
Gating the SDPA output at the G1 seam is established. **This is a small-scale replication
|
| 53 |
+
and mechanism study, not a novelty claim.**
|
| 54 |
+
|
| 55 |
+
- **Qiu et al. 2025**, [*Gated Attention for Large Language Models*](https://arxiv.org/abs/2505.06708)
|
| 56 |
+
(NeurIPS 2025 Oral). Establishes the G1 gate at 15B-MoE and 1.7B-dense scale on up to 3.5T
|
| 57 |
+
tokens. Their formulation is `Y' = Y β Ο(XΒ·WΞΈ)` β the gate is computed from **X, the layer
|
| 58 |
+
input**, in all fifteen variants they report. Their SDPA-elementwise G1 winner adds 201M
|
| 59 |
+
parameters. `full_x` / `x_full_headspec` here are that formulation ported to nanoGPT.
|
| 60 |
+
- **Bu et al. 2025**, [*Value-State Gated Attention*](https://arxiv.org/abs/2510.09017).
|
| 61 |
+
Moves the gate input from X to **V**, arguing a reactive gate (computed from the value
|
| 62 |
+
state) decouples value and attention updates better than a predictive one.
|
| 63 |
+
- **Zhou et al. 2026**, [*Hybrid Gated Attention*](https://arxiv.org/abs/2608.11805)
|
| 64 |
+
(Tencent Hunyuan, 12 Aug 2026). Adds an **H-gate** computed from the SDPA output `H`,
|
| 65 |
+
fused with the X-gate, on the observation that *"the output H contains richer
|
| 66 |
+
token-interaction information after attention"* that X does not capture. Validated on
|
| 67 |
+
MoE-5B over 500B tokens.
|
| 68 |
+
|
| 69 |
+
**Where `cheap_qa` sits.** Its gate is computed from `cat(q, y)` β the query and the SDPA
|
| 70 |
+
output being gated. The `y` term is the same signal Zhou et al. call `H`. On the gate-input
|
| 71 |
+
axis the published sequence is X β V β X+H, and `cat(q, y)` is a point on it that none of
|
| 72 |
+
the three tested: one `Linear(2Β·head_dim β head_dim)`, 98,304 parameters at 124M.
|
| 73 |
+
|
| 74 |
+
**Chronology.** This work reached G1 gating independently and found the prior art
|
| 75 |
+
afterward. `cheap_qa` was confirmed 2026-03-20
|
| 76 |
+
(`results/csv/cheap_qa_confirmation_runs_20260320_1854.csv`). Qiu et al. was located days
|
| 77 |
+
later, at which point the project was reclassified from a novelty claim to a replication
|
| 78 |
+
and mechanism study, and their X-conditioned formulation was implemented as `full_x`
|
| 79 |
+
*specifically to run head-to-head against* `cheap_qa`
|
| 80 |
+
(`results/summaries/full_x_seed123_result_20260324_1712.txt`, 2026-03-24). Zhou et al.
|
| 81 |
+
appeared 2026-08-12, five months after `cheap_qa`. **None of this establishes priority** β
|
| 82 |
+
these results were private until publication. It is recorded only because the dates are
|
| 83 |
+
checkable in the files.
|
| 84 |
+
|
| 85 |
+
**What replicates here.** Two of Qiu et al.'s qualitative findings reproduce at 124M on one
|
| 86 |
+
RTX 3060, at roughly 1/10,000 of their token budget:
|
| 87 |
+
|
| 88 |
+
| claim | Qiu et al. (15B MoE, 400B tok) | here (124M, ~41M tok) |
|
| 89 |
+
|---|---|---|
|
| 90 |
+
| G1 gating beats baseline | 6.026 β 5.761 PPL | 4.4708 β 4.3897 CE |
|
| 91 |
+
| input-*dependent* gating beats input-*independent* | 5.917 β 5.761 | 4.4483 β 4.3897 |
|
| 92 |
+
|
| 93 |
+
The input-independent control is an exact structural match: Qiu's is a zero-initialized
|
| 94 |
+
learnable `(q Γ dk)` parameter through a sigmoid; `static_prehead` here is
|
| 95 |
+
`nn.Parameter(torch.zeros(n_head, head_dim))` through a sigmoid. In both cases it recovers
|
| 96 |
+
roughly a third of the gain (41% there, 28% here), confirming that part of the effect is
|
| 97 |
+
non-linearity alone and the rest requires input dependence.
|
| 98 |
+
|
| 99 |
+
**What is *not* claimed.** Qiu et al. also find head-specific gating beats head-shared. The
|
| 100 |
+
variants here that would test it (`x_headshared`, 4.4346, versus `full_x`, 4.3950) differ in
|
| 101 |
+
gate *input width* as well as head-sharing β `Linear(64β64)` on a per-head slice versus
|
| 102 |
+
`Linear(768β768)` on the full hidden state β so the comparison is confounded and is not
|
| 103 |
+
offered as a replication. The unconfounded pair
|
| 104 |
+
(`dynamic_x_g1_headspecific_elementwise` vs `dynamic_x_g1_headshared_elementwise`) was only
|
| 105 |
+
run under the earlier, superseded recipe.
|
| 106 |
|
| 107 |
## Headline results
|
| 108 |
|
| 109 |
+
**nanoGPT 124M, OpenWebText, 10k iters, warmup 2000, seeds 42/1337/123** (val CE).
|
| 110 |
+
Source: `results/csv/priority1_runs_20260322_1355.csv`.
|
| 111 |
|
| 112 |
+
| variant | added params | val CE | vs baseline | best-at-final |
|
| 113 |
+
|---|---|---|---|---|
|
| 114 |
+
| baseline | β | 4.4708 Β± 0.0074 | β | 0/3 |
|
| 115 |
+
| **cheap_qa** (gate on `cat(q, y)`) | +98,304 (+0.079%) | **4.3897 Β± 0.0051** | **β0.0811 (β1.81%)** | 1/3 |
|
| 116 |
+
| midtier_q (per-head MLP on q) | +196,608 (+0.159%) | 4.4135 Β± 0.0086 | β0.0573 (β1.28%) | 3/3 |
|
| 117 |
+
| cheap_q (linear gate on q) | +49,152 (+0.040%) | 4.4198 Β± 0.0185 | β0.0510 (β1.14%) | 2/3 |
|
| 118 |
+
|
| 119 |
+
**best-at-final** is the repo's `stable` flag: the count of seeds whose best validation
|
| 120 |
+
loss occurred at the last evaluation (step 10000) rather than earlier. It flags late
|
| 121 |
+
training drift, not divergence β all twelve runs completed. Note that the baseline is 0/3
|
| 122 |
+
on it and midtier_q is the only variant that is clean.
|
| 123 |
|
| 124 |
**OLMo-2 1B, OpenWebText, 3 seeds** (val perplexity):
|
| 125 |
|
|
|
|
| 129 |
| cheap_qa | 43.703 | 0.124 |
|
| 130 |
| midtier_q | 43.683 | 0.159 |
|
| 131 |
|
| 132 |
+
Gating beats baseline: cheap_qa t(4) = β3.45, p = 0.026; midtier_q t(4) = β3.28, p = 0.031.
|
| 133 |
|
| 134 |
+
## What does not survive a second measurement
|
| 135 |
+
|
| 136 |
+
**The ordering among gates is not stable across hardware.** On the RTX 3060, cheap_qa
|
| 137 |
+
(4.3897) beats midtier_q (4.4135). On an NVIDIA A10 under a matched recipe, midtier_q
|
| 138 |
+
(4.4039) beats cheap_qa (4.4151). Both gates still beat their baseline on both machines β
|
| 139 |
+
the effect is real on both β but the ranking inverts. In the 19-variant A10 bulk sweep
|
| 140 |
+
(`results/phase8_...`) cheap_qa falls from 1st to 7th. The A10 replication file's own
|
| 141 |
+
verdict line reads `Hardware consistency: INVESTIGATE β`.
|
| 142 |
+
|
| 143 |
+
**The ordering among gates does not survive scale either.** At 1B, cheap_qa and midtier_q
|
| 144 |
+
differ by 0.02 ppl β t(4) = 0.17, p = 0.87, an unqualified tie β despite clear separation
|
| 145 |
+
at 124M. This is the same failure as the A10 result, at a different axis. Two independent
|
| 146 |
+
observations of the same thing is not a fluke; it is the finding.
|
| 147 |
+
|
| 148 |
+
**The elaborations neither beat the simple gate nor lose to it.** Phases 14β19d explored
|
| 149 |
+
soft-Q, soft-QA, asymmetric normalization, per-layer and per-dimension blends. Mean best
|
| 150 |
+
val CE, same recipe, 3 seeds each:
|
| 151 |
+
|
| 152 |
+
| phase | variant | mean best val CE | vs cheap_qa |
|
| 153 |
+
|---|---|---|---|
|
| 154 |
+
| 14 | qa_softq | 4.3865 | β0.0032 |
|
| 155 |
+
| 15 | qa_normed_qonly | 4.3881 | β0.0016 |
|
| 156 |
+
| 16 | qa_softqa | 4.3889 | β0.0008 |
|
| 157 |
+
| 15 | qa_normed_yonly | 4.3890 | β0.0007 |
|
| 158 |
+
| 17 | qa_softqa_pl | 4.3890 | β0.0007 |
|
| 159 |
+
| β | **cheap_qa** | **4.3897** | β |
|
| 160 |
+
| 19 | qa_softqa_pd | 4.3929 | +0.0032 |
|
| 161 |
+
| 19c | per-dim, informed init | 4.3950 | +0.0053 |
|
| 162 |
+
| 19b | per-dim, 6 seeds | 4.4015 | +0.0118 |
|
| 163 |
+
| 19d | per-dim, free init | 4.4085 | +0.0188 |
|
| 164 |
+
|
| 165 |
+
Five variants sit nominally ahead of the champion and none of the gaps mean anything:
|
| 166 |
+
phase 14 vs cheap_qa is t = β0.50, p = 0.64; phase 17 is t = β0.09, p = 0.94. Seven
|
| 167 |
+
variants span 0.0032 CE, against a within-variant seed sd of ~0.005β0.009. **No
|
| 168 |
+
elaboration produced a reliable improvement over the simple gate, and the simple gate is
|
| 169 |
+
not reliably better than any of them.** cheap_qa is presented as the champion because it
|
| 170 |
+
is the cheapest thing in that indistinguishable cluster, not because it won.
|
| 171 |
+
|
| 172 |
+
**The one comparison that does separate, separates on cost.** `full_x` β a `Linear(768β768)`
|
| 173 |
+
gate per layer conditioned on the layer input, i.e. the published G1 formulation β completes
|
| 174 |
+
3 seeds at **4.3950 Β± 0.0116** (`results/summaries/full_x_seed123_result_20260324_1712.txt`).
|
| 175 |
+
cheap_qa reaches **4.3897 Β± 0.0051** with **+98,304 params (+0.079%)** against full_x's
|
| 176 |
+
**+7,077,888 (+5.71%)**. Lower mean, less than half the seed spread, 1/72 the parameters.
|
| 177 |
+
|
| 178 |
+
β οΈ Note the earlier file `results/summaries/p2_rerun_summary_20260323_1714.txt` ranks full_x
|
| 179 |
+
first at 4.3870. That is a **two-seed partial** written while seed 123 was still running; the
|
| 180 |
+
March 24 file above supersedes it.
|
| 181 |
+
|
| 182 |
+
Off-recipe, for completeness: warmup 3000 (phase 18b) reaches 4.3761 and warmup 1000
|
| 183 |
+
(phase 18a) collapses to 4.5441. Warmup dominates every architectural difference measured
|
| 184 |
+
here.
|
| 185 |
|
| 186 |
## The most interesting finding is a negative one
|
| 187 |
|
|
|
|
| 194 |
| 19d free | 0.50 + noise | 0.4845 / 0.5003 | 4.4085 |
|
| 195 |
| 19c informed | 0.74 | 0.7211 / 0.7423 | 4.3950 |
|
| 196 |
|
| 197 |
+
This is not an averaging artifact. In the raw per-dimension vectors, with init 0.74 every
|
| 198 |
+
one of the 768 scales across all 12 layers lands in 0.70β0.77; with init 0.50 they land in
|
| 199 |
+
0.42β0.54. Individual dimensions do not move either.
|
| 200 |
+
|
| 201 |
The loss landscape is flat along this direction, so initialization determines the final
|
| 202 |
+
value. Informed init (0.74, carried over from an earlier converged scalar) ends 0.0135 CE
|
| 203 |
+
ahead of free init β directionally consistent with the flatness story, but inside the
|
| 204 |
+
free-init condition's own Β±0.0221 seed spread, so treat it as suggestive rather than
|
| 205 |
+
measured.
|
| 206 |
+
|
| 207 |
+
**This is the mechanism behind the two non-replications above.** If the loss is flat along
|
| 208 |
+
the parameters a variant is tuning, then which variant wins is decided by noise, and the
|
| 209 |
+
ranking is free to permute when the hardware or the scale changes. Connects to
|
| 210 |
+
ReZero / Fixup / SkipInit / LayerScale and the lazy-training literature.
|
| 211 |
+
|
| 212 |
+
## Honest limitations β please read before citing
|
| 213 |
+
|
| 214 |
+
1. **The 1B run did not leave learning-rate warmup.** It stopped at step 1500 of a planned
|
| 215 |
+
7,630 (~197M of 1B tokens), which coincides almost exactly with `t_warmup`. Models were
|
| 216 |
+
evaluated at peak LR, never annealed. The `tier1`/`tier2` measurement points in the run
|
| 217 |
+
summaries are `nan` because they were never reached. Whether the 124M improvement
|
| 218 |
+
survives annealing at 1B is untested.
|
| 219 |
+
2. **Seed 42 of the 1B run resumed from a checkpoint** (`step1536-unsharded`, ~150s runtime
|
| 220 |
+
vs ~8,400s) rather than training end to end. This applies to all three variants
|
| 221 |
+
symmetrically, so it does not bias the comparison, but seed 42 is not a fresh replicate.
|
| 222 |
+
3. **The 124M stability rate is poor across the board.** Only 1 of 3 cheap_qa seeds, and 0
|
| 223 |
+
of 3 baseline seeds, ended with their best validation loss at the final evaluation. Most
|
| 224 |
+
runs were drifting upward over the last few hundred steps. The reported figures are best
|
| 225 |
+
val CE, so this affects how much to trust any of the small differences above.
|
| 226 |
+
4. **Two 3060 result boards exist.** The canonical head-to-head is
|
| 227 |
+
`results/csv/priority1_runs_20260322_1355.csv` (baseline 4.4708 / cheap_qa 4.3897), used
|
| 228 |
+
throughout this card. An earlier board in `results/summaries/cheap_qa_confirmation_...`
|
| 229 |
+
and `runner_a_summary_...` gives 4.4973 / 4.4073. The improvement is comparable
|
| 230 |
+
(β0.0900 vs β0.0811); the absolute values are not.
|
| 231 |
+
5. **Some result files contain auto-generated boilerplate that its own tables contradict.**
|
| 232 |
+
In particular `results/summaries/a10_replication_summary_20260322_0639.txt` ends with a
|
| 233 |
+
`PAPER STATEMENTS` block asserting hardware independence and `|delta| < 0.02`. That text
|
| 234 |
+
is unedited script output. The table forty lines above it in the same file shows deltas
|
| 235 |
+
to β0.1257 and prints `Hardware consistency: INVESTIGATE β`. Trust the tables, not the
|
| 236 |
+
prose blocks.
|
| 237 |
+
6. **Standard deviations are not on one convention.** The 124M figures are population sd as
|
| 238 |
+
printed by the run scripts; the 1B figures are sample sd. Differences at the third
|
| 239 |
+
decimal between this card and a source file are usually this.
|
| 240 |
+
|
| 241 |
+
## Traps in the result files
|
| 242 |
+
|
| 243 |
+
β οΈ **`results/phase19b_canonical_canonical_qa_softqa_pd_w2000_6seeds_summary_20260403_0709.txt`
|
| 244 |
+
and `results/phase19b_canonical_qa_softqa_pd_w2000_6seeds_20260403_0709.csv` are a FAILED
|
| 245 |
+
run.** All six seeds are `returncode=2`, `best=nan`, no checkpoint written. They sit beside
|
| 246 |
+
the real six-seed data from the same day (`..._0711`) under a nearly identical name. Do not
|
| 247 |
+
read numbers from the `0709` files.
|
| 248 |
+
|
| 249 |
+
β οΈ **`results/summaries/p2_rerun_summary_20260323_1714.txt` contains a superseded
|
| 250 |
+
leaderboard.** Its "COMPLETE CLEAN RANKING" puts `full_x` first at 4.3870 on two seeds. Seed
|
| 251 |
+
123 finished the following day at 4.4112, moving full_x to 4.3950 Β± 0.0116 β see
|
| 252 |
+
`results/summaries/full_x_seed123_result_20260324_1712.txt`, which is authoritative.
|
| 253 |
+
|
| 254 |
+
β οΈ **`checkpoints/canon/out-shakespeare-char/`** is the upstream nanoGPT demo, not part of
|
| 255 |
+
this study. Retained only for completeness.
|
| 256 |
+
|
| 257 |
+
β οΈ **`results/logs/command prompt summaru end 3-24-26.txt`** (filename typo preserved) is a
|
| 258 |
+
raw console transcript, and it is the provenance record for a data correction: in the
|
| 259 |
+
Priority 2 pass, `static_prehead`, `full_x` and `x_headshared` reported 5.76 / 6.94 / 6.95
|
| 260 |
+
because the disk filled during `torch.save` and killed the runs at step 250, not because of
|
| 261 |
+
the architecture. After clearing space and rerunning without checkpointing, full_x went
|
| 262 |
+
from 6.9417 to 4.3870. If you find early numbers in this repo that look catastrophic,
|
| 263 |
+
check that transcript before believing them.
|
| 264 |
|
| 265 |
## Layout
|
| 266 |
|
|
|
|
| 277 |
`best_val_loss`, `config`) at fp32, ~1.4 GiB each β optimizer state included so training
|
| 278 |
can be resumed.
|
| 279 |
|
|
|
|
|
|
|
|
|
|
| 280 |
## Verifying integrity
|
| 281 |
|
| 282 |
```bash
|
|
|
|
| 286 |
## Known open questions
|
| 287 |
|
| 288 |
- Does the 124M improvement survive annealing at 1B? (unresolved β the run never annealed)
|
| 289 |
+
- Is the gate ranking decided by anything other than noise? Two measurements say no.
|
| 290 |
- Is the per-dimension flatness specific to this gate, or general to blend parameters?
|
| 291 |
+
- Why does the *magnitude* of the improvement differ so much by hardware (β0.081 on 3060,
|
| 292 |
+
β0.052 on A10) when the direction does not?
|
| 293 |
+
|
| 294 |
+
## Attribution
|
| 295 |
+
|
| 296 |
+
Derived from [nanoGPT](https://github.com/karpathy/nanoGPT) by Andrej Karpathy (MIT).
|
| 297 |
+
`code/model_canon_HEAD.py` and `code/model_wslbridge.py` contain substantial portions of
|
| 298 |
+
the upstream source. See `LICENSE`.
|
code/model_cheap_qa_minimal.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
Minimal single-variant GPT β cheap_qa champion ONLY.
|
| 3 |
|
| 4 |
-
Distilled from the 19-variant
|
| 5 |
removed; the ONLY conditioning path is the cheap_qa gate:
|
| 6 |
|
| 7 |
cheap_qa == qv_variant "dynamic_qa_conditioned"
|
|
@@ -11,7 +11,7 @@ removed; the ONLY conditioning path is the cheap_qa gate:
|
|
| 11 |
Champion result (NanoGPT 124M, OpenWebText, 10k iters, seeds 42/1337/123):
|
| 12 |
baseline 4.4708 -> cheap_qa 4.3897 (-0.0811 CE, -1.81%), 98,304 params (+0.079%).
|
| 13 |
|
| 14 |
-
>>> THE G1 SEAM IS MARKED BELOW
|
| 15 |
That block is the entire port surface. Resize the gate for a different attention
|
| 16 |
by changing head_dim (hs); the gate is always Linear(2*hs -> hs) on cat(q, y).
|
| 17 |
"""
|
|
|
|
| 1 |
"""
|
| 2 |
Minimal single-variant GPT β cheap_qa champion ONLY.
|
| 3 |
|
| 4 |
+
Distilled from the 19-variant code/model_canon_HEAD.py in this repo. Every other gate branch has been
|
| 5 |
removed; the ONLY conditioning path is the cheap_qa gate:
|
| 6 |
|
| 7 |
cheap_qa == qv_variant "dynamic_qa_conditioned"
|
|
|
|
| 11 |
Champion result (NanoGPT 124M, OpenWebText, 10k iters, seeds 42/1337/123):
|
| 12 |
baseline 4.4708 -> cheap_qa 4.3897 (-0.0811 CE, -1.81%), 98,304 params (+0.079%).
|
| 13 |
|
| 14 |
+
>>> THE G1 SEAM IS MARKED BELOW BY A "G1 SEAM" BANNER COMMENT.
|
| 15 |
That block is the entire port surface. Resize the gate for a different attention
|
| 16 |
by changing head_dim (hs); the gate is always Linear(2*hs -> hs) on cat(q, y).
|
| 17 |
"""
|