Data Schedules and Learning Rate Schedules Should Be Designed Together
Organizations: Tsinghua University · Peng Cheng Laboratory
Abstract
Mid-training (MT) is a training phase in LLM training pipelines that continues pretraining (PT) on smaller datasets of higher value. Taking the PT and MT phases as a whole, training usually starts with only PT data and then transitions completely to MT data. In this work, we view this complete transition from PT to MT data as a special case of a broader class of data mixing schedules that specify how the proportions of PT and MT tokens in each batch change over training. Under fixed total training compute and MT token budgets, we ask: Is this complete transition to MT data optimal for minimizing final MT loss? We show that the answer depends on the learning rate (LR) schedule: one data schedule may outperform another under one LR schedule, but changing only the LR schedule can reverse the outcome. Specifically, when the LR decays throughout continued training, introducing MT data earlier and mixing it with PT data lowers the final MT loss compared with placing all MT data at the end of training, but this result is reversed if we use constant LR. We therefore study how to jointly choose when to introduce MT data and when to decay the LR through ablation studies, and find that it is better to decay the LR only after MT data enters training. Finally, we develop a theoretical model that explains why the optimal data schedule for a fixed MT token budget depends on the LR schedule.
Figures & tables
Appendix figures & tables41 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Architecture | |
| Reference architecture | Qwen2.5-0.5B |
| Total parameters | 630M |
| Transformer layers | 24 |
| Hidden size | 896 |
| Attention heads (query / KV) | 14 / 2 |
| Hyperparameter | Value |
|---|---|
| Architecture | |
| Reference architecture | OLMoE |
| Total parameters | 2.99B |
| Active non-embedding parameters | 454M |
| Input/output embedding parameters | 155M combined |
| Transformer layers | 12 |
| MT budget | TS final MT ratios (%) | ZL final MT ratios (%) |
|---|---|---|
| 10% | 10, 20, 40, 80, 100 | 20, 40, 60, 80, 100 |
| 25% | 25, 40, 50, 70, 75, 85, 100 | 50, 60, 70, 80, 90, 100 |
| 47.75% | 48, 50, 60, 70, 80, 90, 95, 100 | 95.5, 97, 98, 99, 100 |
| MT budget | Data schedule | Const | FDR | MDR |
|---|---|---|---|---|
| 10% | TS | 1.5420 (100) | 1.6108 (20) | 1.5394 (100) |
| ZL | 1.5485 (100) | 1.6144 (20) | 1.5682 (100) | |
| 25% | TS | 1.4717 (100) | 1.5024 (40) | 1.4475 (100) |
| ZL | 1.4810 (100) | 1.5064 (50) | 1.4802 (100) | |
| 47.75% | TS | 1.4217 (100) | 1.4194 (70) | 1.3826 (100) |
| ZL | 1.4335 (100) | 1.4246 (97) | 1.4221 (100) |
| MT budget | Const | FDR | MDR |
|---|---|---|---|
| 10% | |||
| 25% | |||
| 47.75% |
| MT budget | Schedule | MT window (steps) | Additional relative LR decay durations (%) | |
| Dense: 200B-token PT; 20.97B-token continuation; FineMath | ||||
| 10% | TS | 100% | 1,000 | 20, 40, 50, 80, 120 |
| TS | 80% | 1,250 | 20, 40, 80, 90, 110, 120 | |
| ZL | 100% | 2,000 | 5, 10, 20, 40, 80, 90, 110, 120 | |
| 25% | TS | 100% | 2,500 | 20, 40, 80, 120 |
| ZL | 100% | 5,000 | 5, 10, 20, 40, 80 | |
| MT budget | Schedule, | Best relative LR decay duration | Best loss | Const | MDR | Gain over MDR |
|---|---|---|---|---|---|---|
| Dense: 200B-token PT; 20.97B-token continuation; FineMath | ||||||
| 10% | TS, 100% | 40% | 1.5156 | 1.5420 | 1.5394 | 0.0238 |
| TS, 80% | 40% | 1.5215 | 1.5529 | 1.5454 | 0.0239 | |
| ZL, 100% | 20% | 1.5203 | 1.5485 | 1.5682 | 0.0479 | |
| 25% | TS, 100% | 40% | 1.4275 | 1.4717 | 1.4475 | 0.0200 |
| ZL, 100% | 20% | 1.4392 | 1.4810 | 1.4802 | 0.0410 | |
| MoE: 10B continuation tokens 47.75% MT | MoE: 4B continuation tokens 25% MT, TS | |||
| Relative LR decay duration or rule | TS | ZL | PT 20B | PT 30B |
| Const (0%) | 1.4292 | 1.4424 | 1.6666 | 1.6409 |
| 5% | 1.4091 | 1.4131 | — | — |
| 10% | 1.4046 | 1.4110 | — | — |
| 20% | 1.4007 | 1.4137 | 1.6562 | 1.6260 |
| 40% | 1.4040 | 1.4268 | 1.6578 | 1.6303 |
| MT budget | Relative LR decay duration or rule | Primary | Repeat 1 | Repeat 2 | ||
|---|---|---|---|---|---|---|
| Dense: 200B-token PT; 20.97B-token continuation | ||||||
| 10% | 80% | 20% | 1.5227 | 1.5213 | 1.5212 | 0.000706 |
| 47.75% | 100% | MDR | 1.3826 | 1.3828 | 1.3830 | 0.000149 |
| 47.75% | 70% | FDR | 1.4194 | 1.4217 | 1.4198 | 0.001008 |
| 47.75% | 80% | 40% | 1.3831 | 1.3834 | 1.3846 | 0.000620 |
| MoE: 40B-token PT; 4B-token continuation | ||||||
| Data schedule | Final MT ratio | First MT step 4B-token continuation | First MT step 10B-token continuation |
|---|---|---|---|
| TS | 100% | 716 | 1,788 |
| 75% | 636 | 1,589 | |
| 50% | 477 | 1,192 | |
| 40% | 358 | 894 | |
| 25% | 0 | 0 | |
| ZL | 100% | 477 | 1,192 |
| Continuation tokens | Data schedule | Const | FDR | MDR |
|---|---|---|---|---|
| 4B | TS | 1.6176 (100) | 1.6349 (25) | 1.6343 (50) |
| ZL | 1.6131 (100) | 1.6548 (50) | 1.6548 (50) | |
| 10B | TS | 1.5110 (100) | 1.5343 (25) | 1.5225 (100) |
| ZL | 1.5101 (100) | 1.5548 (50) | 1.5508 (100) |
| Continuation tokens and LR rule | |||
|---|---|---|---|
| 4B Const | |||
| 4B FDR | |||
| 4B MDR | |||
| 10B Const | |||
| 10B FDR | |||
| 10B MDR |
| Checkpoint (step) | DCLM imbalance | FineMath imbalance |
|---|---|---|
| 1,750 (before switch) | 1.005 | 1.216 |
| 2,250 (462 steps after switch) | 1.029 | 1.006 |
| 2,384 (final) | 1.043 | 1.015 |
| Schedule | Final imbalance FineMath / DCLM | Net routing change FineMath TV | Regression residual std. | Rank retention Spearman |
|---|---|---|---|---|
| TS+Const | 1.015 / 1.043 | 0.156 | 0.119 | 0.30 |
| ZL+MDR | 1.008 / 1.039 | 0.140 | 0.042 | 0.74 |
LLM Training
Large language model training studies the data, objectives, optimizers, and systems used to build and adapt language models.
See all 344 papers