Quazim0t0 commited on
Commit
20422e9
·
verified ·
1 Parent(s): a7e98cc

first person; 5M 2x2 current; paper growing-memory vs zero-init gate

Browse files
Files changed (1) hide show
  1. README.md +51 -34
README.md CHANGED
@@ -43,8 +43,10 @@ It is not on the generate path.
43
  | `checkpoints/base_62k.pt` | pretrained, Dolma-blend, step 62k | lowest PPL. Continues text, does not answer questions. |
44
  | `checkpoints/sft_7100.pt` | SFT on UltraChat, step 7.1k | chat / instruction following. `--chat` |
45
  | `checkpoints/dpo_3200.pt` | DPO on the SFT model, step 3.2k | preference-tuned chat (default). `--chat` |
 
46
 
47
- Same architecture, same loader. Weights and context length differ: SFT was
 
48
  trained at 4096, base and DPO at 1024.
49
 
50
  ## Architecture
@@ -165,13 +167,13 @@ bf16 and training blows up.
165
 
166
  This is not an RNN, so the paper's complexity story does not transfer cleanly.
167
  Cross-segment readout here is O(N²L). It is not a long-context speed trick.
168
- The thing that transferred is a second retrieval path with learned
169
- segment-level routing next to token-level attention, on a 114M model that
170
- does not have much attention to spare. Recall is the usual failure mode at
171
- this size. Zero-init gate means at step 0 the model is identical to the no-MC
172
- baseline; the branch only starts mattering if training uses it. Pretrain
173
- `seq_len` was 1024 = 4 segments, so it sees cross-segment memory from the
174
- start.
175
 
176
  It did get used. DPO 3.2k checkpoint:
177
 
@@ -184,8 +186,10 @@ It did get used. DPO 3.2k checkpoint:
184
 
185
  Gates are open. Knocking the branch out costs ~17% PPL (it was ~9% earlier,
186
  before they opened). That is an inference knock-out on this checkpoint,
187
- not a model trained without MC. The twin in progress also dropped
188
- fractal RoPE, so it is not an MC-only ablation.
 
 
189
 
190
  If you write a loader: this branch is a full-sequence op. It uses the whole
191
  `x` given to `forward`. Naive KV cache feeds it one token, it rebuilds
@@ -259,11 +263,11 @@ What that actually says:
259
  does not extrapolate here; the geometric twin does; fractal
260
  frequencies on the twin also do. Matched 61k still required.
261
 
262
- ### What we can and cannot claim about Memory Cache
263
 
264
  Behrouz et al. 2026 (arXiv:2602.24281) score MC with matched RNN
265
  trains, then Wiki PPL, S-NIAH (passkey / numeric / UUID), in-context
266
- recall vs length, and MQAR. Those are the tests we ran on this 62k
267
  base, **MC on and with `mc_gate` zeroed**.
268
 
269
  They **changed the direction**. The earlier filler/needle story was not
@@ -325,10 +329,14 @@ Past 1024 it falls off faster than std (bin 1024–1280 already 101 vs
325
  std 46). Stretching the window is a win for plain geometric, not for
326
  MC. MQAR is 0/16 on every cell.
327
 
328
- That is a 5.7M / 10k result. It is not a 114M result.
 
 
 
 
329
 
330
- **Why both, if each knob alone is worse.** We do not have a second
331
- seed, so this could still be luck. What we *did* measure:
332
 
333
  - `both` actually uses the branch. Unique PPL 26.67 → 33.93 when
334
  `mc_gate` is zeroed. `mc` alone is 161 → 170 on an already-bad net.
@@ -529,6 +537,7 @@ spike_infer/ engine
529
  engine_tools/ export, GGUF, long-context, multiturn
530
  morpho/ int8 circuit of one block (not used at generate time)
531
  GGUF/ f16 + q8_0 for each stage
 
532
  ```
533
 
534
  ## Limitations
@@ -566,9 +575,11 @@ parts that were the actual work. Leave the chat stages.
566
  Worth copying:
567
 
568
  - The Memory Cache branch as a gated residual next to MLA, zero-init so
569
- it can't hurt at step 0. Ablation is in the architecture section
570
- (~17% PPL). Don't skip the causal running mean on the diagonal gate or
571
- the global normaliser; both were bugs, both destroy the mechanism.
 
 
572
  Builders: see [For other model builders](#for-other-model-builders).
573
  - Looped decode done properly: `loop_count=3` means 48 KV slots, not 16,
574
  and MC state keyed per plan slot. A loader that indexes by layer only
@@ -608,11 +619,16 @@ below). I have not proven it helps at 114M. Paper recall tests on this
608
  62k base are chance with the branch on or off. A matched 5.7M 2×2 on
609
  the current blend says **MC alone did not help PPL or long context**;
610
  **MC+fractal together** was the only cell that beat the nothing-on
611
- baseline at train length. That is 5M / 10k, one seed. Do not promote
612
- it to this 114M card. The paper is about RNNs; this is not an RNN;
613
- the O(L) claim does not transfer.
 
 
 
 
 
614
 
615
- What we actually ran on *this* model, not what I hope it does:
616
 
617
  **Did training use it.** Yes. Mean |tanh(gate)| across layers is 0.599
618
  on the DPO checkpoint. Zeroing the branch at inference (same weights,
@@ -624,7 +640,7 @@ trained without the branch.
624
  256`, so cross-segment memory is in the recipe from step 0. SFT grew
