phi-4

Maintained By
microsoft

Microsoft phi-4

PropertyValue
Parameter Count14 Billion
Context Length16K tokens
Training Data9.8T tokens
LicenseMIT
Release DateDecember 12, 2024
Model URLHuggingFace

What is phi-4?

Phi-4 is Microsoft's latest state-of-the-art language model, designed to deliver powerful AI capabilities in a relatively compact 14B parameter architecture. The model represents a significant advancement in efficient AI design, trained on a carefully curated blend of synthetic datasets, filtered public domain content, and high-quality academic materials.

Implementation Details

Built as a dense decoder-only Transformer model, phi-4 was trained over 21 days using 1920 H100-80G GPUs. The model leverages advanced training techniques including supervised fine-tuning and direct preference optimization to ensure both high performance and robust safety measures.

  • Architecture: Dense decoder-only Transformer
  • Training Duration: 21 days
  • Hardware: 1920 H100-80G GPUs
  • Context Window: 16K tokens

Core Capabilities

  • Advanced reasoning and logic processing
  • Strong performance in math and science tasks (84.8% on MMLU)
  • Excellent code generation capabilities (82.6% on HumanEval)
  • Enhanced safety features through multi-stage alignment
  • Optimized for memory-constrained environments

Frequently Asked Questions

Q: What makes this model unique?

Phi-4 stands out for its exceptional performance-to-size ratio, achieving competitive results against much larger models while maintaining a relatively compact 14B parameter size. It shows particularly strong capabilities in reasoning, math, and code generation tasks.

Q: What are the recommended use cases?

The model is ideal for scenarios requiring strong reasoning capabilities, memory-constrained environments, and latency-sensitive applications. It's particularly well-suited for research purposes and as a building block for generative AI features, especially in English language applications.

🍰 Interesting in building your own agents?
PromptLayer provides Huggingface integration tools to manage and monitor prompts with your whole team. Get started here.