microsoft/phi-2

text-generation model by microsoft

Open original source ↗

From the publisher

Model card & documentation

Source preview

Read the publisher’s intended use, setup instructions, evaluations and limitations. The original model card is the source of truth.

Phi-2 is a Transformer with 2.7 billion parameters. It was trained using the same data sources as Phi-1.5, augmented with a new data source that consists of various NLP synthetic texts and filtered websites (for safety and educational value). When assessed against benchmarks testing common sense, language understanding, and logical reasoning, Phi-2 showcased a nearly state-of-the-art performance among models with less than 13 billion parameters. Our model hasn't been fine-tuned through reinforcement learning from human feedback. The intention behind crafting this open-source model is to provide the research community with a non-restricted small model to explore vital safety challenges, such as reducing toxicity, understanding societal biases, enhancing controllability, and more. Phi-2 has been integrated in the transformers version 4.37.0, please ensure that you are using a version equal or higher than it. Phi-2 is known for having an attention overflow issue (with FP16). If you are facing this issue, please…

microsoft/phi-2 on Hugging Face A short preview, not the full document.

Read the full model card ↗ · Preview checked 2026-10-31T02:22:07.556Z

Inside the original model card — Document outline
  1. Model Summary
  2. How to Use
  3. Intended Uses
  4. QA Format:
  5. Chat Format:
  6. Code Format:
  7. Sample Code
  8. Limitations of Phi-2
  9. Training
  10. Model
  11. Software
  12. License

Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.

Links from the model card

References supplied by the publisher, not independently verified endorsements. Check the destination before downloading files or entering credentials.

Documentation belongs to its respective authors. Reported project/model license: mit. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.

Model overview

microsoft/phi-2 is a text-generation model repository published by microsoft on Hugging Face. The source reports the transformers library.

This page summarizes Hub metadata. For intended use, training data, evaluation results and limitations, consult the original model card.

Model facts

Task
text-generation
Library
transformers
Recent downloads (30 days)
319,521
Cumulative likes
3,533
Hugging Face trending score
0
Reported safetensors parameters
2,779,683,840
Architecture
PhiForCausalLM
License
mit
Access
Not gated by Hugging Face
Created
2023-12-13T21:19:59.000Z
Last modified
2025-12-08T11:35:44.000Z

Compatibility and lineage

Reported languages: en

Base-model lineage was not included.

Parameter count is not a RAM/VRAM requirement. Check precision, quantization, context length and runtime compatibility in the model card; no hardware or API-cost claim is inferred here.

Use and evaluate

Check license terms and access requirements first. Review the model card’s documented loading instructions, evaluations and safety limitations. Benchmark scores are not imported by this directory, and popularity is not an accuracy ranking.

No model weights are downloaded or executed by AltAPIs. Never enable remote model code without reviewing it.

Model card and usage instructions

Model files and configuration

Community discussion

Source and freshness

Source: Hugging Face Hub. Metadata observed 2026-11-01T06:50:33.901Z. Daily imports are snapshots, not real-time monitoring.

Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.

Open original source

Related models

openai-community/gpt2

Qwen/Qwen3-0.6B

Qwen/Qwen3-14B

Qwen/Qwen3-4B

Qwen/Qwen3-8B

deepseek-ai/DeepSeek-V3.2