Add phi3.5 models (#3281)
This commit is contained in:
Родитель
5a3f905d9c
Коммит
e0060353f4
|
@ -0,0 +1,4 @@
|
|||
extra_config: model.yaml
|
||||
spec: spec.yaml
|
||||
type: model
|
||||
categories: ["Foundation Models", "Chat Completion", "Phi"]
|
|
@ -0,0 +1,143 @@
|
|||
Phi-3.5-mini is a lightweight, state-of-the-art open model built upon datasets used for Phi-3 - synthetic data and filtered publicly available websites - with a focus on very high-quality, reasoning dense data. The model belongs to the Phi-3 model family and supports 128K token context length. The model underwent a rigorous enhancement process, incorporating both supervised fine-tuning, proximal policy optimization, and direct preference optimization to ensure precise instruction adherence and robust safety measures.
|
||||
|
||||
### Resources
|
||||
🏡 [Phi-3 Portal](https://azure.microsoft.com/en-us/products/phi-3) <br>
|
||||
📰 [Phi-3 Microsoft Blog](https://aka.ms/phi3.5-techblog) <br>
|
||||
📖 [Phi-3 Technical Report](https://arxiv.org/abs/2404.14219) <br>
|
||||
👩🍳 [Phi-3 Cookbook](https://github.com/microsoft/Phi-3CookBook) <br>
|
||||
|
||||
### Model Summary
|
||||
| | |
|
||||
|------|------|
|
||||
| **Architecture** | Phi-3.5-mini has 3.8B parameters and is a dense decoder-only Transformer model using the same tokenizer as Phi-3 Mini. |
|
||||
| **Inputs** | Text. It is best suited for prompts using chat format. |
|
||||
| **Context length** | 128K tokens |
|
||||
| **GPUs** | 512 H100-80G |
|
||||
| **Training time** | 10 days |
|
||||
| **Training data** | 3.4T tokens |
|
||||
| **Outputs** | Generated text in response to the input |
|
||||
| **Dates** | Trained between June and August 2024 |
|
||||
| **Status** | This is a static model trained on an offline dataset with cutoff date October 2023 for publicly available data. Future versions of the tuned models may be released as we improve models. |
|
||||
| **Supported languages** | Arabic, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian |
|
||||
| **Release date** | August 20, 2024 |
|
||||
| License | MIT |
|
||||
|
||||
## Release Notes
|
||||
This is an update over the June 2024 instruction-tuned Phi-3-mini release based on valuable user feedback. The model used better post-training techniques and additional data leading to substantial gains on multilingual, multi-turn conversation quality, and 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.
|
||||
|
||||
### Multilingual
|
||||
The table below highlights multilingual capability of Phi-3.5-mini on multilingual MMLU, MEGA, and multilingual MMLU-pro datasets. Overall, we observed that even with just 3.8B active parameters, the model is very competitive on multilingual tasks in comparison to other models with a much bigger active parameters.
|
||||
|
||||
| Benchmark | Phi-3.5-mini-instruct | Phi-3.0-mini-128k-instruct | Mistral-7B-Instruct-v0.3 | Mistral-Nemo-12B-Ins-2407 | Llama-3.1-8B-Ins | Gemma-2-9B-Ins | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| Multilingual MMLU | 55.4 | 51.08 | 47.4 | 58.9 | 56.2 | 63.8 | 77.2 | 72.9 |
|
||||
| Multilingual MMLU-Pro | 30.9 | 30.21 | 15.0 | 34.0 | 21.4 | 43.0 | 57.9 | 53.2 |
|
||||
| MGSM | 47.9 | 41.56 | 31.8 | 63.3 | 56.7 | 75.1 | 75.8 | 81.7 |
|
||||
| MEGA MLQA | 61.7 | 55.5 | 43.9 | 61.2 | 45.2 | 54.4 | 61.6 | 70.0 |
|
||||
| MEGA TyDi QA | 62.2 | 55.9 | 54.0 | 63.7 | 54.5 | 65.6 | 63.6 | 81.8 |
|
||||
| MEGA UDPOS | 46.5 | 48.1 | 57.2 | 58.2 | 54.1 | 56.6 | 62.4 | 66.0 |
|
||||
| MEGA XCOPA | 63.1 | 62.4 | 58.8 | 10.8 | 21.1 | 31.2 | 95.0 | 90.3 |
|
||||
| MEGA XStoryCloze | 73.5 | 73.6 | 75.5 | 92.3 | 71.0 | 87.0 | 20.7 | 96.6 |
|
||||
| **Average** | **55.2** | **52.3** | **47.9** | **55.3** | **47.5** | **59.6** | **64.3** | **76.6** |
|
||||
|
||||
### Long Context
|
||||
|
||||
Phi-3.5-mini supports 128K context length, therefore the model is capable of several long context tasks including long document/meeting summarization, long document QA, long document information retrieval. Phi-3.5-mini outperforms Gemma-2 family which only supports 8K context length and is competitive with other much larger open-weight models such as Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and Mistral-Nemo-12B-Instruct-2407.
|
||||
|
||||
| Benchmark | Phi-3.5-mini-instruct | Llama-3.1-8B-instruct | Mistral-7B-instruct-v0.3 | Mistral-Nemo-12B-instruct-2407 | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
|
||||
|---|---|---|---|---|---|---|
|
||||
| GovReport | 25.9 | 25.1 | 26.0 | 25.6 | 27.8 | 24.8 |
|
||||
| QMSum | 21.3 | 21.6 | 21.3 | 22.1 | 24.0 | 21.7 |
|
||||
| Qasper | 41.9 | 37.2 | 31.4 | 30.7 | 43.5 | 39.8 |
|
||||
| SQuALITY | 25.3 | 26.2 | 25.9 | 25.8 | 23.5 | 23.8 |
|
||||
| SummScreenFD | 16.0 | 17.6 | 17.5 | 18.2 | 16.3 | 17.0 |
|
||||
| **Average** | **26.1** | **25.5** | **24.4** | **24.5** | **27.0** | **25.4** |
|
||||
|
||||
RULER: a retrieval-based benchmark for long context understanding
|
||||
| Model | 4K | 8K | 16K | 32K | 64K | 128K | Average |
|
||||
|--|--|--|--|--|--|--|--|
|
||||
| **Phi-3.5-mini-instruct** | 94.3 | 91.1 | 90.7 | 87.1 | 78.0 | 63.6 | **84.1** |
|
||||
| **Llama-3.1-8B-instruct** | 95.5 | 93.8 | 91.6 | 87.4 | 84.7 | 77.0 | **88.3** |
|
||||
| **Mistral-Nemo-12B-instruct-2407** | 87.8 | 87.2 | 87.7 | 69.0 | 46.8 | 19.0 | **66.2** |
|
||||
|
||||
RepoQA: a benchmark for long context code understanding
|
||||
| Model | Python | C++ | Rust | Java | TypeScript | Average |
|
||||
|--|--|--|--|--|--|--|
|
||||
| **Phi-3.5-mini-instruct** | 86 | 67 | 73 | 77 | 82 | **77** |
|
||||
| **Llama-3.1-8B-instruct** | 80 | 65 | 73 | 76 | 63 | **71** |
|
||||
| **Mistral-7B-instruct-v0.3** | 61 | 57 | 51 | 61 | 80 | **62** |
|
||||
|
||||
## Intended Use
|
||||
|
||||
### Primary Use Cases
|
||||
The model is intended for broad commercial and research use in multiple languages. The model provides uses for general purpose AI systems and applications which require:
|
||||
|
||||
1) Memory/compute constrained environments
|
||||
2) Latency bound scenarios
|
||||
3) Strong reasoning (especially code, math and logic)
|
||||
|
||||
Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.
|
||||
|
||||
### Out-of-Scope Use Cases
|
||||
Our models are not specifically designed or evaluated for all downstream purposes. Developers should consider common limitations of language models, as well as performance difference across languages, as they select use cases, and evaluate and mitigate for accuracy, safety, and fairness 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.**
|
||||
|
||||
## Responsible AI Considerations
|
||||
Like other language models, the Phi family of 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 and some additional multilingual text. Languages other than English will experience worse performance as well as performance disparities across non-English. English language varieties with less representation in the training data might experience worse performance than standard American English.
|
||||
* Multilingual performance and safety gaps: We believe it is important to make language models more widely available across different languages, but the Phi 3 models still exhibit challenges common across multilingual releases. As with any deployment of LLMs, developers will be better positioned to test for performance or safety gaps for their linguistic and cultural context and customize the model with additional fine-tuning and appropriate safeguards.
|
||||
* 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, cultural contexts, 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.
|
||||
* Long Conversation: Phi-3 models, like other models, can in some cases generate responses that are repetitive, unhelpful, or inconsistent in very long chat sessions in both English and non-English languages. Developers are encouraged to place appropriate mitigations, like limiting conversation turns to account for the possible conversational drift.
|
||||
|
||||
Developers should apply responsible AI best practices, including mapping, measuring, and mitigating risks associated with their specific use case and cultural, linguistic context. Phi-3 family of models are general purpose models. As developers plan to deploy these models for specific use cases, they are encouraged to fine-tune the models for their use case and leverage the models as part of broader AI systems with language-specific safeguards in place. Important areas for consideration include:
|
||||
|
||||
* 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 the 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.
|
||||
|
||||
## Training Data
|
||||
Our training data includes a wide variety of sources, totaling 3.4 trillion tokens, and is a combination of
|
||||
1) publicly available documents filtered rigorously for quality, selected high-quality educational data, and code;
|
||||
2) 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.);
|
||||
3) high quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
|
||||
|
||||
We are focusing on the quality of data that could potentially improve the reasoning ability for the model, and we filter the publicly available documents to contain the correct level of knowledge. As an example, the result of a game in premier league in a particular day might be good training data for frontier models, but we need to remove such information to leave more model capacity for reasoning for the small size models. More details about data can be found in the [Phi-3 Technical Report](https://arxiv.org/pdf/2404.14219).
|
||||
|
||||
## Sample Inputs and Outputs (for real-time inference)
|
||||
|
||||
### **Sample input**
|
||||
```json
|
||||
{
|
||||
"input_data": {
|
||||
"input_string": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "I am going to Paris, give me a list of 10 places to visit"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"temperature": 0.7,
|
||||
"top_p": 0.9,
|
||||
"do_sample": true,
|
||||
"max_new_tokens": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### **Sample output**
|
||||
```json
|
||||
{
|
||||
"output": " 1. Eiffel Tower: Visit the iconic symbol of Paris, offering breathtaking views of the city.\n\n2. Louvre Museum: Explore one of the world's largest and most visited museums, home to thousands of works of art, including the Mona Lisa.\n\n3. Notre-Dame Cathedral: Marvel at the stunning Gothic architecture of this famous cathedral, although note that it is currently under renovation due to the 2019 fire.\n\n4. Montmartre: Discover this historic and artistic neighborhood, famous for its bohemian past and the stunning Sacré-Cœur Basilica.\n\n5. Seine River Cruise: Take a relaxing cruise on the Seine River, seeing some of the city's most famous landmarks like the Louvre, Notre-Dame, and the Eiffel Tower from a unique perspective.\n\n6. Champs-Élysées: Visit this famous avenue lined with shops, cafes, and theaters. Don't forget to check out the Arc de Triomphe at its end.\n\n7. Palace of Versailles: Take a day trip from Paris to explore the opulent palace and gardens of Versailles, a UNESCO World Heritage site.\n\n8. Sacré-Cœur Basilica: Located at the highest point in the city, this basilica offers panoramic views of Paris.\n\n9. Latin Quarter: Stroll through this historic and vibrant neighborhood, famous for its student life, lively atmosphere, and cafes.\n\n10. Musée d'Orsay: Visit this museum, housing an impressive collection of Impressionist and Post-Impressionist art, including works by Monet, Degas, Renoir, and Van Gogh."
|
||||
}
|
||||
```
|
||||
|
||||
## 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](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks). 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.
|
|
@ -0,0 +1,8 @@
|
|||
path:
|
||||
container_name: models
|
||||
container_path: huggingface/phi-3.5-mini-128k-instruct/20240808/mlflow_model_folder
|
||||
storage_name: automlcesdkdataresources
|
||||
type: azureblob
|
||||
publish:
|
||||
description: description.md
|
||||
type: mlflow_model
|
|
@ -0,0 +1,57 @@
|
|||
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
|
||||
name: Phi-3.5-mini-instruct
|
||||
path: ./
|
||||
properties:
|
||||
SharedComputeCapacityEnabled: true
|
||||
languages: en
|
||||
inference-min-sku-spec: 24|1|220|64
|
||||
inference-recommended-sku: Standard_NC24ads_A100_v4, Standard_NC48ads_A100_v4, Standard_NC96ads_A100_v4, Standard_ND96amsr_A100_v4
|
||||
tags:
|
||||
freePlayground: "true"
|
||||
displayName: "Phi-3.5 mini instruct (128k)"
|
||||
summary: "Refresh of Phi-3-mini model."
|
||||
textContextWindow: 131072
|
||||
maxOutputTokens: 4096
|
||||
languages: "en"
|
||||
inputModalities: "text"
|
||||
trainingDataDate: "Aug 2024"
|
||||
keywords: "Reasoning,Understanding,Low latency"
|
||||
licenseDescription: "Microsoft.\nCopyright (c) Microsoft Corporation.\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
|
||||
playgroundRateLimitTier: "low"
|
||||
Featured: ""
|
||||
Preview: ""
|
||||
huggingface_model_id: ""
|
||||
maas-inference: "true"
|
||||
license: mit
|
||||
disable-batch: "true"
|
||||
task: chat-completion
|
||||
author: microsoft
|
||||
SharedComputeCapacityEnabled : ""
|
||||
hiddenlayerscanned : ""
|
||||
_aml_system_vanity_registry: "azureml-phi"
|
||||
inference_compute_allow_list:
|
||||
[
|
||||
Standard_NC24ads_A100_v4,
|
||||
Standard_NC48ads_A100_v4,
|
||||
Standard_ND96amsr_A100_v4,
|
||||
Standard_NC96ads_A100_v4
|
||||
]
|
||||
inference_supported_envs:
|
||||
- vllm
|
||||
model_specific_defaults:
|
||||
apply_deepspeed: "true"
|
||||
deepspeed_stage: 2
|
||||
apply_lora: "true"
|
||||
apply_ort: "false"
|
||||
precision: 16
|
||||
ignore_mismatched_sizes: "false"
|
||||
num_train_epochs: 1
|
||||
per_device_train_batch_size: 1
|
||||
per_device_eval_batch_size: 1
|
||||
gradient_accumulation_steps: 1
|
||||
learning_rate: 5e-6
|
||||
lr_scheduler_type: "cosine"
|
||||
logging_strategy: "steps"
|
||||
logging_steps: 10
|
||||
save_total_limit: 1
|
||||
version: 2
|
|
@ -0,0 +1,4 @@
|
|||
extra_config: model.yaml
|
||||
spec: spec.yaml
|
||||
type: model
|
||||
categories: ["Foundation Models", "Chat Completion", "Phi"]
|
|
@ -0,0 +1,190 @@
|
|||
Phi-3.5-MoE is a lightweight, state-of-the-art open model built upon datasets used for Phi-3 - synthetic data and filtered publicly available documents - with a focus on very high-quality, reasoning dense data. The model supports multilingual and comes with 128K context length (in tokens). The model underwent a rigorous enhancement process, incorporating supervised fine-tuning, proximal policy optimization, and direct preference optimization to ensure precise instruction adherence and robust safety measures.
|
||||
|
||||
### Resources
|
||||
🏡 [Phi-3 Portal](https://azure.microsoft.com/en-us/products/phi-3) <br>
|
||||
📰 [Phi-3 Microsoft Blog](https://aka.ms/phi3.5-techblog) <br>
|
||||
📖 [Phi-3 Technical Report](https://arxiv.org/abs/2404.14219) <br>
|
||||
👩🍳 [Phi-3 Cookbook](https://github.com/microsoft/Phi-3CookBook) <br>
|
||||
|
||||
### Model Summary
|
||||
| | |
|
||||
|------|------|
|
||||
| **Architecture** | Phi-3.5-MoE has 16x3.8B parameters with 6.6B active parameters when using 2 experts. The model is a mixture-of-expert decoder-only Transformer model using the tokenizer with vocabulary size of 32,064. |
|
||||
| **Inputs** | Text. It is best suited for prompts using chat format. |
|
||||
| **Context length** | 128K tokens |
|
||||
| **GPUs** | 512 H100-80G |
|
||||
| **Training time** | 23 days |
|
||||
| **Training data** | 4.9T tokens |
|
||||
| **Outputs** | Generated text in response to the input |
|
||||
| **Dates** | Trained between April and August 2024 |
|
||||
| **Status** | This is a static model trained on an offline dataset with cutoff date October 2023 for publicly available data. Future versions of the tuned models may be released as we improve models. |
|
||||
| **Supported languages** | Arabic, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian |
|
||||
| **Release date** | August 20, 2024 |
|
||||
| **License** | MIT |
|
||||
|
||||
|
||||
## Benchmarks
|
||||
|
||||
To understand the capabilities, we compare Phi-3.5-MoE with a set of models over a variety of benchmarks using our internal benchmark platform. At the high-level overview of the model quality on representative benchmarks:
|
||||
|
||||
| Category | Benchmark | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemma-2-9b-It | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
|
||||
|--|--|--|--|--|--|--|--|
|
||||
| Popular aggregated benchmark | Arena Hard | 37.9 | 39.4 | 25.7 | 42.0 | 55.2 | 75.0 |
|
||||
| | BigBench Hard CoT (0-shot) | 79.1 | 60.2 | 63.4 | 63.5 | 66.7 | 80.4 |
|
||||
| | MMLU (5-shot) | 78.9 | 67.2 | 68.1 | 71.3 | 78.7 | 77.2 |
|
||||
| | MMLU-Pro (0-shot, CoT) | 54.3 | 40.7 | 44.0 | 50.1 | 57.2 | 62.8 |
|
||||
| Reasoning | ARC Challenge (10-shot) | 91.0 | 84.8 | 83.1 | 89.8 | 92.8 | 93.5 |
|
||||
| | BoolQ (2-shot) | 84.6 | 82.5 | 82.8 | 85.7 | 85.8 | 88.7 |
|
||||
| | GPQA (0-shot, CoT) | 36.8 | 28.6 | 26.3 | 29.2 | 37.5 | 41.1 |
|
||||
| | HellaSwag (5-shot) | 83.8 | 76.7 | 73.5 | 80.9 | 67.5 | 87.1 |
|
||||
| | OpenBookQA (10-shot) | 89.6 | 84.4 | 84.8 | 89.6 | 89.0 | 90.0 |
|
||||
| | PIQA (5-shot) | 88.6 | 83.5 | 81.2 | 83.7 | 87.5 | 88.7 |
|
||||
| | Social IQA (5-shot) | 78.0 | 75.3 | 71.8 | 74.7 | 77.8 | 82.9 |
|
||||
| | TruthfulQA (MC2) (10-shot) | 77.5 | 68.1 | 69.2 | 76.6 | 76.6 | 78.2 |
|
||||
| | WinoGrande (5-shot) | 81.3 | 70.4 | 64.7 | 74.0 | 74.7 | 76.9 |
|
||||
| Multilingual | Multilingual MMLU (5-shot) | 69.9 | 58.9 | 56.2 | 63.8 | 77.2 | 72.9 |
|
||||
| | MGSM (0-shot CoT) | 58.7 | 63.3 | 56.7 | 75.1 | 75.8 | 81.7 |
|
||||
| Math | GSM8K (8-shot, CoT) | 88.7 | 84.2 | 82.4 | 84.9 | 82.4 | 91.3 |
|
||||
| | MATH (0-shot, CoT) | 59.5 | 31.2 | 47.6 | 50.9 | 38.0 | 70.2 |
|
||||
| Long context | Qasper | 40.0 | 30.7 | 37.2 | 13.9 | 43.5 | 39.8 |
|
||||
| | SQuALITY | 24.1 | 25.8 | 26.2 | 0.0 | 23.5 | 23.8 |
|
||||
| Code Generation | HumanEval (0-shot) | 70.7 | 63.4 | 66.5 | 61.0 | 74.4 | 86.6 |
|
||||
| | MBPP (3-shot) | 80.8 | 68.1 | 69.4 | 69.3 | 77.5 | 84.1 |
|
||||
| **Average** | | **69.2** | **61.3** | **61.0** | **63.3** | **68.5** | **74.9** |
|
||||
|
||||
We take a closer look at different categories across 80 public benchmark datasets at the table below:
|
||||
| Category | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemma-2-9b-It | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
|
||||
|--|--|--|--|--|--|--|
|
||||
| Popular aggregated benchmark | 62.6 | 51.9 | 50.3 | 56.7 | 64.5 | 73.9 |
|
||||
| Reasoning | 78.7 | 72.2 | 70.5 | 75.4 | 77.7 | 80.0 |
|
||||
| Language understanding | 71.8 | 67.0 | 62.9 | 72.8 | 66.6 | 76.8 |
|
||||
| Robustness | 75.6 | 65.2 | 59.8 | 64.7 | 68.9 | 77.5 |
|
||||
| Long context | 25.5 | 24.5 | 25.5 | 0.0 | 27.0 | 25.4 |
|
||||
| Math | 74.1 | 57.7 | 65.0 | 67.9 | 60.2 | 80.8 |
|
||||
| Code generation | 68.3 | 56.9 | 65.8 | 58.3 | 66.8 | 69.9 |
|
||||
| Multilingual | 65.8 | 55.3 | 47.5 | 59.6 | 64.3 | 76.6 |
|
||||
|
||||
Overall, Phi-3.5-MoE with only **6.6B active parameters** achieves a similar level of language understanding and math as much larger models. Moreover, the model outperforms bigger models in reasoning capability and only behind GPT-4o-mini. However, it is still fundamentally limited by its size for certain tasks. The model simply does not have the capacity to store too much factual knowledge, therefore, users may experience factual incorrectness. However, we believe such weakness can be resolved by augmenting Phi-3.5 with a search engine, particularly when using the model under RAG settings.
|
||||
|
||||
### Multilingual
|
||||
|
||||
The table below highlights multilingual capability of Phi-3.5-MoE on multilingual MMLU, MEGA, and multilingual MMLU-pro datasets. Overall, we observed that even with just 6.6B active parameters, the model is very competitive on multilingual tasks in comparison to other models with a much bigger active parameters.
|
||||
|
||||
| Category | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemma-2-9b-It | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
|
||||
|--|--|--|--|--|--|--|
|
||||
| Multilingual MMLU | 69.9 | 58.9 | 56.2 | 63.8 | 77.2 | 72.9 |
|
||||
| Multilingual MMLU-Pro | 45.3 | 34.0 | 21.4 | 43.0 | 57.9 | 53.2 |
|
||||
| MGSM | 58.7 | 63.3 | 56.7 | 75.1 | 75.8 | 81.7 |
|
||||
| MEGA MLQA | 65.3 | 61.2 | 45.2 | 54.4 | 61.6 | 70.0 |
|
||||
| MEGA TyDi QA | 67.1 | 63.7 | 54.5 | 65.6 | 63.6 | 81.8 |
|
||||
| MEGA UDPOS | 60.4 | 58.2 | 54.1 | 56.6 | 62.4 | 66.0 |
|
||||
| MEGA XCOPA | 76.6 | 10.8 | 21.1 | 31.2 | 95.0 | 90.3 |
|
||||
| MEGA XStoryCloze | 82.8 | 92.3 | 71.0 | 87.0 | 20.7 | 96.6 |
|
||||
| **Average** | **65.8** | **55.3** | **47.5** | **59.6** | **64.3** | **76.6** |
|
||||
|
||||
### Long Context
|
||||
|
||||
Phi-3.5-MoE supports 128K context length, therefore the model is capable of several long context tasks including long document/meeting summarization, long document QA, multilingual context retrieval. We see that Phi-3.5 is clearly better than Gemma-2 family which only supports 8K context length. Phi-3.5-MoE-instruct is very competitive with other much larger open-weight models such as Llama-3.1-8B-instruct, and Mistral-Nemo-12B-instruct-2407.
|
||||
|
||||
| Benchmark | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
|
||||
|--|--|--|--|--|--|
|
||||
| GovReport | 26.4 | 25.6 | 25.1 | 27.8 | 24.8 |
|
||||
| QMSum | 19.9 | 22.1 | 21.6 | 24.0 | 21.7 |
|
||||
| Qasper | 40.0 | 30.7 | 37.2 | 43.5 | 39.8 |
|
||||
| SQuALITY | 24.1 | 25.8 | 26.2 | 23.5 | 23.8 |
|
||||
| SummScreenFD | 16.9 | 18.2 | 17.6 | 16.3 | 17.0 |
|
||||
| **Average** | **25.5** | **24.5** | **25.5** | **27.0** | **25.4** |
|
||||
|
||||
RULER: a retrieval-based benchmark for long context understanding
|
||||
| Model | 4K | 8K | 16K | 32K | 64K | 128K | Average |
|
||||
|--|--|--|--|--|--|--|--|
|
||||
| Phi-3.5-MoE-instruct | 94.8 | 93 | 93.2 | 91.6 | 85.7 | 64.2 | **87.1** |
|
||||
| Llama-3.1-8B-instruct | 95.5 | 93.8 | 91.6 | 87.4 | 84.7 | 77.0 | **88.3** |
|
||||
| Mistral-Nemo-12B-instruct-2407 | 87.8 | 87.2 | 87.7 | 69.0 | 46.8 | 19.0 | **66.2** |
|
||||
|
||||
RepoQA: a benchmark for long context code understanding
|
||||
| Model | Python | C++ | Rust | Java | TypeScript | Average |
|
||||
|--|--|--|--|--|--|--|
|
||||
| Phi-3.5-MoE-instruct | 89 | 74 | 81 | 88 | 95 | **85** |
|
||||
| Llama-3.1-8B-instruct | 80 | 65 | 73 | 76 | 63 | **71** |
|
||||
| Mistral-7B-instruct-v0.3 | 61 | 57 | 51 | 61 | 80 | **62** |
|
||||
|
||||
|
||||
## Intended Use
|
||||
|
||||
### 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:
|
||||
|
||||
1) Memory/compute constrained environments
|
||||
2) Latency bound scenarios
|
||||
3) Strong reasoning (especially code, math and logic)
|
||||
|
||||
Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.
|
||||
|
||||
### Out-of-Scope Use Cases
|
||||
|
||||
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 fairness 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.**
|
||||
|
||||
## Responsible AI Considerations
|
||||
|
||||
Like other language models, the Phi family of 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 and some additional multilingual text. Languages other than English will experience worse performance as well as performance disparities across non-English. English language varieties with less representation in the training data might experience worse performance than standard American English.
|
||||
* Multilingual performance and safety gaps: We believe it is important to make language models more widely available across different languages, but the Phi 3 models still exhibit challenges common across multilingual releases. As with any deployment of LLMs, developers will be better positioned to test for performance or safety gaps for their linguistic and cultural context and customize the model with additional fine-tuning and appropriate safeguards.
|
||||
* 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, cultural contexts, 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.
|
||||
* Long Conversation: Phi-3 models, like other models, can in some cases generate responses that are repetitive, unhelpful, or inconsistent in very long chat sessions in both English and non-English languages. Developers are encouraged to place appropriate mitigations, like limiting conversation turns to account for the possible conversational drift
|
||||
|
||||
Developers should apply responsible AI best practices, including mapping, measuring, and mitigating risks associated with their specific use case and cultural, linguistic context. Phi-3 family of models are general purpose models. As developers plan to deploy these models for specific use cases, they are encouraged to fine-tune the models for their use case and leverage the models as part of broader AI systems with language-specific safeguards in place. Important areas for consideration include:
|
||||
* 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 the 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.
|
||||
|
||||
## Training Data
|
||||
|
||||
Our training data includes a wide variety of sources, totaling 4.9 trillion tokens (including 10% multilingual), and is a combination of
|
||||
1) publicly available documents filtered rigorously for quality, selected high-quality educational data, and code;
|
||||
2) 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.);
|
||||
3) high quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
|
||||
|
||||
We are focusing on the quality of data that could potentially improve the reasoning ability for the model, and we filter the publicly available documents to contain the correct level of knowledge. As an example, the result of a game in premier league in a particular day might be good training data for frontier models, but we need to remove such information to leave more model capacity for reasoning for the small size models. More details about data can be found in the [Phi-3 Technical Report](https://arxiv.org/pdf/2404.14219).
|
||||
|
||||
## Sample Inputs and Outputs (for real-time inference)
|
||||
|
||||
### **Sample input**
|
||||
```json
|
||||
{
|
||||
"input_data": {
|
||||
"input_string": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "I am going to Paris, give me a list of 10 places to visit"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"temperature": 0.7,
|
||||
"top_p": 0.9,
|
||||
"do_sample": true,
|
||||
"max_new_tokens": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### **Sample output**
|
||||
```json
|
||||
{
|
||||
"output": " 1. Eiffel Tower: Visit the iconic symbol of Paris, offering breathtaking views of the city.\n\n2. Louvre Museum: Explore one of the world's largest and most visited museums, home to thousands of works of art, including the Mona Lisa.\n\n3. Notre-Dame Cathedral: Marvel at the stunning Gothic architecture of this famous cathedral, although note that it is currently under renovation due to the 2019 fire.\n\n4. Montmartre: Discover this historic and artistic neighborhood, famous for its bohemian past and the stunning Sacré-Cœur Basilica.\n\n5. Seine River Cruise: Take a relaxing cruise on the Seine River, seeing some of the city's most famous landmarks like the Louvre, Notre-Dame, and the Eiffel Tower from a unique perspective.\n\n6. Champs-Élysées: Visit this famous avenue lined with shops, cafes, and theaters. Don't forget to check out the Arc de Triomphe at its end.\n\n7. Palace of Versailles: Take a day trip from Paris to explore the opulent palace and gardens of Versailles, a UNESCO World Heritage site.\n\n8. Sacré-Cœur Basilica: Located at the highest point in the city, this basilica offers panoramic views of Paris.\n\n9. Latin Quarter: Stroll through this historic and vibrant neighborhood, famous for its student life, lively atmosphere, and cafes.\n\n10. Musée d'Orsay: Visit this museum, housing an impressive collection of Impressionist and Post-Impressionist art, including works by Monet, Degas, Renoir, and Van Gogh."
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 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](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks). 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.
|
|
@ -0,0 +1,8 @@
|
|||
path:
|
||||
container_name: models
|
||||
container_path: huggingface/phi-3.5-MoE-128k-instruct/20240812/mlflow_model_folder
|
||||
storage_name: automlcesdkdataresources
|
||||
type: azureblob
|
||||
publish:
|
||||
description: description.md
|
||||
type: mlflow_model
|
|
@ -0,0 +1,55 @@
|
|||
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
|
||||
name: Phi-3.5-MoE-instruct
|
||||
path: ./
|
||||
properties:
|
||||
SharedComputeCapacityEnabled: true
|
||||
languages: en
|
||||
inference-min-sku-spec: 48|2|440|128
|
||||
inference-recommended-sku: Standard_NC48ads_A100_v4, Standard_NC96ads_A100_v4, Standard_ND96amsr_A100_v4
|
||||
tags:
|
||||
freePlayground: "false"
|
||||
displayName: "Phi-3.5 MoE instruct (128k)"
|
||||
summary: "A new mixture of experts model"
|
||||
textContextWindow: 131072
|
||||
maxOutputTokens: 4096
|
||||
languages: "en"
|
||||
inputModalities: "text"
|
||||
trainingDataDate: "Aug 2024"
|
||||
keywords: "Reasoning,Understanding,Low latency"
|
||||
licenseDescription: "Microsoft.\nCopyright (c) Microsoft Corporation.\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
|
||||
playgroundRateLimitTier: "low"
|
||||
Featured: ""
|
||||
Preview: ""
|
||||
huggingface_model_id: ""
|
||||
license: mit
|
||||
disable-batch: "true"
|
||||
task: chat-completion
|
||||
author: microsoft
|
||||
SharedComputeCapacityEnabled : ""
|
||||
hiddenlayerscanned : ""
|
||||
_aml_system_vanity_registry: "azureml-phi"
|
||||
inference_compute_allow_list:
|
||||
[
|
||||
Standard_NC48ads_A100_v4,
|
||||
Standard_ND96amsr_A100_v4,
|
||||
Standard_NC96ads_A100_v4
|
||||
]
|
||||
inference_supported_envs:
|
||||
- vllm
|
||||
model_specific_defaults:
|
||||
apply_deepspeed: "true"
|
||||
deepspeed_stage: 2
|
||||
apply_lora: "true"
|
||||
apply_ort: "false"
|
||||
precision: 16
|
||||
ignore_mismatched_sizes: "false"
|
||||
num_train_epochs: 1
|
||||
per_device_train_batch_size: 1
|
||||
per_device_eval_batch_size: 1
|
||||
gradient_accumulation_steps: 1
|
||||
learning_rate: 5e-6
|
||||
lr_scheduler_type: "cosine"
|
||||
logging_strategy: "steps"
|
||||
logging_steps: 10
|
||||
save_total_limit: 1
|
||||
version: 2
|
|
@ -0,0 +1,4 @@
|
|||
extra_config: model.yaml
|
||||
spec: spec.yaml
|
||||
type: model
|
||||
categories: ["Foundation Models", "Chat Completion", "Phi"]
|
|
@ -0,0 +1,155 @@
|
|||
Phi-3.5-vision is a lightweight, state-of-the-art open multimodal model built upon datasets which include - synthetic data and filtered publicly available websites - with a focus on very high-quality, reasoning dense data both on text and vision. The model belongs to the Phi-3 model family, and the multimodal version comes with 128K context length (in tokens) it can support. The model underwent a rigorous enhancement process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
|
||||
|
||||
### Resources
|
||||
🏡 [Phi-3 Portal](https://azure.microsoft.com/en-us/products/phi-3) <br>
|
||||
📰 [Phi-3 Microsoft Blog](https://aka.ms/phi3.5-techblog) <br>
|
||||
📖 [Phi-3 Technical Report](https://arxiv.org/abs/2404.14219) <br>
|
||||
👩🍳 [Phi-3 Cookbook](https://github.com/microsoft/Phi-3CookBook) <br>
|
||||
|
||||
### Model Summary
|
||||
| | |
|
||||
|------|------|
|
||||
| **Architecture** | Phi-3.5-vision has 4.2B parameters and contains image encoder, connector, projector, and Phi-3 Mini language model. |
|
||||
| **Inputs** | Text and Image. It’s best suited for prompts using the chat format. |
|
||||
| **Context length** | 128K tokens |
|
||||
| **GPUs** | 256 A100-80G |
|
||||
| **Training time** | 6 days |
|
||||
| **Training data** | 500B tokens (vision tokens + text tokens) |
|
||||
| **Outputs** | Generated text in response to the input |
|
||||
| **Dates** | Trained between July and August 2024 |
|
||||
| **Status** | This is a static model trained on an offline text dataset with cutoff date March 15, 2024. Future versions of the tuned models may be released as we improve models. |
|
||||
| **Release date** | August 20, 2024 |
|
||||
| **License** | MIT |
|
||||
|
||||
## Release Notes
|
||||
|
||||
In this release, the model enables multi-frame image understanding and reasoning which is based on valuable customer feedback. The hero example multi-frame capabilities include detailed image comparison, multi-image summarization/storytelling and video summarization, which have broad applications in many scenarios. We also observed performance improvement on most single image benchmarks, e.g., boosting MMMU performance from 40.2 to 43.0, MMBench performance from 80.5 to 81.9, document understanding benchmark TextVQA from 70.9 to 72.0. We believe most use cases will benefit from this release, but we encourage users to test the new model in their AI applications. We appreciate the enthusiastic adoption of the Phi-3 model family and continue to welcome all the feedback from the community.
|
||||
|
||||
Below are the comparison results on existing multi-image benchmarks. On average, our model outperforms competitor models on the same size and competitive with much bigger models on multi-frame capabilities and video summarization.
|
||||
|
||||
BLINK: a benchmark with 14 visual tasks that humans can solve very quickly but are still hard for current multimodal LLMs.
|
||||
|
||||
| Benchmark | Phi-3.5-vision-instrust | LlaVA-Interleave-Qwen-7B | InternVL-2-4B | InternVL-2-8B | Gemini-1.5-Flash | GPT-4o-mini | Claude-3.5-Sonnet | Gemini-1.5-Pro | GPT-4o |
|
||||
|--|--|--|--|--|--|--|--|--|--|
|
||||
| Art Style | 87.2 | 62.4 | 55.6 | 52.1 | 64.1 | 70.1 | 59.8 | 70.9 | 73.3 |
|
||||
| Counting | 54.2 | 56.7 | 54.2 | 66.7 | 51.7 | 55.0 | 59.2 | 65.0 | 65.0 |
|
||||
| Forensic Detection | 92.4 | 31.1 | 40.9 | 34.1 | 54.5 | 38.6 | 67.4 | 60.6 | 75.8 |
|
||||
| Functional Correspondence | 29.2 | 34.6 | 24.6 | 24.6 | 33.1 | 26.9 | 33.8 | 31.5 | 43.8 |
|
||||
| IQ Test | 25.3 | 26.7 | 26.0 | 30.7 | 25.3 | 29.3 | 26.0 | 34.0 | 19.3 |
|
||||
| Jigsaw | 68.0 | 86.0 | 55.3 | 52.7 | 71.3 | 72.7 | 57.3 | 68.0 | 67.3 |
|
||||
| Multi-View Reasoning | 54.1 | 44.4 | 48.9 | 42.9 | 48.9 | 48.1 | 55.6 | 49.6 | 46.6 |
|
||||
| Object Localization | 49.2 | 54.9 | 53.3 | 54.1 | 57.3 | 57.4 | 62.3 | 65.6 | 68.0 |
|
||||
| Relative Depth | 69.4 | 77.4 | 63.7 | 67.7 | 32.8 | 58.1 | 71.8 | 76.6 | 71.0 |
|
||||
| Relative Reflectance | 37.3 | 34.3 | 32.8 | 38.8 | 32.8 | 27.6 | 36.6 | 38.8 | 40.3 |
|
||||
| Semantic Correspondence | 36.7 | 31.7 | 31.7 | 22.3 | 32.4 | 31.7 | 45.3 | 48.9 | 54.0 |
|
||||
| Spatial Relation | 65.7 | 75.5 | 78.3 | 78.3 | 55.9 | 81.1 | 60.1 | 79.0 | 84.6 |
|
||||
| Visual Correspondence | 53.5 | 40.7 | 34.9 | 33.1 | 29.7 | 52.9 | 72.1 | 81.4 | 86.0 |
|
||||
| Visual Similarity | 83.0 | 91.9 | 48.1 | 45.2 | 47.4 | 77.8 | 84.4 | 81.5 | 88.1 |
|
||||
| **Overall** | **57.0** | **53.1** | **45.9** | **45.4** | **45.1** | **51.9** | **56.5** | **61.0** | **63.2** |
|
||||
|
||||
Video-MME: comprehensively assess the capabilities of MLLMs in processing video data, covering a wide range of visual domains, temporal durations, and data modalities.
|
||||
|
||||
| Benchmark | Phi-3.5-vision-instrust | LlaVA-Interleave-Qwen-7B | InternVL-2-4B | InternVL-2-8B | Gemini-1.5-Flash | GPT-4o-mini | Claude-3.5-Sonnet | Gemini-1.5-Pro | GPT-4o |
|
||||
|--|--|--|--|--|--|--|--|--|--|
|
||||
| short (<2min) | 60.8 | 62.3 | 60.7 | 61.7 | 72.2 | 70.1 | 66.3 | 73.3 | 77.7 |
|
||||
| medium (4-15min) | 47.7 | 47.1 | 46.4 | 49.6 | 62.7 | 59.6 | 54.7 | 61.2 | 68.0 |
|
||||
| long (30-60) | 43.8 | 41.2 | 42.6 | 46.6 | 52.1 | 53.9 | 46.6 | 53.2 | 59.6 |
|
||||
| **Overall** | **50.8** | **50.2** | **49.9** | **52.6** | **62.3** | **61.2** | **55.9** | **62.6** | **68.4** |
|
||||
|
||||
|
||||
## Intended Use
|
||||
|
||||
### 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 with visual and text input capabilities which require:
|
||||
|
||||
1) Memory/compute constrained environments
|
||||
2) Latency bound scenarios
|
||||
3) General image understanding
|
||||
4) Optical character recognition
|
||||
5) Chart and table understanding
|
||||
6) Multiple image comparison
|
||||
7) Multi-image or video clip summarization
|
||||
|
||||
Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.
|
||||
|
||||
### Out-of-Scope Use Cases
|
||||
|
||||
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.**
|
||||
|
||||
## Responsible AI Considerations
|
||||
|
||||
Like other models, the Phi family of 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.
|
||||
|
||||
Developers should apply responsible AI best practices and are responsible for ensuring that a specific use case complies with relevant laws and regulations (e.g. privacy, trade, etc.). Important areas for consideration include:
|
||||
|
||||
* 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.
|
||||
* Identification of individuals: models with vision capabilities may have the potential to uniquely identify individuals in images. Safety post-training steers the model to refuse such requests, but developers should consider and implement, as appropriate, additional mitigations or user consent flows as required in their respective jurisdiction, (e.g., building measures to blur faces in image inputs before processing).
|
||||
|
||||
## Training Data
|
||||
|
||||
Our training data includes a wide variety of sources, and is a combination of
|
||||
1) publicly available documents filtered rigorously for quality, selected high-quality educational data and code;
|
||||
2) selected high-quality image-text interleave data;
|
||||
3) 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.), newly created image data, e.g., chart/table/diagram/slides, newly created multi-image and video data, e.g., short video clips/pair of two similar images;
|
||||
4) high quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
|
||||
|
||||
The data collection process involved sourcing information from publicly available documents, with a meticulous approach to filtering out undesirable documents and images. To safeguard privacy, we carefully filtered various image and text data sources to remove or scrub any potentially personal data from the training data.
|
||||
|
||||
## Sample Inputs and Outputs (for real-time inference)
|
||||
|
||||
### Sample Input
|
||||
|
||||
```json
|
||||
{
|
||||
"input_data": {
|
||||
"input_string": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": "https://www.ilankelman.org/stopsigns/australia.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "What are in these images? What is the difference between two images?"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"parameters": { "temperature": 0.7, "max_new_tokens": 2048 }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Sample Output
|
||||
|
||||
```json
|
||||
{
|
||||
"output": " The first image depicts a serene, natural landscape featuring a boardwalk winding through a marsh-like area with tall grasses and a clear sky. The second image shows an urban setting with a stop sign in the foreground, a black SUV parked on the street, and traditional Chinese architecture in the background, including a red and gold gate with Chinese characters. The main difference is the setting: one is natural and tranquil, the other is urban and bustling."
|
||||
}
|
||||
```
|
||||
|
||||
## 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](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks). 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.
|
|
@ -0,0 +1,8 @@
|
|||
path:
|
||||
container_name: models
|
||||
container_path: huggingface/phi-3.5-vision-128k-instruct/20240816/mlflow_model_folder
|
||||
storage_name: automlcesdkdataresources
|
||||
type: azureblob
|
||||
publish:
|
||||
description: description.md
|
||||
type: mlflow_model
|
|
@ -0,0 +1,56 @@
|
|||
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
|
||||
name: Phi-3.5-vision-instruct
|
||||
path: ./
|
||||
properties:
|
||||
SharedComputeCapacityEnabled: true
|
||||
languages: en
|
||||
inference-min-sku-spec: 24|1|220|64
|
||||
inference-recommended-sku: Standard_NC24ads_A100_v4, Standard_NC48ads_A100_v4, Standard_NC96ads_A100_v4, Standard_ND96amsr_A100_v4
|
||||
tags:
|
||||
freePlayground: "true"
|
||||
displayName: "Phi-3.5 vision instruct (128k)"
|
||||
summary: "Refresh of Phi-3-vision model."
|
||||
textContextWindow: 131072
|
||||
maxOutputTokens: 4096
|
||||
languages: "en"
|
||||
inputModalities: "text"
|
||||
trainingDataDate: "Aug 2024"
|
||||
keywords: "Reasoning,Understanding,Low latency"
|
||||
licenseDescription: "Microsoft.\nCopyright (c) Microsoft Corporation.\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
|
||||
playgroundRateLimitTier: "low"
|
||||
Featured: ""
|
||||
Preview: ""
|
||||
huggingface_model_id: ""
|
||||
license: mit
|
||||
disable-batch: "true"
|
||||
task: chat-completion
|
||||
author: microsoft
|
||||
SharedComputeCapacityEnabled : ""
|
||||
hiddenlayerscanned : ""
|
||||
_aml_system_vanity_registry: "azureml-phi"
|
||||
inference_compute_allow_list:
|
||||
[
|
||||
Standard_NC24ads_A100_v4,
|
||||
Standard_NC48ads_A100_v4,
|
||||
Standard_ND96amsr_A100_v4,
|
||||
Standard_NC96ads_A100_v4
|
||||
]
|
||||
inference_supported_envs:
|
||||
- vllm
|
||||
model_specific_defaults:
|
||||
apply_deepspeed: "true"
|
||||
deepspeed_stage: 2
|
||||
apply_lora: "true"
|
||||
apply_ort: "false"
|
||||
precision: 16
|
||||
ignore_mismatched_sizes: "false"
|
||||
num_train_epochs: 1
|
||||
per_device_train_batch_size: 1
|
||||
per_device_eval_batch_size: 1
|
||||
gradient_accumulation_steps: 1
|
||||
learning_rate: 5e-6
|
||||
lr_scheduler_type: "cosine"
|
||||
logging_strategy: "steps"
|
||||
logging_steps: 10
|
||||
save_total_limit: 1
|
||||
version: 2
|
Загрузка…
Ссылка в новой задаче