ApX logoApX logo

Phi-2

Parameters

2.7B

Context Length

2K

Modality

Text

Architecture

Dense

License

MIT License

Release Date

12 Oct 2023

Knowledge Cutoff

-

API Pricing (per 1M)

Self-hosted only

System Requirements

VRAM requirements for different quantization methods and context sizes

1,024 tokens

7.73 GB VRAM

Consumer

1x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

2,048 tokens

8.30 GB VRAM

Consumer

1x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

Architecture Diagram

Input TokensToken EmbeddingPosition: RoPEHidden: 2k · Context: 2K · Vocab: 51.2kx 32 layersLayerNormPre-AttentionMulti-Head Attention32Q / 32KV headsHead dim: 64+LayerNormPre-FFNFeed-Forward NetworkGELUIntermediate: 10.2k+Final LayerNormOutput Logits

Evaluation Benchmarks

No evaluation benchmarks for Phi-2 available.

Rankings

Overall Rank

-

Coding Rank

-

About Phi-2

Phi-2 is Microsoft's 2.7B parameter small language model engineered for advanced reasoning, mathematical logic, and code generation. Trained on 1.4T textbook-quality tokens, it delivers benchmark performance rivaling significantly larger models.

Technical Specifications

Attention

Attention Structure

Multi-Head Attention

Attention Heads

32

Key-Value Heads

32

Attention Head Dimension

-

Position Embedding

ROPE

RoPE Theta

10,000

Sliding Window Attention

No

Sliding Window Size

-

Sliding Window Ratio

-

Linear Attention

-

Linear Attention Ratio

-

Normalization

Layer Normalization

Activation Function

GELU

Dimensions

Hidden Dimension Size

2,048

Number of Layers

32

FFN Intermediate Size (Dense)

10,240

Multi-Token Prediction Heads

-

Tokenizer

Vocabulary Size

51,200

About Phi-2

Microsoft's Phi-2 is a 2.7 billion parameter Transformer-based model, developed for efficient language understanding and reasoning. Its technical innovations include training on "textbook-quality" synthetic and filtered web data, alongside scaled knowledge transfer from its predecessor, Phi-1.5, facilitating emergent capabilities within a compact architecture.


Other Phi-2 Models
  • No related models available