m1b commited on
Commit
9884b42
Β·
verified Β·
1 Parent(s): 0ec7495

Upload REVISED_APPROACH.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. REVISED_APPROACH.md +127 -0
REVISED_APPROACH.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Revised SOTA Approach for Parameter Golf
2
+
3
+ ## Why the Original MTP Approach Was Wrong
4
+
5
+ Multi-Token Prediction (Meta FAIR, 2404.19737) is **not effective at small model scales**:
6
+ - Paper's own Table 1: gains appear only at 300M+ parameters
7
+ - Follow-up paper (2505.22757) explicitly shows MTP with subword tokenization fails for SLMs
8
+ - At 8M parameters, MTP adds compute overhead without meaningful sample efficiency gains
9
+ - The only exception: byte-level tokenization with reverse curriculum β€” but we use SP8192
10
+
11
+ ## Revised Technique Stack (ordered by expected impact)
12
+
13
+ ### 1. QAT-Fused Cooldown (Replace GPTQ Post-Hoc) β˜…β˜…β˜…β˜…β˜…
14
+ **Paper**: Compute-Optimal QAT (2509.22935, Sep 2025)
15
+
16
+ **Current SOTA**: Trains in FP16/BF16 β†’ GPTQ quantization after training ends
17
+ **Novel**: Start INT6 QAT (Straight-Through Estimator) during the LR warmdown phase
18
+
19
+ **Why this works at 8M scale**:
20
+ - Model is 225Γ— overtrained relative to Chinchilla (36B tokens / 8M params)
21
+ - More training tokens = more accumulated quantization error for post-hoc GPTQ
22
+ - QAT during warmdown lets the optimizer **actively adapt weights** to quantization noise
23
+ - The paper shows QAT-cooldown fusion consistently improves over separate phases at 4-6 bit
24
+ - Zero extra artifact cost β€” same INT6 weights, just better quality
25
+
26
+ **Implementation**:
27
+ ```python
28
+ # At training fraction >= 0.65 (during warmdown), enable fake quantization
29
+ if frac >= 0.65:
30
+ for name, param in model.named_parameters():
31
+ if param.ndim == 2 and param.numel() > 65536:
32
+ # Symmetric per-row INT6 fake quantization
33
+ scale = param.abs().amax(dim=1, keepdim=True) / 31 # 2^5 - 1
34
+ param.data = (param / scale).round().clamp(-31, 31) * scale
35
+ ```
36
+
37
+ **Expected gain**: -0.003 to -0.008 BPB (better quantization quality)
38
+
39
+ ### 2. INT4 Mixed Precision β†’ Pack More Parameters β˜…β˜…β˜…β˜…β˜…
40
+ **Current**: INT6 matrices (6 bits) + INT8 embeddings β†’ ~15.99 MB
41
+ **Novel**: INT4 for MLP weights (highest redundancy) + INT6 for attention + INT8 embeddings
42
+
43
+ **Why this works**:
44
+ - MLP weights are 4Γ— expansion = largest matrices, most redundant
45
+ - At INT4: MLP weights use 33% less space than INT6
46
+ - Freed budget (~1-2 MB) can be used for: wider model, more layers, or bigger embeddings
47
+ - With QAT-fused cooldown, INT4 quality is much better than post-hoc INT4
48
+
49
+ **Parameter budget (INT4 MLP + INT6 attn + INT8 embed)**:
50
+ ```
51
+ Current 11L Γ— 512d (INT6 uniform):
52
+ MLP: 11 Γ— (512Γ—2048 + 2048Γ—512) Γ— 6/8 = ~8.6 MB
53
+ Attn: 11 Γ— (512Γ—512Γ—4) Γ— 6/8 = ~5.1 MB
54
+ Embed: 8192Γ—512 Γ— 1 = ~4.2 MB
55
+ Total: ~17.9 MB β†’ compressed to ~15.99 MB
56
+
57
+ With INT4 MLP:
58
+ MLP: 11 Γ— (512Γ—2048 + 2048Γ—512) Γ— 4/8 = ~5.7 MB (saves ~2.9 MB)
59
+ Attn: 11 Γ— (512Γ—512Γ—4) Γ— 6/8 = ~5.1 MB
60
+ Embed: 8192Γ—512 Γ— 1 = ~4.2 MB
61
+ Total: ~15.0 MB β†’ room for 12 layers or 576-dim model
62
+ ```
63
+
64
+ **Expected gain**: -0.005 to -0.015 BPB (more model capacity)
65
+
66
+ ### 3. NuMuon Optimizer (Nuclear-Norm Constrained Muon) β˜…β˜…β˜…β˜…
67
+ **Paper**: NuMuon (2603.03597, Mar 2025)
68
+
69
+ **What it does**: Adds a nuclear-norm penalty to Muon that forces weights into low-rank structure during training. This makes post-training quantization/compression dramatically more effective.
70
+
71
+ **Results**: On Llama-1.8B with FineWeb-Edu:
72
+ - 40% SVD compression: NuMuon retains 97% quality vs 91% for Muon
73
+ - 80% compression: NuMuon retains 89% vs 73% for Muon
74
+ - The low-rank weight structure is **free at inference** β€” just better weight matrices
75
+
76
+ **Why it helps Parameter Golf**:
77
+ - Current GPTQ with Brotli-11 compression benefits from low-entropy weight distributions
78
+ - NuMuon-trained weights have lower effective rank β†’ lower entropy β†’ better compression
79
+ - Even at 18% slower per step, the compression gains are worth it
80
+
81
+ **Trade-off**: ~18% fewer training steps (3700 vs 4500). But each step produces weights that compress 20-40% better.
82
+
83
+ **Expected gain**: -0.002 to -0.005 BPB (better compression ratio β†’ more effective params)
84
+
85
+ ### 4. Wider Model with Depth Recurrence β˜…β˜…β˜…
86
+ **Current**: 11 physical layers Γ— 512d, loop 3 layers β†’ 17 virtual layers
87
+ **Novel**: Reduce to 9 physical layers Γ— 576d, loop 3 layers β†’ 15 virtual layers
88
+
89
+ **Why**: At extreme depth recurrence, width > depth for the stored parameters. A wider model captures more features per layer, and the recurrence provides depth. 576d Γ— 9L has similar param count to 512d Γ— 11L but each layer is more expressive.
90
+
91
+ **Expected gain**: -0.001 to -0.003 BPB
92
+
93
+ ### 5. Progressive Depth Recurrence During QAT β˜…β˜…β˜…
94
+ **Current**: Looping enabled at frac=0.35, fixed thereafter
95
+ **Novel**: Start with 1 loop, progressively increase to 3 loops during training
96
+
97
+ At QAT-cooldown fusion time, the model has adapted to 3-loop depth. This means the quantized model's recurrent behavior is well-trained.
98
+
99
+ **Expected gain**: -0.001 to -0.002 BPB
100
+
101
+ ## What NOT to Do at 8M Scale
102
+
103
+ | Technique | Why Skip |
104
+ |-----------|----------|
105
+ | Multi-Token Prediction | Gains only at 300M+; proven ineffective for SLMs |
106
+ | BitNet 1.58-bit | Needs 2Γ— hidden dim to match FP16; net zero at 16MB |
107
+ | Knowledge Distillation | 10-min constraint too tight for online distillation |
108
+ | SOAP optimizer | Muon dominates at large batch sizes |
109
+ | Byte-level tokenization | Too many tokens per document; SP8192 is better |
110
+
111
+ ## Combined Expected Improvement
112
+
113
+ | Technique | Expected Ξ” BPB |
114
+ |-----------|---------------|
115
+ | QAT-Fused Cooldown | -0.003 to -0.008 |
116
+ | INT4 MLP Mixed Precision | -0.005 to -0.015 |
117
+ | NuMuon Optimizer | -0.002 to -0.005 |
118
+ | Wider model (576d) | -0.001 to -0.003 |
119
+ | Progressive recurrence | -0.001 to -0.002 |
120
+ | **Total** | **-0.012 to -0.033** |
121
+
122
+ **Conservative target**: 1.0810 - 0.012 = **1.069 BPB**
123
+ **Optimistic target**: 1.0810 - 0.033 = **1.048 BPB**
124
+
125
+ ## Key Insight
126
+
127
+ The biggest lever is **packing more parameters into 16MB** via better quantization (QAT + INT4). At 8M params, the model is capacity-limited. Going from 8M to 12M params (via INT4 MLP) is like scaling up 50% β€” that's worth ~0.01 BPB on FineWeb scaling curves.