
Phi-4 Reasoning
Microsoft · Coding · Other
Phi-4 Reasoning is Microsoft's 14B open-weight reasoning model that works through math, science, and coding problems step by step, rivaling much larger models.

About Phi-4 Reasoning
What Is Phi-4 Reasoning
Phi-4 Reasoning is a reasoning model from Microsoft Research, released on April 30, 2025 as part of the Phi family. It starts from the 14B Phi-4 base (microsoft/Phi-4-reasoning) and gets fine-tuned on carefully curated reasoning traces, so it produces a visible chain-of-thought reasoning block before it delivers an answer. It's a small language model (SLM) that punches above its weight. The point is simple. You get frontier-grade reasoning on math, science, and code without paying for a giant model.
The model exists for places where big models don't fit. It runs in memory and compute constrained environments, keeps latency low, and ships under the MIT license so anyone can download, fine-tune, and deploy it commercially. Microsoft trained it with supervised fine-tuning and reinforcement learning, which is how a 14B model keeps pace on hard problems.
The limits are real. Phi-4 Reasoning is built for math reasoning and English, so other languages degrade noticeably. Its context window is 32K tokens, smaller than the 128K many rival models offer. And because it always writes a long reasoning block, answers take longer and burn more tokens than a plain chat model.
Getting Started
- Download the weights from Hugging Face or pull the model through Azure AI Foundry. It's also on Ollama and llama.cpp for local runs.
- Set the recommended decoding settings: temperature 0.8, top_k 50, top_p 0.95, and sampling on. Skipping these hurts output quality.
- Load it with the transformers library or serve it through vLLM, then send a ChatML prompt with the Phi system message.
- Read the response. You get a reasoning chain first, followed by a clean final answer.
Product Information
A quick look at Phi-4 Reasoning's pricing, supported platforms, and performance.
Best for
The users, tasks, and scenarios where this tool fits best.
Users
- App developers
- Researchers
- Students and educators
Tasks
- Solving math problems
- Writing and explaining code
- Answering graduate-level science questions
- Multi-step planning
Scenarios
- Running reasoning offline
- Prototyping on a budget
- Building lightweight agents
Key features
Visible chain-of-thought reasoning
Phi-4 Reasoning writes out its thinking before it answers, so you can follow each step and spot where it goes wrong. The output splits into a reasoning block and a solution block. That structure helps when the process matters as much as the result.
14B parameters on a dense Phi-4 backbone
The model reuses the Phi-4 architecture, a 14B dense decoder-only transformer, and adds reasoning-focused fine-tuning on top. You get a compact model that still handles hard problems. For builders, the size means it fits hardware that a 70B model would never run on.
Strong math and science benchmarks
The model has become a reference point for open math reasoning AI. Microsoft reports the standard and plus versions score 75.3 and 81.3 on AIME 2024, and 65.8 and 68.9 on GPQA-Diamond, ahead of the DeepSeek-R1 distilled 70B model at far fewer parameters. On AIME 2025 it even beats the full 671B DeepSeek-R1. Those numbers come from Microsoft's own testing.
Trained with supervised fine-tuning and reinforcement learning
Microsoft fine-tuned Phi-4 on curated reasonining demonstrations drawn from OpenAI o3-mini, then used reinforcement learning to refine behavior. Data quality did the heavy lifting, which is why a small model competes with larger ones.
32K token context window
The model accepts up to 32K tokens, enough for long problems and detailed prompts. Microsoft recommends setting max_new_tokens up to 32768 for complex queries so the chain of thought has room to finish.
MIT license and broad framework support
The weights ship under the MIT license, so commercial use is allowed, and the model runs out of the box on transformers, vLLM, Ollama, and llama.cpp. You can also call the Phi-4 API as a hosted service through Azure AI Foundry.
Pros and cons
Pros
- Downloads and runs for free under the MIT license, so self-hosting carries no API fees.
- Matches or beats models five times its size on math and science benchmarks, according to Microsoft.
- Small enough for constrained hardware, which keeps latency low and enables offline reasoning.
- Show its reasoning steps, which helps with learning, debugging, and auditing answers.
- Works with common tools like transformers, vLLM, Ollama, and llama.cpp without extra setup.
Cons
- Built for English and math, so non-English prompts and open-ended writing perform noticeably worse.
- The 32K context window trails the 128K offered by many competing models, which limits long-document work.
- Always writing a full reasoning chain makes responses slower and more token-hungry than a plain chat model.
- Knowledge comes from an offline dataset with a March 2025 cutoff, so it can miss recent events.
Frequently asked questions
It's a 14B open-weight reasoning model from Microsoft Research, released on April 30, 2025. It's fine-tuned from Phi-4 to solve math, science, and coding problems through a step-by-step chain of thought.
Related content
Explore related tools, skills, and articles for Phi-4 Reasoning.
Phi-4 Reasoning Alternatives

Udon
Udon · Coding · ProductivityUdon turns an Apple Silicon Mac into a home server you run from a browser, with container controls, file shares, and an optional AI sysadmin.

offstage
offstage cloud · Coding · Productivityoffstage gives AI coding agents and CI jobs a real Mac: a fresh macOS account on Apple silicon, driven over an API and billed by the second.
BotBus
Chengdu Tuyang Tusen Technology Co., Ltd. · Coding · ProductivityBotBus lets you control AI coding agents from your phone and watch: approve commands, start tasks and read results while the code stays on your desktop.
