Phi-4 Technical Report
TL;DR. Phi-4 is a 14B decoder model whose pretraining data is mostly synthetic. It uses 50 broad types of synthetic datasets (about 400B unweighted tokens) generated through multi-step prompting from curated seeds, together with filtered web, rewritten web, code and acquired sources. Despite its size, it beats its teacher GPT-4o on GPQA (56.1 vs 50.6) and MATH (80.4 vs 74.6), and does well on the November 2024 AMC tests, which were held after training data was collected.
Key idea
Section titled “Key idea”Use synthetic data as the main pretraining source and repeat it many times. Table 5 of the report gives the mixture for about 10T tokens:
| Source | Share | Unique tokens | Epochs |
|---|---|---|---|
| Web | 15% | 1.3T | 1.2 |
| Web rewrites | 15% | 290B | 5.2 |
| Synthetic | 40% | 290B | 13.8 |
| Code | 20% | 820B | 2.4 |
| Acquired | 10% | 580B | 1.7 |
The architecture follows phi-3-medium, with a tiktoken vocabulary of 100,352 and full attention over a 4K context, extended to 16K in midtraining. Pretraining uses peak LR 3e-4, weight decay 0.1 and global batch 5,760. Post-training adds SFT and two rounds of DPO; the first uses Pivotal Token Search, which builds preference pairs around the single tokens that most change the probability of success.
Results. On simple-evals, phi-4 scores MMLU 84.8, GPQA 56.1 and MATH 80.4 (GPT-4o: 88.1, 50.6, 74.6). The authors say it scores higher on HumanEval than any other open-weight model they compared, including much larger Llama models. In mixture ablations, synthetic-heavy mixtures were marginally better than the final mixture before post-training, but the authors kept web data for knowledge benchmarks, and the gap mostly closed after post-training.
Connections
Section titled “Connections”- Data-constrained scaling — phi-4 repeats synthetic data well beyond the point where repeated web data starts to lose value.
- Knowledge distillation — synthetic pretraining as distillation from a teacher, with a student that partly surpasses it.
- Contamination — n-gram decontamination and fresh tests such as AMC.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
Phi-4 trains on about 10T tokens with mixture weights web 15%, web rewrites 15%, synthetic 40%, code 20%, acquired 10%, and unique token counts of about 1.3T, 290B, 290B, 820B and 580B. Compute the number of epochs over each source and say which source is repeated most and which is close to single-pass.
What a strong answer covers
- Epochs = weight × 10T / unique tokens.
- Synthetic 4T / 290B ≈ 13.8; web rewrites 1.5T / 290B ≈ 5.2; code 2T / 820B ≈ 2.4; acquired 1T / 580B ≈ 1.7; web 1.5T / 1.3T ≈ 1.15 (the report rounds to 1.2).
- Synthetic data is repeated most, far beyond the roughly 4 epochs where data-constrained scaling says repetition starts to lose value for web text.
- Filtered web is close to single-pass, which is where the model gets most of its broad knowledge.
- Mechanism
In phi-4's ablation, models seeing synthetic data for 12 epochs beat models with 4 epochs plus more fresh web tokens on MMLU, yet a 13B model trained only on synthetic data is clearly weaker on TriviaQA. Give a mechanism that explains both results.
What a strong answer covers
- The synthetic data is built for reasoning: structured, step-by-step text that teaches skills which transfer, so repeating it keeps paying off on reasoning benchmarks.
- Facts are spread across a long tail of web documents; a small synthetic set generated from seeds cannot contain them, so repetition cannot add knowledge that is not there.
- This supports a split where synthetic data teaches skills and web data provides coverage, which is why the final mixture keeps 30% web and web rewrites.
- Overfitting is limited because the synthetic set is diverse (50 types of datasets, many seeds) and the model also sees other sources.
- Critique
Phi-4 (14B) scores 56.1 on GPQA and 80.4 on MATH versus 50.6 and 74.6 for its teacher GPT-4o, but 84.8 vs 88.1 on MMLU. Give two reasons to be careful before concluding the student "surpasses" the teacher, and say what evidence in the report helps most.
What a strong answer covers
- Synthetic data built for STEM reasoning can be close to benchmark formats, so a gain in GPQA and MATH can partly reflect fit to the format rather than general ability.
- Benchmark test sets can leak through web data; the report uses a 13-gram hybrid decontamination, but n-gram matching misses paraphrases.
- The gains are narrow: GPT-4o is still higher on MMLU, so "surpasses" holds only for some STEM tasks, not overall.
- The strongest evidence is the November 2024 AMC-10/12 test, which happened after all training data was collected and was measured after all hyperparameters were fixed.