Benchgen
Models/microsoft/

Phi 4

DraftPublic

Model Details

Phi-4

Organization Parameters Context License Weights Released

Quick answer: Phi-4 is Microsoft's December 2024 14B-parameter language model, scoring 70.4% on MMLU-Pro, 75.4% on Arena Hard, 82.6% on HumanEval, and 27.4% on BigCodeBench. Under Apache 2.0 license with open weights, it delivers GPT-4-class knowledge at a 14B parameter scale. The model uses a 16K-token context window.

At a Glance

Where Phi-4 leads

  • 70.4% MMLU-Pro — competitive with models 3-5× its parameter count
  • 75.4% Arena Hard — strong general instruction following
  • 82.6% HumanEval — solid function-level code completion
  • Apache 2.0 — unrestricted commercial use
  • 14B parameters — highly efficient for self-hosting
  • Trained on synthetic high-quality data — disproportionately capable for its size

Where it lags

  • 16K context window — significantly smaller than Qwen3 32B (131K) or Llama 4 models
  • 27.4% BigCodeBench — moderate performance on complex code generation
  • Text-only: no vision capability
  • 14B dense — no MoE efficiency benefits

Best for: Edge deployment, resource-constrained inference, self-hosting on consumer GPUs, and tasks requiring GPT-4-class knowledge at 14B scale.

What Phi-4 Is

Phi-4 is Microsoft's December 2024 small language model, the fourth generation of the Phi series. Microsoft's Phi research focuses on demonstrating that high-quality training data — rather than raw parameter count — can yield outsized capability in small models. Phi-4 at 14B achieves MMLU-Pro scores competitive with much larger open-weight models.

The model is trained primarily on synthetic data: carefully curated textbook-quality content, code, and reasoning problems. This approach produces a model that excels at the academic knowledge and reasoning tasks covered by MMLU-Pro and Arena Hard, with 70.4% and 75.4% scores respectively placing it well above other models in its size class.

Phi-4's 16K context window is its most significant limitation relative to peers: Qwen3 32B offers 131K context at similar size, and Llama 4 Scout offers 10M. For tasks requiring long context, alternative open-weight models are recommended. For tasks fitting within 16K tokens, Phi-4 offers exceptional capability at 14B.

Specifications

FieldValue
OrganizationMicrosoft
Parameters14B (dense)
Context window16,384 tokens
LicenseApache 2.0
HuggingFacemicrosoft/phi-4
Release dateDecember 12, 2024
Knowledge cutoffJune 2024
ModalityText only
ArchitectureDense transformer

Pricing

Phi-4 is available as open weights under Apache 2.0 — free to self-host. Available via Azure AI Foundry and third-party providers.

Context Window

Phi-4 has a 16,384-token context window — approximately 12 pages of text. This is significantly smaller than most 2025-era models; for tasks requiring longer context, consider Qwen3 32B (131K) or Llama 4 Maverick (1M).

Public Benchmark Scores

BenchmarkScoreSourceDate
MMLU-Pro70.4%Benchgen evaluation2025-07
Arena Hard75.4%Benchgen evaluation2025-07
HumanEval82.6%Benchgen evaluation2025-07
BigCodeBench27.4%Benchgen evaluation2025-07

Phi-4 vs Alternatives

ModelMMLU-ProHumanEvalContextLicense
Phi-470.4%82.6%16KApache 2.0
Qwen3 32B131KApache 2.0
Llama 4 Scout74.3%10MLlama 4
Hermes 3 70B47.2%Llama 3.1

Phi-4's 70.4% MMLU-Pro at 14B is a standout result — Llama 4 Scout at 74.3% requires 17B active MoE parameters with a much larger infrastructure footprint. For tasks within 16K context, Phi-4 is the highest-knowledge-per-parameter open-weight model in its class.

Run Phi-4

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "microsoft/phi-4"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")

inputs = tokenizer("Explain Newton's third law:", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Frequently Asked Questions

What is Phi-4? Phi-4 is Microsoft's December 2024 14B-parameter language model, scoring 70.4% MMLU-Pro and 75.4% Arena Hard under Apache 2.0. It achieves GPT-4-class knowledge at 14B scale through synthetic high-quality data training.
Is Phi-4 open source? Yes. Phi-4 is released under Apache 2.0 on Hugging Face — free for commercial use with no restrictions.
What is Phi-4's context window? Phi-4 has a 16,384-token context window. For longer context tasks, consider Qwen3 32B (131K) or Llama 4 Maverick (1M).
What makes Phi-4 different from other small models? Phi-4 is trained primarily on synthetic high-quality data (textbook-quality content, curated code) rather than raw web data. This produces a model that punches above its weight on knowledge and reasoning benchmarks — 70.4% MMLU-Pro at 14B parameters is comparable to much larger models.

Specs from Microsoft's official Phi-4 release (December 2024) and Benchgen evaluations. Last updated 2026-07-24.

Benchmark Leaderboards

This model isn’t on any benchmark leaderboard yet.