Phi-3-small instruct (8k)
Version: 5
The Phi-3-Small-8K-Instruct is a 7B parameters, lightweight, state-of-the-art open model trained with the Phi-3 datasets that includes both synthetic data and the filtered publicly available websites data with a focus on high-quality and reasoning dense properties. The model supports 8K context length (in tokens).
The model underwent a post-training process that incorporates both supervised fine-tuning and direct preference optimization for the instruction following and safety measures.
When assessed against benchmarks testing common sense, language understanding, math, code, long context and logical reasoning, Phi-3-Small-8K-Instruct showcased a robust and state-of-the-art performance among models of the same-size and next-size-up.
📰 Phi-3 Microsoft Blog
📖 Phi-3 Technical Report
🛠️ Phi-3 on Azure AI Studio
👩🍳 Phi-3 Cookbook
When assessed against benchmarks testing common sense, language understanding, math, code, long context and logical reasoning, Phi-3-Small-8K-Instruct showcased a robust and state-of-the-art performance among models of the same-size and next-size-up.
Resources
🏡 Phi-3 Portal📰 Phi-3 Microsoft Blog
📖 Phi-3 Technical Report
🛠️ Phi-3 on Azure AI Studio
👩🍳 Phi-3 Cookbook
Model Architecture
Phi-3 Small-8K-Instruct has 7B parameters and is a dense decoder-only Transformer model. The model is fine-tuned with Supervised fine-tuning (SFT) and Direct Preference Optimization (DPO) to ensure alignment with human preferences and safety guidelines.Training Datasets
Our training data includes a wide variety of sources, totaling 4.8 trillion tokens (including 10% multilingual), and is a combination of- Publicly available documents filtered rigorously for quality, selected high-quality educational data, and code;
- Newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.);
- High quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
License
The model is licensed under the MIT license.Intended Uses
Primary use cases The model is intended for broad commercial and research use in English. The model provides uses for general purpose AI systems and applications which require:- Memory/compute constrained environments
- Latency bound scenarios
- Strong reasoning (especially code, math and logic)
Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines . Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.Responsible AI Considerations
Like other language models, the Phi series models can potentially behave in ways that are unfair, unreliable, or offensive. Some of the limiting behaviors to be aware of include:- Quality of Service: the Phi models are trained primarily on English text. Languages other than English will experience worse performance. English language varieties with less representation in the training data might experience worse performance than standard American English.
- Representation of Harms & Perpetuation of Stereotypes: These models can over- or under-represent groups of people, erase representation of some groups, or reinforce demeaning or negative stereotypes. Despite safety post-training, these limitations may still be present due to differing levels of representation of different groups or prevalence of examples of negative stereotypes in training data that reflect real-world patterns and societal biases.
- Inappropriate or Offensive Content: these models may produce other types of inappropriate or offensive content, which may make it inappropriate to deploy for sensitive contexts without additional mitigations that are specific to the use case.
- Information Reliability: Language models can generate nonsensical content or fabricate content that might sound reasonable but is inaccurate or outdated.
- Limited Scope for Code: Majority of Phi-3 training data is based in Python and use common packages such as "typing, math, random, collections, datetime, itertools". If the model generates Python scripts that utilize other packages or scripts in other languages, we strongly recommend users manually verify all API uses.
- Allocation: Models may not be suitable for scenarios that could have consequential impact on legal status or the allocation of resources or life opportunities (ex: housing, employment, credit, etc.) without further assessments and additional debiasing techniques.
- High-Risk Scenarios: Developers should assess suitability of using models in high-risk scenarios where unfair, unreliable or offensive outputs might be extremely costly or lead to harm. This includes providing advice in sensitive or expert domains where accuracy and reliability are critical (ex: legal or health advice). Additional safeguards should be implemented at the application level according to the deployment context.
- Misinformation: Models may produce inaccurate information. Developers should follow transparency best practices and inform end-users they are interacting with an AI system. At the application level, developers can build feedback mechanisms and pipelines to ground responses in use-case specific, contextual information, a technique known as Retrieval Augmented Generation (RAG).
- Generation of Harmful Content: Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
- Misuse: Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.
Content Filtering
Prompts and completions are passed through a default configuration of Azure AI Content Safety classification models to detect and prevent the output of harmful content. Learn more about Azure AI Content Safety . Configuration options for content filtering vary when you deploy a model for production in Azure AI; learn more .We report the results for Phi-3-Small-8K-Instruct on standard open-source benchmarks measuring the model's reasoning ability (both common sense reasoning and logical reasoning). We compare to Mixtral-8x7b, Gemini-Pro, Gemma 7B, Llama-3-8B-Instruct, GPT-3.5-Turbo-1106, and GPT-4-Turbo-1106.
All the reported numbers are produced with the exact same pipeline to ensure that the numbers are comparable. These numbers might differ from other published numbers due to slightly different choices in the evaluation.
As is now standard, we use few-shot prompts to evaluate the models, at temperature 0.
The prompts and number of shots are part of a Microsoft internal tool to evaluate language models, and in particular we did no optimization to the pipeline for Phi-3.
More specifically, we do not change prompts, pick different few-shot examples, change prompt format, or do any other form of optimization for the model. The number of k–shot examples is listed per-benchmark.
We take a closer look at different categories across 80 public benchmark datasets at the table below:
The prompts and number of shots are part of a Microsoft internal tool to evaluate language models, and in particular we did no optimization to the pipeline for Phi-3.
More specifically, we do not change prompts, pick different few-shot examples, change prompt format, or do any other form of optimization for the model. The number of k–shot examples is listed per-benchmark.
Benchmark | Phi-3-Small-8K-Instruct 7b | Gemma 7B | Mixtral 8x7B | Llama-3-Instruct 8b | GPT-3.5-Turbo version 1106 | Gemini Pro | GPT-4-Turbo version 1106 (Chat) |
---|---|---|---|---|---|---|---|
AGI Eval 5-shot | 45.1 | 42.1 | 45.2 | 42.0 | 48.4 | 49.0 | 59.6 |
MMLU 5-shot | 75.7 | 63.6 | 70.5 | 66.5 | 71.4 | 66.7 | 84.0 |
BigBench Hard 3-shot | 79.1 | 59.6 | 69.7 | 51.5 | 68.3 | 75.6 | 87.7 |
ANLI 7-shot | 58.1 | 48.7 | 55.2 | 57.3 | 58.1 | 64.2 | 71.7 |
HellaSwag 5-shot | 77.0 | 49.8 | 70.4 | 71.1 | 78.8 | 76.2 | 88.3 |
ARC Challenge 10-shot | 90.7 | 78.3 | 87.3 | 82.8 | 87.4 | 88.3 | 95.6 |
ARC Easy 10-shot | 97.0 | 91.4 | 95.6 | 93.4 | 96.3 | 96.1 | 98.8 |
BoolQ 2-shot | 84.8 | 66.0 | 76.6 | 80.9 | 79.1 | 86.4 | 91.3 |
CommonsenseQA 10-shot | 80.0 | 76.2 | 78.1 | 79.0 | 79.6 | 81.8 | 86.7 |
MedQA 2-shot | 65.4 | 49.6 | 62.2 | 60.5 | 63.4 | 58.2 | 83.7 |
OpenBookQA 10-shot | 88.0 | 78.6 | 85.8 | 82.6 | 86.0 | 86.4 | 93.4 |
PIQA 5-shot | 86.9 | 78.1 | 86.0 | 75.7 | 86.6 | 86.2 | 90.1 |
Social IQA 5-shot | 79.2 | 65.5 | 75.9 | 73.9 | 68.3 | 75.4 | 81.7 |
TruthfulQA (MC2) 10-shot | 70.2 | 52.1 | 60.1 | 63.2 | 67.7 | 72.6 | 85.2 |
WinoGrande 5-shot | 81.5 | 55.6 | 62.0 | 65.0 | 68.8 | 72.2 | 86.7 |
TriviaQA 5-shot | 58.1 | 72.3 | 82.2 | 67.7 | 85.8 | 80.2 | 73.3 |
GSM8K Chain of Thought 8-shot | 89.6 | 59.8 | 64.7 | 77.4 | 78.1 | 80.4 | 94.2 |
HumanEval 0-shot | 61.0 | 34.1 | 37.8 | 60.4 | 62.2 | 64.4 | 79.9 |
MBPP 3-shot | 71.7 | 51.5 | 60.2 | 67.7 | 77.8 | 73.2 | 86.7 |
Average | 75.7 | 61.8 | 69.8 | 69.4 | 74.3 | 75.4 | 85.2 |
Benchmark | Phi-3-Small-8K-Instruct 7b | Gemma 7B | Mixtral 8x7B | Llama-3-Instruct 8b | GPT-3.5-Turbo version 1106 | Gemini Pro | GPT-4-Turbo version 1106 (Chat) |
---|---|---|---|---|---|---|---|
Popular aggregated benchmark | 71.1 | 59.4 | 66.2 | 59.9 | 67.0 | 67.5 | 80.5 |
Reasoning | 82.4 | 69.1 | 77.0 | 75.7 | 78.3 | 80.4 | 89.3 |
Language understanding | 70.6 | 58.4 | 64.9 | 65.4 | 70.4 | 75.3 | 81.6 |
Code generation | 60.7 | 45.6 | 52.7 | 56.4 | 70.4 | 66.7 | 76.1 |
Math | 51.6 | 35.8 | 40.3 | 41.1 | 52.8 | 50.9 | 67.1 |
Factual knowledge | 38.6 | 46.7 | 58.6 | 43.1 | 63.4 | 54.6 | 45.9 |
Multilingual | 62.5 | 63.2 | 63.4 | 65.0 | 69.1 | 76.5 | 82.0 |
Robustness | 72.9 | 38.4 | 51.0 | 64.5 | 69.3 | 69.7 | 84.6 |
Model Specifications
Context Length131072
Quality Index0.35
LicenseMit
Last UpdatedNovember 2024
Input TypeText
Output TypeText
PublisherMicrosoft
Languages1 Language
Related Models