← back to the herd
P3

microsoft/Phi-3.5-mini-instruct

Text Generation

300.7k downloads 1.1k brands mit updated 9 months ago

Model card

Text Generation model on the open range. Tagged transformers, safetensors, phi3, text-generation. Pull it straight from microsoft/Phi-3.5-mini-instruct.

πŸŽ‰**Phi-4**: [[multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) | [onnx](https://huggingface.co/microsoft/Phi-4-multimodal-instruct-onnx)]; 
[[mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct) | [onnx](https://huggingface.co/microsoft/Phi-4-mini-instruct-onnx)]

## Model Summary

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.

🏑 [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>
πŸ–₯️ [Try It](https://aka.ms/try-phi3.5mini) <br>

**Phi-3.5**: [[mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) | [onnx](https://huggingface.co/microsoft/Phi-3.5-mini-instruct-onnx)]; [[MoE-instruct]](https://huggingface.co/microsoft/Phi-3.5-MoE-instruct); [[vision-instruct]](https://huggingface.co/microsoft/Phi-3.5-vision-instruct)

## Intended Uses

### Primary Use Cases

The model is intended for 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. 

### 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.*** 

## Release Notes 

This is an update over the June 2024 instruction-tuned Phi-3 Mini release based on valuable user feedback. The model used additional post-training 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 the 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  competitive on multilingual tasks in comparison to other models with a much bigger active parameters.  

| Benchmark                  | Phi-3.5 Mini-Ins | Phi-3.0-Mini-128k-Instruct (June2024) | 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             | 

Install it

# python
pip install -U huggingface_hub
huggingface-cli download microsoft/Phi-3.5-mini-instruct

# or in code
from transformers import pipeline
pipe = pipeline(model="microsoft/Phi-3.5-mini-instruct")

Files and versions

  • .gitattributes
  • CODE_OF_CONDUCT.md
  • LICENSE
  • NOTICE.md
  • README.md
  • SECURITY.md
  • added_tokens.json
  • config.json
  • configuration_phi3.py
  • data_summary_card.md
  • generation_config.json
  • model-00001-of-00002.safetensors
  • model-00002-of-00002.safetensors
  • model.safetensors.index.json
  • modeling_phi3.py
  • sample_finetune.py
  • special_tokens_map.json
  • tokenizer.json
  • tokenizer.model
  • tokenizer_config.json