Skip to content
Phi 4 logo

Microsoft Phi-4: Built From Textbooks, Scoped in Writing

Microsoft AI

Key facts · verified Oct 29, 2026

Phi 4 is a Microsoft AI model released on 12 Dec 2024. Its API price is $0.07 per million input tokens and $0.14 per million output tokens. Its context window is 16.4K tokens. It ranks #323 on LMArena's text leaderboard (Elo 1256, read 2 Nov 2026). Source: huggingface.co.

Phi 4 is a model from Microsoft AI, released in December 2024. It is listed at $0.07 per million input tokens and $0.14 per million output, with a context window of 16.4K tokens. On LMArena's text leaderboard it scores 1256 Elo (rank 323). Its strongest category there is mathematics, at 290th, and its weakest is entertainment and media, at 325th. The weights are available under the MIT licence, so it can be self-hosted. Figures here come from LMArena’s published dataset rather than from the vendor’s own documentation.

Pricing & specs checkedSource: vendor documentation · checked Oct 29, 2026LMArena: 1256 Elo (rank 323) · source · retrieved Nov 2, 2026
Pricing

$0.07 / $0.14 per million tokens

Context

16.4K tokens

LMArena Elo

1256

LMArena rank

#323

What Phi-4 is

Phi-4 is Microsoft's small language model, MIT-licensed, with a 16K token context window and pricing around $0.07 per million input tokens and $0.14 output through third-party providers. The Phi line's distinguishing idea has always been the training data rather than the architecture: Microsoft build these models substantially on newly created synthetic textbook-like data, written for the purpose of teaching mathematics, coding, common-sense reasoning and general knowledge of the world — science, daily activities, theory of mind.

Microsoft state the scope, including what it is not for

Microsoft name three primary cases: memory or compute constrained environments, latency-bound scenarios, and reasoning and logic. They then give an out-of-scope section stating that the model is not specifically designed or evaluated for all downstream purposes, instructing developers to evaluate and mitigate for accuracy, safety and fairness before deployment — particularly in high-risk scenarios — to observe applicable privacy and trade-compliance law, and to note the model's focus on English.

Context window

The context window is 16K tokens.

LMArena

On LMArena's text leaderboard Phi 4 has 1256 Elo (rank 323); by category, 1306 Elo in Coding (rank 310), 1265 Elo in Math (rank 290), 1268 Elo in Expert (rank 293) and 1210 Elo in Creative Writing (rank 322).

Training details

Microsoft's card describes phi-4 as a 14-billion-parameter dense decoder-only Transformer trained on 9.8 trillion tokens over 21 days on 1,920 H100-80G GPUs, between October and November 2024, and released on 12 December 2024. Training data cut off in June 2024 or earlier for publicly available data. The data mix extends Phi-3's: rigorously filtered public documents and educational data, newly created synthetic textbook-like data, acquired academic books and Q&A datasets, and chat-format supervised data; multilingual data is about 8% of the total. Alignment used supervised fine-tuning and iterative direct preference optimisation, and Microsoft's AI Red Team tested it with jailbreaks, encoding-based, multi-turn and adversarial-suffix attacks.

Microsoft’s figures

On OpenAI's simple-evals, Microsoft report MMLU 84.8, GPQA 56.1, MATH 80.4, MGSM 80.6, HumanEval 82.6, DROP 75.5 and SimpleQA 3.0, against Phi-3's 77.9, 31.2, 44.6, 53.5, 67.8, 68.3 and 7.6. The card notes the model is best suited to chat-format prompts, is primarily English and not intended for multilingual use, and that most of its code training data is Python using common packages.

Specifications and limits

Phi-4 takes text input, is best suited to chat-format prompts and has a context length of 16K tokens. It is a static model trained on an offline dataset, released under the MIT licence. Microsoft list its primary uses as memory- or compute-constrained environments, latency-bound scenarios, and reasoning and logic, primarily in English. In the same simple-evals table Microsoft give Qwen 2.5 14B Instruct MMLU 79.9 and GPQA 42.9, and GPT-4o MMLU 88.1, GPQA 50.6 and HumanEval 90.6. Microsoft note that Llama-3.3 70B's MATH and HumanEval scores in the table are lower than Meta's own reports of 77 and 88, which they attribute to simple-evals' strict formatting requirement.

Lineage

Phi-4 was developed by Microsoft Research and follows Phi-3, whose 14B model Microsoft use as the baseline in the card's table. A technical report on arXiv (2412.08905) describes the data and safety alignment in more detail.

Key Takeaways

  • Microsoft's small model, MIT-licensed, with a 16K token context window.
  • Built substantially on synthetic 'textbook-like' data written to teach mathematics, coding, common-sense reasoning and world knowledge.
  • Microsoft name three intended uses: memory or compute constrained environments, latency-bound scenarios, and reasoning and logic.
  • The card includes an explicit out-of-scope section and notes the model's focus on English.
  • LMArena: 1256 Elo (rank 323).
  • Around $0.07 per million input tokens and $0.14 output.
  • 14 billion dense parameters, trained on 9.8 trillion tokens over 21 days on 1,920 H100s.

Official Resources

Full Specifications

$0.07 / $0.14 per million tokens
Identity
DeveloperMicrosoft AI
ReleasedDec 2024
LicenceMIT
Self-hostableYes
Cost
Blended $/1M tokensinput × 0.75 + output × 0.25$0.088 / 1M tokens
Input price$0.070 / 1M tokens
Output price$0.140 / 1M tokens
Capacity
Context window16.4K tokens
Measured quality
LMArena Elo1256 (checked Nov 2026)
LMArena rankRank 323
GPQA Diamond56
LiveBench42
Elo per dollarLMArena Elo ÷ blended $/1M tokens14354