tekkmaven commited on
Commit
756b84c
Β·
verified Β·
1 Parent(s): 006463f

Upload SCALING_GUIDE.md

Browse files
Files changed (1) hide show
  1. SCALING_GUIDE.md +88 -0
SCALING_GUIDE.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Flint-1.2B: Scaling Strategy Guide
2
+ # Deciding how to spend your TPU hours
3
+
4
+ ## Decision Matrix
5
+
6
+ | TPU Hours | Strategy | Config | Tokens | Key Focus |
7
+ |-----------|----------|--------|--------|-----------|
8
+ | **17h** | 3-stage TAP | `flint_17h.yaml` | ~6.5B | Foundation + early reasoning |
9
+ | **40h** | 4-stage TAP | `flint_40h.yaml` | ~15B | Balanced reasoning + agency |
10
+ | **60h** | 5-stage TAP | `flint_60h.yaml` | ~23B | Deep capability crystallization |
11
+ | **100h+** | 6-stage + context ext | `flint_100h.yaml` | ~40B | Full + 8K context |
12
+
13
+ ## What Each Extra Hour Buys You
14
+
15
+ ### 17h β†’ 40h (+23h)
16
+ - **+8.5B tokens** (2.3Γ— total)
17
+ - Adds dedicated "Polish" stage for balanced skill refinement
18
+ - Full Orca-AgentInstruct (1M examples vs subset)
19
+ - FineMath-3plus gets proper multi-epoch exposure
20
+ - **Expected gain: +5-8 MMLU, +8-12 GSM8K**
21
+
22
+ ### 40h β†’ 60h (+20h)
23
+ - **+8B tokens** (1.5Γ— over 40h)
24
+ - Adds dedicated "Agency" stage focused on tool mastery
25
+ - 5th "Crystal" annealing stage with premium data only
26
+ - Multi-language code (10+ languages vs 5)
27
+ - **Expected gain: +3-5 MMLU, +5-8 GSM8K, +10-15 tool-use**
28
+
29
+ ### 60h β†’ 100h+ (+40h)
30
+ - **+17B tokens** (1.7Γ— over 60h)
31
+ - Context extension to 8K (final 10h)
32
+ - arXiv + Wikipedia for factual grounding
33
+ - Maximum overtraining β†’ near Chinchilla-optimal
34
+ - **Expected gain: +3-5 MMLU, +3-5 GSM8K, 8K context**
35
+
36
+ ## Scaling Principles (from literature)
37
+
38
+ 1. **Overtraining works reliably** (arxiv:2403.08540)
39
+ - Performance scales predictably up to 640Γ— tokens/param
40
+ - Diminishing returns but never negative
41
+
42
+ 2. **Data repetition is safe up to ~4 epochs** (Muennighoff et al.)
43
+ - OpenThoughts-114k can be repeated 5Γ— safely
44
+ - Large web data (FineWeb-Edu, DCLM) should not repeat
45
+
46
+ 3. **Quality annealing gives outsized returns** (SmolLM2, OLMo-2)
47
+ - Final 10-15% of training with best data = biggest benchmark jumps
48
+ - FineMath-4+ and hard reasoning problems during LR decay
49
+
50
+ 4. **Inference-optimal training favors overtraining** (arxiv:2401.00448)
51
+ - For deployment (inference cost matters): train smaller model longer
52
+ - 1.2B Γ— 23B tokens beats 1.7B Γ— 16B tokens for inference efficiency
53
+
54
+ 5. **Muon gives ~2Γ— sample efficiency** (arxiv:2502.16982)
55
+ - Your 23B tokens with Muon β‰ˆ 46B tokens with AdamW
56
+ - Stacks with quality data β†’ multiplicative gains
57
+
58
+ ## Multi-Session Management
59
+
60
+ For runs spanning multiple Kaggle sessions:
61
+
62
+ ```bash
63
+ # Session 1: Start training
64
+ python train_flint.py --config configs/flint_60h.yaml
65
+
66
+ # Session 2: Auto-resumes from latest checkpoint
67
+ python train_flint.py --config configs/flint_60h.yaml --resume
68
+
69
+ # Resume from specific step (if latest is corrupted)
70
+ python train_flint.py --config configs/flint_60h.yaml --resume --checkpoint_step 5000
71
+
72
+ # List available checkpoints
73
+ python train_flint.py --config configs/flint_60h.yaml --list_checkpoints
74
+ ```
75
+
76
+ ## Post-Training (after pretraining is complete)
77
+
78
+ ### Recommended sequence:
79
+ 1. **SFT** (2-4h): SmolTalk full dataset
80
+ 2. **GRPO** (4-8h): Math/code with verifiable rewards (DeepSeek-R1 recipe)
81
+ 3. **Tool DPO** (2-4h): Correct vs incorrect tool-call pairs
82
+ 4. **Quantization**: INT4 AWQ for edge deployment
83
+
84
+ ### If you have unlimited compute:
85
+ - Scale to 1.7B with same TAP curriculum
86
+ - Add GRPO phase during pretraining (online RL, DeepSeek-R1-Zero style)
87
+ - Multi-epoch training with data decontamination between epochs
88
+ - Progressive context extension: 2K β†’ 4K β†’ 8K β†’ 16K