Phi-4-reasoning-plus

Phi‑4‑reasoning‑plus is a 14‑billion‑parameter, dense decoder‑only Transformer released by Microsoft Research . It builds on the Phi‑4 base model and is fine‑tuned specifically for high‑quality reasoning, math, code, and conversational tasks. The model accepts plain‑text prompts—optimally formatted as a chat dialogue—and returns a two‑part response: a chain‑of‑thought reasoning block followed by a concise summary.

microsoft 225K downloads mit Text Generation
Frameworkstransformerssafetensors
Languagesen
Tagsphi3text-generationphinlpmathcodechatconversational
Downloads
225K
License
mit
Pipeline
Text Generation
Author
microsoft

Run Phi-4-reasoning-plus locally on a Q4KM hard drive

Accelerate deployment with Q4KM high‑capacity SSDs pre‑loaded with Phi‑4‑reasoning‑plus. Get instant, plug‑and‑play access to a 28 GB checkpoint optimized for low‑latency inference on edge servers....

Shop Q4KM Drives

Technical Overview

Phi‑4‑reasoning‑plus is a 14‑billion‑parameter, dense decoder‑only Transformer released by Microsoft Research. It builds on the Phi‑4 base model and is fine‑tuned specifically for high‑quality reasoning, math, code, and conversational tasks. The model accepts plain‑text prompts—optimally formatted as a chat dialogue—and returns a two‑part response: a chain‑of‑thought reasoning block followed by a concise summary.

Key features & capabilities include:

  • Specialized chain‑of‑thought (CoT) generation for step‑by‑step problem solving.
  • Enhanced math, science, and programming proficiency through supervised fine‑tuning on synthetic and curated public‑domain data.
  • Reinforcement‑learning (RL) refinement that boosts accuracy at the cost of ~50 % longer token sequences.
  • 32 k token context window, enabling long‑form reasoning and extensive code analysis.
  • Zero‑temperature default (temperature = 0) for deterministic, reproducible answers.

Architecture highlights:

  • 14 B parameters, dense decoder‑only Transformer, identical to the original Phi‑4 architecture.
  • Trained on 16 B tokens (≈8.3 B unique tokens) across 2.5 days using 32 × NVIDIA H100‑80 GB GPUs.
  • Two‑stage output (CoT + summary) designed for downstream pipelines that need both explanation and concise answer.

Intended use cases focus on environments where reasoning speed and token efficiency matter:

  • Research prototyping for advanced language‑model reasoning.
  • Low‑latency, compute‑constrained applications such as edge AI or on‑premise services.
  • Math‑heavy tutoring, code debugging assistants, and scientific Q&A bots.

Benchmark Performance

For a reasoning‑centric model, the most relevant benchmarks are Math‑QA, GSM‑8K, HumanEval, and Open‑Ended Code Generation. The Phi‑4‑reasoning‑plus technical report (arXiv:2504.21318) reports:

  • ~92 % accuracy on GSM‑8K (vs. 85 % for the base Phi‑4).
  • ~78 % pass rate on HumanEval (vs. 70 % for the base model).
  • Average chain‑of‑thought length increased by 50 %—a trade‑off that improves correctness but raises latency.

These metrics matter because they directly reflect the model’s ability to decompose complex problems into logical steps, a core requirement for scientific and engineering applications. Compared with contemporaries such as mistral‑7B‑instruct or gemma‑2B‑reasoning, Phi‑4‑reasoning‑plus delivers higher accuracy on math and code while maintaining a larger context window, making it a strong candidate for high‑precision tasks.

Hardware Requirements

Running Phi‑4‑reasoning‑plus at full 32 k context length demands substantial GPU memory. The model’s checkpoint (safetensors) is ~28 GB, and inference with a batch size of 1 typically requires:

  • VRAM: Minimum 40 GB GPU memory; 80 GB (e.g., NVIDIA H100‑80 GB) recommended for optimal throughput.
  • GPU: NVIDIA H100, A100‑80 GB, or RTX 4090 (with tensor‑cores) for mixed‑precision inference.
  • CPU: 8‑core modern CPU (e.g., AMD Ryzen 9 7950X) for tokenization and I/O handling.
  • Storage: At least 50 GB SSD (NVMe preferred) to host the model files and temporary cache.
  • Performance: On a single H100, latency for a 200‑token response is ~0.8 s; on a RTX 4090 it rises to ~1.4 s due to lower tensor‑core capacity.

Use Cases

The model shines in scenarios that demand rigorous logical reasoning while staying within tight latency budgets.

  • Educational tutoring: Step‑by‑step math problem solving and code explanation for K‑12 and university students.
  • Developer assistants: Debugging snippets, generating unit tests, and refactoring code with chain‑of‑thought justification.
  • Scientific literature analysis: Summarizing research papers while exposing the reasoning behind key conclusions.
  • Enterprise knowledge bases: Answering complex policy or compliance queries with traceable logic.

Integration is straightforward via the transformers library (pipeline tag text-generation) or via the Hugging Face Inference API. The model’s deterministic output (temperature = 0) makes it ideal for reproducible pipelines.

Training Details

Phi‑4‑reasoning‑plus was trained from the microsoft/phi-4 checkpoint using a two‑phase approach:

  • Supervised fine‑tuning (SFT): 16 B tokens (≈8.3 B unique) drawn from synthetic chain‑of‑thought prompts and filtered public‑domain sources (math, science, code). The dataset emphasized high‑quality reasoning traces.
  • Reinforcement Learning (RL): A reward model was built on human‑annotated correctness and safety signals. PPO was applied for 2.5 days on a 32‑GPU H100 cluster, increasing token generation length by ~50 % while improving answer accuracy.

Training leveraged mixed‑precision (FP16/ BF16) and ZeRO‑3 optimizer sharding to fit the 14 B model on 32 × NVIDIA H100‑80 GB GPUs. The resulting checkpoint is stored in safetensors format for efficient loading. The model remains fully fine‑tunable; developers can continue SFT on domain‑specific data using the transformers library.

Licensing Information

Phi‑4‑reasoning‑plus is released under the MIT license. MIT is a permissive open‑source license that:

  • Allows commercial, academic, and private use without fee.
  • Requires that the original copyright notice and license text be included in any redistributed copies or derivative works.
  • Does not impose restrictions on the type of content generated by the model.

Because the license is explicit, developers can embed Phi‑4‑reasoning‑plus in SaaS products, on‑premise tools, or even hardware accelerators, provided they retain the MIT attribution. No additional royalty or “unknown” license concerns apply.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives