Parameters
1.3B
Context Length
2K
Modality
Text
Architecture
Dense
KV Cache Rate
192 KB/tok
License
MIT
Release Date
15 Jun 2023
Knowledge Cutoff
-
API Pricing (per 1M)
Self-hosted only
Precision
Context
Workload Memory: 3.48 GB
INT4 · 2048 context
Base Weights: 0.61 GB
KV Cache: 0.38 GB
Runtime & Graphs: 2.50 GB
1x NVIDIA L4 24GB
3.5 / 21.6 GB usable
1x RTX 3060 12GB
3.5 / 10.8 GB usable
Apple M4 24GB
3.5 / 18.0 GB usable
Determine requirements for your specific workload:
Open in VRAM Calculator
Checkpoint format
FP16
CUDA
>= 11.8
PyTorch
>= 2.1
Transformers
>= 4.37.0
| Architecture | Precision | Attention kernel |
|---|---|---|
Blackwell, Hopper | Native FP16 | FlashAttention-3 |
Ada Lovelace, Ampere | Native FP16 | FlashAttention-2 |
No evaluation benchmarks for Phi-1 available.
Overall Rank
-
Coding Rank
-
Phi-1 is Microsoft's compact 1.3B parameter transformer model specialized for high-quality Python code generation from docstrings. Trained on curated "textbook-quality" synthetic and web data, it achieves strong coding benchmark efficiency.
Attention
Attention Structure
Multi-Head Attention
Attention Heads
32
Key-Value Heads
32
Position Embedding
ROPE
RoPE Theta
10,000
Normalization
Layer Normalization
Activation Function
GELU
Dimensions
Base Precision
FP16
Hidden Dimension Size
2,048
Number of Layers
24
FFN Intermediate Size (Dense)
8,192
Tokenizer
Vocabulary Size
51,200
Phi-1 is Microsoft's foundational 1.3 billion-parameter Transformer-based small language model. Its purpose is specializing in Python code generation. A core innovation involves training on meticulously curated, "textbook-quality" data, demonstrating that high-quality data can enable capable models without extensive scale.