arXiv(opens in a new tab)cs.CLDec 2024Cited by 82 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:2412.08905

Phi-4 Technical Report

Marah Abdin, Jyoti Aneja, Harkirat Behl, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, Michael Harrison, Russell J. Hewett, Mojan Javaheripi, Piero Kauffmann, James R. Lee, Yin Tat Lee, Yuanzhi Li, Weishung Liu, Caio C. T. Mendes, Anh Nguyen, Eric Price, Gustavo de Rosa, Olli Saarikivi, Adil Salim, Shital Shah, Xin Wang, Rachel Ward, Yue Wu, Dingli Yu, Cyril Zhang, Yi Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Marah Abdin

Ronen Eldan

Mojan Javaheripi

Yuanzhi Li

Eric Price

Shital Shah

Dingli Yu

Jyoti Aneja

Suriya Gunasekar

Piero Kauffmann

Weishung Liu

Gustavo de Rosa

Xin Wang

Cyril Zhang

Harkirat Behl

Michael Harrison

James R. Lee

Caio C. T. Mendes

Olli Saarikivi

Rachel Ward

Yi Zhang

Sébastien Bubeck

Russell J. Hewett

Yin Tat Lee

Anh Nguyen

Adil Salim

Yue Wu

Microsoft Research

Abstract

We present phi-4, a 14-billion parameter language model developed with a training recipe that is centrally focused on data quality. Unlike most language models, where pre-training is based primarily on organic data sources such as web content or code, phi-4 strategically incorporates synthetic data throughout the training process. While previous models in the Phi family largely distill the capabilities of a teacher model (specifically GPT-4), phi-4 substantially surpasses its teacher model on STEM-focused QA capabilities, giving evidence that our data-generation and post-training techniques go beyond distillation. Despite minimal changes to the phi-3 architecture, phi-4 achieves strong performance relative to its size – especially on reasoning-focused benchmarks – due to improved data, training curriculum, and innovations in the post-training scheme.

1 Introduction

Recent advancements in Large Language Models (LLMs) have shown that significant improvements in data quality can rival, and sometimes surpass, the performance gains traditionally achieved by scaling compute with model and dataset size. Building on the success of the Phi family [GZA+23,LBE+23,JBA+23,AAA+24][GZA^{+}23, LBE^{+}23, JBA^{+}23, AAA^{+}24], we introduce phi-4, a 14-billion parameter model that further advances performance of small language models by introducing innovative synthetic data generation methods for reasoning-focused tasks, by optimizing the training curriculum and data mixture, and by introducing new techniques in post-training.

Synthetic data constitutes the bulk of the training data for phi-4 and is generated using a diverse array of techniques, including multi-agent prompting, self-revision workflows, and instruction reversal. These methods enable the construction of datasets that induce stronger reasoning and problem-solving abilities in the model, addressing some of the weaknesses in traditional unsupervised datasets. Synthetic data in phi-4 also plays a crucial role in post-training, where techniques such as rejection sampling and a novel approach to Direct Preference Optimization (DPO) are employed to refine the model's outputs.

The development of phi-4 is guided by three core pillars:

  1. Synthetic Data for Pretraining and Midtraining: High-quality synthetic datasets are designed to prioritize reasoning and problem-solving, carefully generated to ensure diversity and
Small modelsLarge models
phi-414bphi-314bQwen 2.514b instructGPT4o-miniLlama-3.370b instructQwen 2.572b instructGPT4o
simple-evalsMMLU84.877.979.981.886.385.388.1
GPQA56.131.242.940.949.149.050.6
MATH80.444.675.673.066.3166.3^180.074.6
HumanEval82.667.872.186.278.9178.9^180.490.6
MGSM80.653.579.686.589.187.390.4
SimpleQA3.07.65.49.920.910.239.4
DROP75.568.385.579.390.276.780.9
MMLUPro70.451.363.263.464.469.673.0
HumanEval+82.869.279.182.077.978.488.0
ArenaHard75.445.870.276.265.578.475.6
LiveBench47.628.146.648.157.655.357.6
IFEval63.057.978.780.089.385.084.8
PhiBench (internal)56.243.949.858.757.164.672.4

Table 1: Performance of phi-4 on a set of standard benchmarks. The first set of benchmarks uses OpenAI's SIMPLE-EVALS framework [Ope24b], specifying the prompts/extraction/temperature=0.5. We compare to small models of similar inference cost, as well as to larger models.

relevance. We change our training curriculum and create new pretraining and midtraining data mixtures to increase the allocation of synthetic tokens, compared to older generations of phi.

  1. Curation and Filtering of High-Quality Organic Data: We meticulously curate and filter organic2^{2} data sources, including web content, licensed books, and code repositories to extract seeds for the synthetic data pipeline that encourage high-depth reasoning and prioritize educational value (to the model). These seeds form the foundation of the synthetic generation pipeline. To complement these synthetic datasets, we also filter the web for high-quality data (in terms of knowledge and reasoning) to use directly in pretraining.

  2. Post-Training: We further advance the post-training recipe in phi-4 by creating new refined versions of SFT datasets, as well as by developing a new technique to create DPO pairs, based on pivotal token search.

With these innovations, the performance of phi-4 on reasoning-related tasks is comparable to or surpasses much larger models. For example, its performance on many widely used reasoning-related benchmarks meets or exceeds that of Llama-3.1-405B. In Table 1 we compare the performance of our model on academic benchmarks to several contemporary foundation models. We find that phi-4 significantly exceeds its teacher GPT-4o on the GPQA (graduate-level STEM Q&A) and MATH (math competition) benchmarks.

1^{1}These scores are lower than those reported by Meta, perhaps because SIMPLE-EVALS has a strict formatting requirement that Llama models have particular trouble following. We use the SIMPLE-EVALS framework because it is reproducible, but Meta reports 77 for MATH and 88 for HumanEval on Llama-3.3.

2^{2}We use organic to refer to human-generated or otherwise non-synthetic data.

Average performance on November 2024 AMC 10/12 tests

Figure

Figure 1: Average performance of different models on the November 2024 AMC-10 and AMC-12 tests. This is the average score (with maximum score 150) over the four tests on 100 runs with temperature t=0.5t = 0.5. We chose t=0.5t = 0.5 to follow SIMPLE-EVALS [Ope24b]. Error bars are 2σ2\sigma of the estimate. On competition math, phi-4 scores well above its weight-class even compared to non-open-weight models.

References (3)

  • This step may also include an optional curation of a participant's profile that guides the tone and style of dialogue throughout the generation
  • - A larger disk cannot be placed on a smaller disk
  • - Certainty: Known

Cited by (82)