Model reference · open weights
Phi-3-mini-128k is an open-weight language model from microsoft. Phi-3-mini-128k-instruct (BF16) weighs 7.6 GB; the smallest configuration that runs it is RTX 3060 12 GB.
What it is
| Released by | microsoft |
|---|---|
| Released | 2024-04-22 |
| Parameters | 3.8B |
| VRAM | 7.6 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 1 | — | 8K | 11.6 GB |
| RTX 4060 Ti 16 GB | 2 | — | 17K | 15.4 GB |
| RTX 3090 24 GB | 4 | 1 | 37K | 23.4 GB |
| RTX 4090 24 GB | 4 | 1 | 37K | 23.4 GB |
| RTX 5090 32 GB | 7 | 1 | 56K | 31.0 GB |
| L40S 48 GB | 11 | 2 | 88K | 44.0 GB |
| A100 80 GB | 21 | 5 | all 128K | 78.2 GB |
| H100 80 GB | 20 | 5 | all 128K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 25 | 6 | all 128K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 29 | 7 | all 128K | 107 GB |
| H200 141 GB | 39 | 9 | all 128K | 138 GB |
| B200 180 GB | 51 | 12 | all 128K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 4 | 1 | 35K | 11.6 GB a card |
| 2× RTX 4060 Ti 16 GB tensor parallel | 6 | 1 | 54K | 15.4 GB a card |
| 2× RTX 4090 24 GB tensor parallel | 11 | 2 | 94K | 23.4 GB a card |
| 2× RTX 3090 24 GB tensor parallel | 11 | 2 | 94K | 23.4 GB a card |
| 2× RTX 5090 32 GB tensor parallel | 16 | 4 | all 128K | 31.0 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 11.4 GB | 21.1 GB |
| 5 | 24.3 GB | 72.6 GB |
| 8 | 34.0 GB | 111 GB |
| 16 | 59.8 GB | 214 GB |
| 32 | 111 GB | 421 GB |
| 64 | 214 GB | 833 GB |
One card, with vLLM's small-card settings.
From the model card
🎉Phi-4: [multimodal-instruct | onnx]; [mini-instruct | onnx]
The Phi-3-Mini-128K-Instruct is a 3.8 billion-parameter, lightweight, state-of-the-art open model trained using the Phi-3 datasets. This dataset includes both synthetic data and filtered publicly available website data, with an emphasis on high-quality and reasoning-dense properties. The model belongs to the Phi-3 family with the Mini version in two variants 4K and 128K which is the context length (in tokens) that it can support.
After initial training, the model underwent a post-training process that involved supervised fine-tuning and direct preference optimization to enhance its ability to follow instructions and adhere to safety measures. When evaluated against benchmarks that test common sense, language understanding, mathematics, coding, long-term context, and logical reasoning, the Phi-3 Mini-128K-Instruct demonstrated robust and state-of-the-art performance among models with fewer than 13 billion parameters. Resources and Technical Documentation:
🏡 Phi-3 Portal 📰 Phi-3 Microsoft Blog 📖 Phi-3 Technical Report 🛠️ Phi-3 on Azure AI Studio 👩🍳 Phi-3 Cookbook 🖥️ Try It
| Short Context | Long Context | |
|---|---|---|
| Mini | 4K [HF] ; [ONNX] ; [GGUF] | 128K [HF] ; [ONNX] |
| Small | 8K [HF] ; [ONNX] | 128K [HF] ; [ONNX] |
| Medium | 4K [HF] ; [ONNX] | 128K [HF] ; [ONNX] |
| Vision | 128K [HF] ; [ONNX] |
Primary use cases
The model is intended for commercial and research use in English. The model provides uses for applications which require:
Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.
Use case considerations
Our models are not specifically designed or evaluated for all downstream purposes. Developers should consider common limitations of language models as they select use cases, and evaluate and mitigate for accuracy, safety, and fariness before using within a specific downstream use case, particularly for high risk scenarios. Developers should be aware of and adhere to applicable laws or regulations (including privacy, trade compliance laws, etc.) that are relevant to their use case.
Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.
This is an update over the original instruction-tuned Phi-3-mini release based on valuable customer feedback. The model used additional post-training data leading to substantial gains on long-context understanding, instruction following, and structure output. We also improve multi-turn conversation quality, explicitly support tag, and significantly improve reasoning capability. We believe most use cases will benefit from this release, but we encourage users to test in their particular AI applications. We appreciate the enthusiastic adoption of the Phi-3 model family, and continue to welcome all feedback from the community.
These tables below highlights improvements on instruction following, structure output, reasoning, and long-context understanding of the new release on our public and internal benchmark datasets.
| Benchmarks | Original | June 2024 Update |
|---|---|---|
| Instruction Extra Hard | 5.7 | 5.9 |
| Instruction Hard | 5.0 | 5.2 |
| JSON Structure Output | 1.9 | 60.1 |
| XML Structure Output | 47.8 | 52.9 |
| GPQA | 25.9 | 29.7 |
| MMLU | 68.1 | 69.7 |
| Average | 25.7 | 37.3 |
RULER: a retrieval-based benchmark for long context understanding
| Model | 4K | 8K | 16K | 32K | 64K | 128K | Average |
|---|---|---|---|---|---|---|---|
| Original | 86.7 | 78.1 | 75.6 | 70.3 | 58.9 | 43.3 | 68.8 |
| June 2024 Update | 92.4 | 91.1 | 90.8 | 87.9 | 79.8 | 65.6 | 84.6 |
RepoQA: a benchmark for long context code understanding
| Model | Python | C++ | Rust | Java | TypeScript | Average |
|---|---|---|---|---|---|---|
| Original | 27 | 29 | 40 | 33 | 33 | 32.4 |
| June 2024 U |
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.