Parameters
3.8B
Context Length
4K
Modality
Text
Architecture
Dense
KV Cache Rate
96 KB/tok
License
MIT
Release Date
22 Apr 2024
Knowledge Cutoff
Oct 2023
API Pricing (per 1M)
Input: $0.13 · Output: $0.52
Precision
Context
Workload Memory: 4.64 GB
INT4 · 4K context
Base Weights: 1.77 GB
KV Cache: 0.38 GB
Runtime & Graphs: 2.50 GB
1x NVIDIA L4 24GB
4.6 / 21.6 GB usable
1x RTX 3060 12GB
4.6 / 10.8 GB usable
Apple M4 24GB
4.6 / 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.40.2
| Architecture | Precision | Attention kernel |
|---|---|---|
Blackwell, Hopper | Native FP16 | FlashAttention-3 |
Ada Lovelace, Ampere | Native FP16 | FlashAttention-2 |
Additional required packages
Install alongside standard runtime libraries:
pip install flash_attn
Rank
#232
| Benchmark | Score | Rank |
|---|---|---|
General Text | 1143 | 193 |
Intelligence Index | 0.06 | 310 |
Overall Rank
#232
Coding Rank
-
Phi-3-mini is a lightweight 3.8B parameter dense language model developed by Microsoft for edge devices and mobile applications. It combines high reasoning density with LongRope context support extending up to 128K tokens.
Attention
Attention Structure
Grouped-Query Attention
Attention Heads
32
Key-Value Heads
8
Position Embedding
ROPE
RoPE Theta
10,000
Sliding Window Attention
Yes
Sliding Window Size
2,047
Normalization
RMS Normalization
Activation Function
Swish
Dimensions
Base Precision
FP16
Hidden Dimension Size
3,072
Number of Layers
32
FFN Intermediate Size (Dense)
8,192
Tokenizer
Vocabulary Size
32,064
Microsoft's Phi-3 models are small language models designed for efficient operation on resource-constrained devices. They utilize a transformer decoder architecture and are trained on extensively filtered, high-quality data, including synthetic compositions. This approach enables a compact yet capable model family.