Overview

Phi-4 is a 14-billion-parameter dense language model from Microsoft Research, released on December 12, 2024 under the MIT license. It continues Microsoft’s Phi series, which aims to show that careful data curation, especially synthetic “textbook-like” data, can let small models rival much larger ones on reasoning tasks.

How it was built

Microsoft’s model card describes Phi-4 as a dense decoder-only transformer trained on 9.8 trillion tokens over 21 days on 1,920 H100-80G GPUs. The training mix extends the data used for Phi-3: publicly available documents filtered for quality, newly created synthetic data for math, coding and common-sense reasoning, acquired academic books and Q&A datasets, and chat-format supervised data. Multilingual data is about 8% of the total, and the public-data cutoff is June 2024. Safety post-training combined supervised fine-tuning with iterative direct preference optimization (DPO).

Highlights

  • 14 billion parameters, text input best suited to chat-format prompts
  • 16K-token context window
  • MIT license permitting commercial use
  • Strong math and science reasoning for its size
  • Runs on a single GPU or, quantized, on high-end laptops

Reported benchmark results

On OpenAI’s simple-evals harness, Microsoft reports 84.8 on MMLU, 56.1 on GPQA, 80.4 on MATH, 80.6 on MGSM and 82.6 on HumanEval. On GPQA and MATH those scores were higher than the GPT-4o figures in the same table. The weak spot is factual recall: Phi-4 scores 3.0 on SimpleQA, compared with 39.4 for GPT-4o, which reflects how little world knowledge a 14B model trained mainly for reasoning retains.

Typical uses

Low-cost and on-device deployments, math and reasoning-heavy tasks on a tight budget, building blocks for retrieval systems where facts come from documents, and research on data-efficient training.

Things to consider

  • The 16K context window is short compared with newer models.
  • Primarily English; Microsoft says other languages perform worse.
  • Weak at factual questions without retrieval, so pair it with search or a document store.
  • Later Phi-4 variants, including mini and reasoning versions, target other trade-offs; compare them before choosing.

Our guide to quantization explains why the 4-bit download is about 9 GB, and llama.cpp and Ollama both run it locally.

Specifications are taken from Microsoft’s model card on Hugging Face, the Phi-4 technical report and the Ollama library. Benchmark results depend on evaluation settings; see how AI benchmarks work.