ApX logoApX logo

Phi-3-medium

Parameters

14B

Context Length

128K

Modality

Text

Architecture

Dense

License

MIT

Release Date

22 Apr 2024

Knowledge Cutoff

Oct 2023

API Pricing (per 1M)

Input: $0.17 · Output: $0.68

System Requirements

VRAM requirements for different quantization methods and context sizes

1,024 tokens

31.12 GB VRAM

Consumer

2x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

128,000 tokens

58.43 GB VRAM

Consumer

3x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

Architecture Diagram

Input TokensToken EmbeddingPosition: RoPEHidden: 5.1k · Context: 128K · Vocab: 32.1kx 40 layersRMSNormPre-AttentionGrouped-Query Attention40Q / 10KV heads · SW: 2kHead dim: 128+RMSNormPre-FFNFeed-Forward NetworkSwishIntermediate: 17.9k+Final RMSNormOutput Logits

Evaluation Benchmarks

Rank

#205

BenchmarkScoreRank

General Text

Text Arena

1198

159

Rankings

Overall Rank

#205

Coding Rank

-

About Phi-3-medium

Phi-3-medium is Microsoft's 14B parameter dense foundation model delivering advanced reasoning and code synthesis in compute-constrained environments. Optimized for ONNX Runtime, it supports extended context lengths up to 128K tokens.

Technical Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

40

Key-Value Heads

10

Attention Head Dimension

-

Position Embedding

ROPE

RoPE Theta

10,000

Sliding Window Attention

Yes

Sliding Window Size

2,047

Sliding Window Ratio

-

Linear Attention

-

Linear Attention Ratio

-

Normalization

RMS Normalization

Activation Function

Swish

Dimensions

Hidden Dimension Size

5,120

Number of Layers

40

FFN Intermediate Size (Dense)

17,920

Multi-Token Prediction Heads

-

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