Microsoft's Phi-1.5 Beats Models 5x Its Size Using Synthetic Textbook Data
Microsoft's 1.3B parameter small language model trained on synthetic textbook data continues to trend, showing that quality data can beat raw scale.
ProTakeaways
- Microsoft Phi-1.5 is a 1.3B parameter transformer trending on Hugging Face with 1.36k likes.
- Trained on synthetic textbook-quality data, no web crawl, 150B tokens on 32 A100s over 8 days.
- Matches 5x larger models on common sense reasoning and beats most non-frontier LLMs on grade-school math.
- MIT-licensed base model, no instruction tuning or RLHF, meant for research on safety and controllability.
- Runs in transformers 4.37+, vLLM, SGLang, and quantized in llama.cpp, Ollama, and LM Studio.
- Full details in the Textbooks Are All You Need II paper.
Microsoft's Phi-1.5 keeps drawing attention on Hugging Face, with over 1,300 likes and 55,000 monthly downloads. The 1.3 billion parameter transformer punches far above its weight class, and has become one of the reference points for the argument that curated synthetic data can rival brute-force scaling.
The small model that acts big
Phi-1.5 performs comparably to models 5x larger on natural language tasks, and surpasses most non-frontier LLMs on more complex reasoning such as grade-school mathematics and basic coding. That was the headline claim in the original technical report, and it is the reason the checkpoint still gets pulled into new fine-tuning projects today.
The architecture is a standard decoder-only transformer with a next-word prediction objective. What is unusual is what it was fed during training, not how it was wired.
Textbooks instead of the open web
Phi-1.5 is the second entry in the "Textbooks Are All You Need" line of research. The earlier phi-1 paper proposed using existing LLMs to generate textbook quality data as a way to enhance learning compared to traditional web scrapes. Phi-1.5 extends the same idea from Python code into common sense reasoning in natural language.
Microsoft deliberately kept the open web out of the pipeline. Excluding sources like Common Crawl reduces direct exposure to harmful online content and improves safety without needing RLHF, though the team notes the model can still generate harmful content if prompted.
Training footprint
The compute budget is small enough to be interesting to anyone thinking about their own pretraining runs:
- Architecture: transformer with next-word prediction objective
- Dataset size: 30B tokens, trained for 150B tokens total
- Precision: fp16
- Hardware: 32 A100-40G GPUs
- Training time: 8 days
- Stack: PyTorch, DeepSpeed, and Flash-Attention
No instruction tuning and no reinforcement learning from human feedback. Microsoft explicitly released it as a base model so the research community could study safety, toxicity, and controllability on a small non-restricted checkpoint.
Running it
Phi-1.5 has been integrated into transformers since version 4.37.0. Pulling it down and generating text takes only a few lines:
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("microsoft/phi-1_5")
model = AutoModelForCausalLM.from_pretrained(
"microsoft/phi-1_5", torch_dtype="auto", device_map="auto"
)
prompt = 'def print_prime(n):\n """Print all primes between 1 and n"""'
out = model.generate(**tok(prompt, return_tensors="pt"), max_length=200)
print(tok.batch_decode(out)[0])
The weights are MIT-licensed, free to use commercially, and small enough at around 1B parameters in F16 to load on a single consumer GPU. Phi-1.5 is also available through vLLM, SGLang, Docker Model Runner, and a long list of GGUF quantizations for llama.cpp, Ollama, and LM Studio.
Where it shines
Because it was trained on QA, chat, and code-shaped textbook data, it plays best when you match those formats. It can write short Python functions, draft emails, produce poems and stories, summarize text, and handle grade-school reasoning prompts. Phi-1.5 exhibits many traits of much larger LLMs, including the ability to think step by step and perform some rudimentary in-context learning.
Where it breaks
The model card is unusually candid about failure modes:
- Generates inaccurate code and factual statements, best treated as suggestions rather than answers
- Struggles with uncommon Python packages or non-Python code
- Does not reliably follow nuanced instructions since there is no instruction fine-tuning
- Only understands standard English, with informal phrasing and slang causing errors
- Can still produce toxic or biased output despite the curated dataset
Expect it to keep generating text past the point where a chat model would stop, and plan on truncating or fine-tuning for production use.
Why the checkpoint still matters
The real contribution of Phi-1.5 was the evidence it provided for a data-first thesis, more than the checkpoint itself. The work indicates the feasibility of high-level capabilities in smaller LLMs, potentially paving the way for more efficient and environmentally sustainable AI systems. That argument has since shaped Phi-2, Phi-3, and a wave of small model releases from other labs, and it is why the weights continue to appear as the base of hundreds of adapters and fine-tunes.
If you need a lightweight base model to experiment with alignment techniques, distillation, or on-device inference, Phi-1.5 remains one of the cleanest starting points available. For a production chatbot, look at the instruction-tuned successors in the Phi family instead.