Commit 9c4c158
Phase 4: gate reformulation falsified across both follow-on archs
Two architectures proposed in distractor_mix_README.md as paths to
make the HBit-tension attention gate earn its keep — both tested,
both falsified at distractor_frac=0.20:
arch mean std wins vs crt_only
crt_only 2.4595 0.0257 —
hybrid_score 2.5488 0.0239 0/3 (+3.6%)
hybrid_learned 2.5607 0.0179 0/3 (+4.1%)
Combined with the original falsified key-gate (0/3, +3.2%), this is
THREE different gate formulations all losing to crt_only by the
same ~3-4% magnitude.
Interpretation (full writeup in GATE_REFORMULATION_RESULTS.md):
substrate-distance signal on (q@k^T / sqrt(d)) just doesn't
correlate with what the attention should focus on. The Fibonacci
attractor structure of OMC's HInt doesn't transfer to attention
score tensors which have totally different distributional
properties (Gaussian-ish, scaled, drawn from learned projections).
The learned-threshold variant is the stronger negative: the model
could simply learn gate_w≈0 to disable the gate. It did not. It
converged to a setting that costs ~4% on val loss.
Architectural verdict consolidated:
- Substrate as positional encoding (CRT-PE): WINS (-5.4%, -2.9%)
- Substrate as OOD signal (HBit cross-cutting): WINS (AUROC 1.0)
- Substrate as attention modulator: FALSIFIED 3×
(key, score, learned)
Recommended pivot: stop investing in attention-gate variants.
The next-most-promising substrate role is at the tokenizer /
embedding layer (using OMC's substrate-routed tokenizer as the
LM's input tokenizer), which is architecturally unmeasured and
has stronger theoretical grounding than another attention-layer
attempt.
Implementation:
- models.py: Attention now takes gate_mode ∈ {none, key, score, learned}
- hybrid_score: log_gate added to scores pre-mask, pre-softmax
- hybrid_learned: per-block scalar W, b learnable; init W=-1, b=0
so initial gate ≈ original 1/(1+d), then trains from loss signal
- train_gate_reformulation.py: focused 3-arch comparison vs crt_only
Per-seed wall-clock ~10 min, total ~30 min on CPU.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 5e054b2 commit 9c4c158
5 files changed
Lines changed: 455 additions & 38 deletions
File tree
- experiments/transformerless_lm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
Lines changed: 152 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
| 130 | + | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
127 | | - | |
| 135 | + | |
128 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
129 | 143 | | |
130 | 144 | | |
131 | | - | |
132 | 145 | | |
133 | 146 | | |
134 | | - | |
| 147 | + | |
135 | 148 | | |
136 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
137 | 161 | | |
138 | 162 | | |
139 | 163 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
146 | 173 | | |
147 | | - | |
148 | 174 | | |
149 | 175 | | |
150 | 176 | | |
151 | 177 | | |
152 | | - | |
| 178 | + | |
153 | 179 | | |
154 | 180 | | |
155 | 181 | | |
| |||
172 | 198 | | |
173 | 199 | | |
174 | 200 | | |
175 | | - | |
| 201 | + | |
176 | 202 | | |
177 | | - | |
| 203 | + | |
178 | 204 | | |
179 | 205 | | |
180 | 206 | | |
| |||
186 | 212 | | |
187 | 213 | | |
188 | 214 | | |
189 | | - | |
190 | | - | |
| 215 | + | |
191 | 216 | | |
192 | 217 | | |
193 | 218 | | |
| |||
196 | 221 | | |
197 | 222 | | |
198 | 223 | | |
199 | | - | |
| 224 | + | |
200 | 225 | | |
201 | 226 | | |
202 | 227 | | |
| |||
207 | 232 | | |
208 | 233 | | |
209 | 234 | | |
210 | | - | |
| 235 | + | |
211 | 236 | | |
212 | | - | |
| 237 | + | |
213 | 238 | | |
214 | 239 | | |
215 | 240 | | |
216 | | - | |
217 | 241 | | |
218 | | - | |
219 | 242 | | |
220 | 243 | | |
221 | 244 | | |
222 | 245 | | |
223 | | - | |
224 | 246 | | |
225 | 247 | | |
226 | 248 | | |
227 | 249 | | |
228 | 250 | | |
229 | 251 | | |
230 | | - | |
| 252 | + | |
231 | 253 | | |
232 | 254 | | |
233 | 255 | | |
| |||
237 | 259 | | |
238 | 260 | | |
239 | 261 | | |
240 | | - | |
241 | | - | |
242 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
243 | 269 | | |
244 | 270 | | |
245 | 271 | | |
246 | 272 | | |
247 | 273 | | |
248 | 274 | | |
249 | 275 | | |
250 | | - | |
| 276 | + | |
251 | 277 | | |
252 | | - | |
| 278 | + | |
253 | 279 | | |
254 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
255 | 285 | | |
0 commit comments