← Back to Directory
Microsoft Research
LLM📅 Released: 2024-12-12

Phi-4

Phi-4 is a 14B parameter model that punches way above its weight class.

#SLM#efficient#open-source

Overview

Phi-4 is Microsoft Research's 14B parameter masterpiece, proving that 'Textbooks Are All You Need.' By training on high-quality synthetic data, this model achieves the reasoning performance of models 10x its size, making it the industry leader for efficient edge AI.

Unique Factor

Frontier-level logic and reasoning in a compact 14B parameter package.

Key Capabilities

Small but mighty
High reasoning
Efficient

Benchmarks

MMLU Score
80.1%
HumanEval (Coding)
82.5%
GPQA Diamond
60%
MATH Benchmark
81%

Top Use Cases

Offline Private Assistant

Running a high-quality AI assistant entirely on local hardware.

Example: “Summarize my local meeting notes and create a task list. Do not send data to the cloud.

Low-Latency Edge Agents

Providing instant AI responses in IoT or robotics applications.

Example: “Analyze the sensor logs and identify if the motor is vibrating outside of normal parameters.

Detailed Features

01

14B Parameter Efficiency: Can run on high-end laptops and mobile devices with GPU acceleration.

02

Synthetic Data Optimization: Trained on extremely high-quality data to maximize intelligence-per-weight.

03

Strong Logic & Math: Outperforms GPT-3.5 and Llama 3 70B in specific logical benchmarks.

04

Open Weights (MIT): Fully open for research, commercial use, and private hosting.

05

Vision-Language Variants: Optimized versions available for image-to-text tasks.

06

Azure AI Native: First-class support for deployment in the Microsoft Cloud ecosystem.

Strengths & Pros

  • Incredibly efficient and fast
  • MIT licensed and open
  • High intelligence-to-size ratio

Limitations & Cons

  • Small world knowledge base (can't name obscure celebrities)
  • Limited multilingual support compared to large models

Ideal Usage & Target Audience

Best For

Mobile app developers, local AI enthusiasts, and edge compute engineers.

Not Recommended For

Users needing a general-knowledge encyclopedia or deep multilingual support.

API Implementation

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('microsoft/phi-4')
tokenizer = AutoTokenizer.from_pretrained('microsoft/phi-4')

inputs = tokenizer('What is the square root of 144?', return_tensors='pt')
outputs = model.generate(**inputs, max_length=50)
print(tokenizer.decode(outputs[0]))

Check the official documentation for full SDK details.

Technical Specs

Context16,384 tokens
Params14B
LicenseMIT
ArchTransformer

API Pricing

$0 / 1M input tokens

Output: $0 / 1M tokens

✓ Free tier available
Access API

Developer

The pioneers of Small Language Models — creators of the high-efficiency Phi model family.

Prompt Library

Browse Coding Prompts

📋

Previous Version

Phi 3 5