AJ ZAFAR

Architecting intelligence. Delivering impact.

AI & Agents3 min read

Phi-2: Microsoft's small language model punches above its weight

Microsoft Research released Phi-2, a 2.7 billion-parameter model in the Azure AI Studio catalogue that matches models up to 25x larger. Why small models matter.

Azure AI Studio Explore tab with navigation for models, capabilities and responsible AI

Most of this year’s AI news has been about bigger models. On 12 December, Microsoft Research went the other way and released Phi-2, a language model with just 2.7 billion parameters. Satya Nadella first mentioned it on stage at Ignite last month. The headline claim is that on complex benchmarks Phi-2 matches or outperforms models up to 25 times its size. That is worth paying attention to, even if you never plan to train a model yourself.

What was announced

From the Microsoft Research blog:

  • Phi-2 is a 2.7 billion-parameter language model with strong reasoning and language understanding for its size. It follows Phi-1 (1.3 billion parameters, focused on Python coding) and Phi-1.5 (also 1.3 billion, focused on common sense reasoning and language understanding).
  • Benchmark results. Microsoft reports Phi-2 outperforms Mistral and Llama-2 models at 7B and 13B parameters on various aggregated benchmarks. It does better than the 25x larger Llama-2-70B on multi-step reasoning tasks such as coding and maths, and matches or outperforms Google’s recently announced Gemini Nano 2.
  • Training data is the secret. The team focused on “textbook-quality” data, with synthetic datasets created to teach common sense reasoning and general knowledge, plus carefully filtered web data.
  • Training scale. Phi-2 was trained on 1.4 trillion tokens over 14 days on 96 A100 GPUs.
  • A base model. It hasn’t been aligned with reinforcement learning from human feedback (RLHF) or instruct fine-tuned. Even so, Microsoft observed better behaviour on toxicity and bias than some existing open-source models that had been aligned.
  • Available in the Azure AI Studio model catalogue to foster research and development on language models.

The research team is open about the limits of benchmarks too. They acknowledge that many public benchmarks might leak into training data, and say the best way to judge a language model is to test it on concrete use cases.

Azure AI Studio Explore tab showing a Getting started page with navigation for models, capabilities and content safety, and tiles for Azure OpenAI, Speech, Language and Vision
Phi-2 sits in the model catalogue in Azure AI Studio, reached from the Explore tab alongside the Azure AI services.Image: Microsoft Learn (CC BY 4.0)

What it means for organisations

Phi-2 is for research, not production, today. Microsoft positions it as a playground for researchers, for work on interpretability, safety and fine-tuning. Coverage of the launch, including TechRepublic’s, describes it as intended for research use. I would treat it as something to learn from and experiment with, and check the licence terms carefully before anyone suggests putting it in front of customers.

Small models change the cost conversation. Not every task needs GPT-4. Classification, extraction, routing and simple summarisation might be handled by a much smaller model that is cheaper and faster to run. Phi-2 is a strong signal that well-curated training data can make up for a lot of size.

Edge and on-device become more realistic. A model of this size is far easier to run on modest hardware than a 70B model. For scenarios with poor connectivity or strict data residency, that is interesting. It is early, but I expect this to become a bigger part of architecture discussions in 2024.

A base model needs guardrails. Because Phi-2 has no RLHF or instruction tuning, it won’t behave like a chat assistant out of the box. Any experiments should include content filtering and careful evaluation, just as you would for any model.

Model choice is now a design decision. Between the Azure OpenAI models, open models in the catalogue and now small models like Phi-2, architects need a simple way to compare quality, cost and latency for a given task. Evaluation tools like prompt flow in Azure AI Studio make that easier.

↑↓ navigateEnter openEsc close