625
  the window to 4096. Most of the stack is position-local. MC is not —
626
  behaviour only changes when a sequence crosses a 256-token boundary.
627
- We widened the config (`export_weights.py --seq-len 16384`, RoPE
628
  caches rebuilt, no retrain of positions) and checked that cached
629
  decode still *is* the trained function:
630
 
@@ -646,17 +662,18 @@ is whether *it* collapses out there. Needle is a different question
646
  (the first needle was the model continuing the start of the prompt;
647
  see that section).
648
 
649
- **What is still missing.** A train that changes only MC, fractal left
650
- on. The twin that is running also dropped fractal RoPE, so it is not
651
- that experiment. It already informs RoPE (native vs swap CE and
652
- position bins on both nets, above). Paper recall tests (S-NIAH, MQAR)
653
- on this 62k base are at chance with MC on or off; they do not prove
654
- MC. If you copy the branch anyway, copy the two bugfixes or you will
655
- not have the mechanism: causal running mean on the diagonal gate, and
656
- one global normaliser (not per-segment). fp32, autocast off. State
657
- keyed per segment *and* per loop pass if you loop. Set `seq_len` to a
658
- multiple of `mc_segment_len` so the branch sees more than one segment
659
- from the first step.
 
660
 
661
  ## Provenance
662
 
 
43
  | `checkpoints/base_62k.pt` | pretrained, Dolma-blend, step 62k | lowest PPL. Continues text, does not answer questions. |
44
  | `checkpoints/sft_7100.pt` | SFT on UltraChat, step 7.1k | chat / instruction following. `--chat` |
45
  | `checkpoints/dpo_3200.pt` | DPO on the SFT model, step 3.2k | preference-tuned chat (default). `--chat` |
46
+ | [`5m-ablation/`](5m-ablation/README.md) | four ~5.7M 10k trains | MC × fractal isolation. Not this 114M model. |
47
 
48
+ Same architecture family, same loader for the 114M stages. The 5M
49
+ nets are a separate, smaller stack. Weights and context length differ: SFT was
50
  trained at 4096, base and DPO at 1024.
51
 
52
  ## Architecture
 
167
 
168
  This is not an RNN, so the paper's complexity story does not transfer cleanly.
169
  Cross-segment readout here is O(N²L). It is not a long-context speed trick.
170
+ The paper's "growing memory" is with **sequence length** (more segments
171
+ more cached states), not with training steps. What grows with training
172
+ **here** is the zero-init mix-in `tanh(mc_gate)`: at step 0 the model is
173
+ the no-MC baseline; the residual only starts mattering if that gate
174
+ opens. On this 114M run it did (knock-out ~9% early → −16.7% at DPO;
175
+ mean |tanh| ~0.60). Pretrain `seq_len` was 1024 = 4 segments, so the
176
+ branch sees cross-segment memory from the first step.
177
 
178
  It did get used. DPO 3.2k checkpoint:
179
 
 
186
 
187
  Gates are open. Knocking the branch out costs ~17% PPL (it was ~9% earlier,
188
  before they opened). That is an inference knock-out on this checkpoint,
189
+ not a model trained without MC. The 114M twin also dropped fractal RoPE,
190
+ so it is not an MC-only ablation. A 5.7M 2×2 that *does* isolate the
191
+ knobs is in [`5m-ablation/`](5m-ablation/README.md). MC alone did not
192
+ help there. MC+fractal together did, at train length, one seed.
193
 
194
  If you write a loader: this branch is a full-sequence op. It uses the whole
195
  `x` given to `forward`. Naive KV cache feeds it one token, it rebuilds
 
263
  does not extrapolate here; the geometric twin does; fractal
264
  frequencies on the twin also do. Matched 61k still required.
265
 
266
+ ### What I can and cannot claim about Memory Cache
267
 
268
  Behrouz et al. 2026 (arXiv:2602.24281) score MC with matched RNN
