Phi-4-reasoning - Microsoft's Phi-4 inference model series
Phi-4-reasoning is a 14 billion parameter inference model from Microsoft, designed for complex inference tasks. It is trained using supervised fine-tuning (SFT) and utilizes high-quality inference generated by OpenAI's o3-mini model...
What is Phi-4-reasoning?
Phi-4-reasoning is a 14 billion parameter inference model from Microsoft, designed for complex inference tasks. Trained using supervised fine-tuning (SFT), it utilizes high-quality inference demo data generated by OpenAI's o3-mini model. The model generates detailed inference chains and effectively utilizes computational resources during inference. Phi-4-reasoning performs exceptionally well on multiple benchmarks, outperforming models with larger parameter scales, such as DeepSeek-R1-Distill-Llama-70B. It demonstrates superior performance across various domains, including mathematical reasoning, scientific problems, programming, and algorithmic problem solving. Phi-4-reasoning-plus is a further optimized version using reinforcement learning, offering even stronger inference capabilities. Phi-4-mini-reasoning is a compact 3.8 billion parameter inference model designed for resource-constrained environments, such as mobile devices or edge computing scenarios. It is fine-tuned using synthetic data generated by the DeepSeek-R1 model.
The main function of Phi-4-reasoning
- Powerful complex reasoning abilityPhi-4-reasoning can handle complex tasks that require multi-step decomposition and internal reflection, and performs well in areas such as mathematical reasoning, scientific problem solving, programming and algorithmic problem solving.
- Generate detailed inference chainsThe model is trained through supervised fine-tuning (SFT), which can generate detailed inference chains, effectively utilize computational resources in the inference stage, and improve the accuracy and efficiency of inference.
- Efficient use of computing resourcesPhi-4-reasoning, through inference-time scaling, can dynamically allocate more computing resources during inference, thereby further enhancing inference capabilities.
- Education and tutoring applicationsPhi-4-reasoning covers a diverse range of math problems from high school to doctoral level, suitable for embedded tutoring and low-latency scenarios in education.
- Lightweight deploymentPhi-4-mini-reasoning is a compact version of the series, designed for resource-constrained environments and suitable for deployment in mobile devices or edge computing scenarios.
- Multi-domain adaptabilityIn addition to mathematical and scientific reasoning, Phi-4-reasoning also performs well in general aptitude tests, including long-input contextual question answering, instruction following, programming, knowledge and language comprehension, etc.
The technical principle of Phi-4-reasoning
- Supervisory fine-tuning (SFT)Phi-4-reasoning builds upon the Phi-4 model by reassigning two placeholders as "thinking" and "end thinking" markers to accommodate additional reasoning markers, extending the maximum marker length supported by the model from 16K to 32K. Training data includes synthetically generated long-chain thought reasoning traces and high-quality answers covering areas such as mathematics, programming, and security. Over approximately 16K training steps, the model gradually learns to use the "thinking" markers, improving its reasoning ability during training.
- Reinforcement Learning (RL)Phi-4-reasoning-plus is a version that further enhances reasoning ability through outcome-based reinforcement learning. Reinforcement learning focuses on mathematical reasoning, using 72,401 mathematical problems as a seed dataset. The reward function is designed to incentivize correctness, penalize bad behavior (such as repetition and excessive length), and encourage appropriate response formats.
- Data MethodologyThe Phi-4-reasoning training data methodology emphasizes the curation of high-quality data, including creatively designed synthetic generation and filtered organic data. The seed database is constructed by collecting questions from various online resources, which are then filtered through an LLM evaluation and filtering process, prioritizing hints that require complex, multi-step reasoning. This training data undergoes comprehensive decontamination to avoid contamination with commonly used inference benchmarks.
Phi-4-reasoning project address
- HuggingFace model library:https://huggingface.co/collections/microsoft/phi-4
- arXiv technical paper:https://arxiv.org/pdf/2504.21318
Applications of Phi-4-reasoning
- Education and ResearchPhi-4-reasoning and Phi-4-mini-reasoning are ideal for the field of education, enabling the solution of a wide variety of math and science problems from middle school to doctoral levels.
- Complex business decision supportPhi-4-reasoning-plus further enhances reasoning capabilities through reinforcement learning, making it suitable for critical business decision support systems requiring high accuracy. It can handle complex, multi-step tasks, providing precise solutions to complex business problems.
- Programming and Algorithm Problem SolvingPhi-4-reasoning excels in programming and algorithm problem-solving, generating detailed reasoning chains and solutions. It is suitable for code assistance and algorithm optimization tasks in development environments.
- Lightweight deployment and mobile devicesPhi-4-mini-reasoning is a compact inference model designed for computationally limited environments, such as mobile devices and edge computing scenarios.
- The core engine of proxy applicationsThe Phi-4-reasoning model series can serve as the core engine for agency applications, handling complex and multifaceted tasks.