ApX logoApX logo
CalculatorCoursesPricing

Phi-3-mini

Open Source
Open Weights

Parameters

3.8B

Context Length

4K

Modality

Text

Architecture

Dense

KV Cache Rate

96 KB/tok

License

MIT License

Release Date

22 Apr 2024

Knowledge Cutoff

Oct 2023

API Pricing (per 1M)

Input: $0.13 · Output: $0.52

Hardware & System Requirements

Precision

Context

Workload Memory: 4.64 GB

vLLM

INT4 · 4K context · 1 user

Base Weights: 1.77 GB

KV Cache: 0.38 GB

Runtime & Graphs: 2.50 GB

Minimum Required Hardware

1x NVIDIA L4 24GB

vLLM

4.6 / 21.6 GB

1x RTX 3060 12GB

llama.cpp

4.6 / 11.2 GB

Apple M4 24GB

llama.cpp

4.6 / 18.0 GB

Determine requirements for concurrent users or multi-node clusters:

Runtime compatibility

Verified on hardware and checkpoint files.

Checkpoint format

BF16

CUDA

13.0

PyTorch

2.14.0

Transformers

≥ 4.40.1

ArchitecturePrecisionKernel

Hopper

Native BF16

FlashAttention-3

Architecture Diagram

Input TokensToken EmbeddingPosition: RoPEHidden: 3.1k · Context: 4K · Vocab: 32.1kx 32 layersRMSNormPre-AttentionGrouped-Query Attention32Q / 8KV heads · SW: 2kHead dim: 96+RMSNormPre-FFNFeed-Forward NetworkSwishIntermediate: 8.2k+Final RMSNormOutput Logits

Evaluation Benchmarks

Rank

#244

BenchmarkScoreRank

General Text

Text Arena

1143.23

#195

Intelligence Index

Artificial Analysis

0.06

#328

Rankings

Overall Rank

#244

Coding Rank

-

About Phi-3-mini

Phi-3-mini is a lightweight 3.8B parameter dense language model developed by Microsoft for edge devices and mobile applications. It combines high reasoning density with LongRope context support extending up to 128K tokens.

Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

32

Key-Value Heads

8

Position Embedding

ROPE

RoPE Theta

10,000

Sliding Window Attention

Yes

Sliding Window Size

2,047

Normalization

RMS Normalization

Activation Function

Swish

Dimensions

Base Precision

BF16

Hidden Dimension Size

3,072

Number of Layers

32

FFN Intermediate Size (Dense)

8,192

Tokenizer

Vocabulary Size

32,064

About Phi-3

Microsoft's Phi-3 models are small language models designed for efficient operation on resource-constrained devices. They utilize a transformer decoder architecture and are trained on extensively filtered, high-quality data, including synthetic compositions. This approach enables a compact yet capable model family.


Other Phi-3 Models