269
  trains, then Wiki PPL, S-NIAH (passkey / numeric / UUID), in-context
270
+ recall vs length, and MQAR. Those are the tests I ran on this 62k
271
  base, **MC on and with `mc_gate` zeroed**.
272
 
273
  They **changed the direction**. The earlier filler/needle story was not
 
329
  std 46). Stretching the window is a win for plain geometric, not for
330
  MC. MQAR is 0/16 on every cell.
331
 
332
+ That is a 5.7M / 10k result. It is not a 114M result. 10k may also be
333
+ early for the zero-init mix-in: |tanh(gate)| ~0.25 here vs ~0.60 on the
334
+ 114M DPO. The paper's growing memory is with **context length**, not
335
+ steps. Gate-opening over training is this code. A longer 5M run is
336
+ untested. Weights: [`5m-ablation/`](5m-ablation/README.md).
337
 
338
+ **Why both, if each knob alone is worse.** I do not have a second
339
+ seed, so this could still be luck. What I measured:
340
 
341
  - `both` actually uses the branch. Unique PPL 26.67 → 33.93 when
342
  `mc_gate` is zeroed. `mc` alone is 161 → 170 on an already-bad net.
 
537
  engine_tools/ export, GGUF, long-context, multiturn
538
  morpho/ int8 circuit of one block (not used at generate time)
539
  GGUF/ f16 + q8_0 for each stage
540
+ 5m-ablation/ four ~5.7M 10k trains (MC × fractal)
541
  ```
542
 
543
  ## Limitations
 
575
  Worth copying:
576
 
577
  - The Memory Cache branch as a gated residual next to MLA, zero-init so
578
+ it can't hurt at step 0. The ~17% figure in the architecture section
579
+ is an inference knock-out on *this* 114M checkpoint, not a matched
580
+ train. At 5.7M, MC alone did not beat the no-MC cell. Don't skip the
581
+ causal running mean on the diagonal gate or the global normaliser;
582
+ both were bugs, both destroy the mechanism.
583
  Builders: see [For other model builders](#for-other-model-builders).
584
  - Looped decode done properly: `loop_count=3` means 48 KV slots, not 16,
585
  and MC state keyed per plan slot. A loader that indexes by layer only
 
619
  62k base are chance with the branch on or off. A matched 5.7M 2×2 on
620
  the current blend says **MC alone did not help PPL or long context**;
621
  **MC+fractal together** was the only cell that beat the nothing-on
622
+ baseline at train length. That is 5M / 10k, one seed, and |tanh(gate)|
623
+ there is ~0.25 vs ~0.60 on this 114M DPO the mix-in may still be
624
+ opening. The paper does not say "train longer and MC appears"; it says
625
+ memory grows with **how many segments the sequence has**. The
626
+ zero-init gate opening over steps is this implementation. A longer 5M
627
+ run could still move that table. I have not run one. Do not promote
628
+ the 10k result to this 114M card. The paper is about RNNs; this is not
629
+ an RNN; the O(L) claim does not transfer.
630
 
631
+ What I actually ran on *this* model, not what I hope it does:
632
 
633
  **Did training use it.** Yes. Mean |tanh(gate)| across layers is 0.599
634
  on the DPO checkpoint. Zeroing the branch at inference (same weights,
 
640
  256`, so cross-segment memory is in the recipe from step 0. SFT grew
641
  the window to 4096. Most of the stack is position-local. MC is not —
642
  behaviour only changes when a sequence crosses a 256-token boundary.
643
+ I widened the config (`export_weights.py --seq-len 16384`, RoPE
644
  caches rebuilt, no retrain of positions) and checked that cached
645
  decode still *is* the trained function:
646
 
 
662
  (the first needle was the model continuing the start of the prompt;
663
  see that section).
664
 
665
+ **What is still missing at 114M.** A train that changes only MC,
666
+ fractal left on. The nomc twin also dropped fractal RoPE, so it is not
667
+ that experiment. The 5.7M 2×2 *is* that experiment at small scale:
668
+ MC alone did not help; MC+fractal together did, at 1024, one seed.
669
+ Weights and write-up: [`5m-ablation/`](5m-ablation/README.md). Paper
670
+ recall tests (S-NIAH, MQAR) on this 62k base are at chance with MC on
671
+ or off; they do not prove MC. If you copy the branch anyway, copy the
672
+ two bugfixes or you will not have the mechanism: causal running mean
673
+ on the diagonal gate, and one global normaliser (not per-segment).
674
+ fp32, autocast off. State keyed per segment *and* per loop pass if you
675
+ loop. Set `seq_len` to a multiple of `mc_segment_len` so the branch
676
+ sees more than one segment from the first step.
677
 
678
  ## Provenance
679