Microsoft's Phi-3.5-mini Beats 12B Models at a 3.8B Size
Microsoft's 3.8B parameter open model punches above its weight on reasoning, code, and 23 languages, all under a permissive MIT license.
ProTakeaways
- Phi-3.5-mini-instruct is Microsoft's 3.8B parameter open model with a 128K context window
- Trained on 3.4T tokens using 512 H100 GPUs for 10 days, tuned with SFT plus PPO plus DPO
- Scores 86.2 on GSM8K and 77 on RepoQA, beating Llama-3.1-8B on both
- Supports 23 languages including Arabic, Chinese, Japanese, Korean, Russian, and Ukrainian
- Released under MIT license and available on Azure AI Studio, vLLM, SGLang, and Ollama
- Weak on factual recall, best paired with RAG for knowledge-intensive tasks
Microsoft's Phi-3.5-mini-instruct remains one of the most downloaded small language models on Hugging Face, and it is worth understanding why a 3.8B parameter model keeps showing up in production stacks more than a year after launch. The model is a compact, open-weight, instruction-tuned decoder built for reasoning-heavy workloads where latency and memory matter more than sheer scale.
A small model with a long shelf life
Phi-3.5-mini is a dense decoder-only Transformer with 3.8B parameters and a 128K token context window, released as an update to the earlier Phi-3 mini. Microsoft frames it as a refresh of the June 2024 release shaped by user feedback, with additional post-training data yielding substantial gains on multilingual quality, multi-turn conversation, and reasoning. It ships under an MIT license, so commercial use carries no royalty concerns.
The weights are integrated into some of Microsoft's own services and available through Azure AI Studio. You can also pull the model straight from Hugging Face, run it locally with transformers, serve it through vLLM or SGLang, or grab a quantized GGUF build for llama.cpp and Ollama.
How it was built
The recipe is classic Phi: heavy focus on synthetic, textbook-quality data plus filtered web content. Training consumed 3.4 trillion tokens on 512 H100 GPUs over 10 days, with a knowledge cutoff of October 2023. Microsoft says the model went through supervised fine-tuning, proximal policy optimization, and direct preference optimization to sharpen instruction adherence and reinforce safety. The Phi-3 technical report covers the data curation philosophy in detail.
Punching above 3.8B
Benchmarks tell a consistent story: this model competes with 7B-12B open weights and, on some reasoning tasks, with frontier APIs. Highlights from the model card:
- GSM8K math word problems: 86.2, ahead of Mistral-Nemo-12B (84.2) and Llama-3.1-8B (82.4)
- MMLU-Pro (0-shot CoT): 47.4, beating Mistral-Nemo-12B (40.7)
- BigBench Hard CoT: 69, ahead of Llama-3.1-8B (63.4)
- RepoQA long-context code understanding: 77 average across Python, C++, Rust, Java, and TypeScript, versus 71 for Llama-3.1-8B
- RULER long-context retrieval: 84.1 average up through 128K tokens
Multilingual coverage is the other headline. Phi-3.5-mini handles Arabic, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, and Ukrainian. On Korean evaluations like HAERAE and KMMLU, it beats Llama-3.1-8B-Instruct despite being less than half the size.
Where it breaks down
A 3.8B parameter model cannot memorize the world. Microsoft acknowledges the model lacks the capacity to store extensive factual knowledge, so users may hit factual errors, and recommends pairing it with a search engine or RAG pipeline to compensate. Long-context RULER scores also drop at extreme lengths, from 94.3 at 4K to 63.6 at 128K, while Llama-3.1-8B holds 77.0 at 128K. Red-teaming found the model sometimes refuses harmful requests in English but not when the same request arrives in another language.
When to reach for it
The intended sweet spots per the model card are memory- or compute-constrained deployments, latency-bound scenarios, and code, math, or logic reasoning tasks. Practical use cases that make sense:
- On-device or edge assistants where a 7B model is too heavy
- Batch reasoning pipelines that need throughput more than encyclopedic recall
- Multilingual chat backends spanning European and Asian languages
- RAG systems where retrieval supplies facts and Phi reasons over the retrieved context
- Fine-tuning starting points, with over 700 adapter variants and 329 finetunes already published on the Hub
Getting started takes two lines with the standard transformers pipeline:
from transformers import pipeline
pipe = pipeline("text-generation", model="microsoft/Phi-3.5-mini-instruct", trust_remote_code=True)
pipe([{"role": "user", "content": "Explain diffusion models in three sentences."}])
For production, vllm serve microsoft/Phi-3.5-mini-instruct gives you an OpenAI-compatible endpoint out of the box, and the model runs comfortably on a single A100, A6000, or H100. If you are stuck on older V100 hardware, pass attn_implementation="eager" instead of Flash Attention. Phi-3.5-mini remains a strong default when the job calls for a small, permissively licensed model that can actually reason.