Model comparison

Llama 3.1-8B vs Phi-4

Phi-4 is the stronger model overall, scoring 31.2 to 23.0 on the Noometry Index. Llama 3.1-8B costs 1.5× less per token, which makes it the better buy when Phi-4's lead doesn't matter for your workload.

Last verified . 27 shared benchmarks.

Llama 3.1-8B Meta

23.0

Rank #352 Confirmed

Phi-4 Microsoft

31.2

Rank #279 Confirmed

Summary

  • They share 27 benchmarks with published results for both. Llama 3.1-8B scores higher in 0 categories and Phi-4 in 9 categories; 8 gaps are clear of the uncertainty.
  • The widest gap is in knowledge, where Phi-4 leads 32.6 to 8.0.
  • The biggest single-benchmark swing is MATH Level 5: 22.9% for Llama 3.1-8B and 64.9% for Phi-4.
  • Llama 3.1-8B is cheaper at $0.05 / $0.08 per million input/output tokens, against $0.07 / $0.14 for Phi-4.

Side by side

Llama 3.1-8B and Phi-4 specifications
Llama 3.1-8BPhi-4
ProviderMetaMicrosoft
Noometry Index23.031.2
Released2024-07-232024-12-11
WeightsOpenOpen
Context window128K128K
Max output4K4K
Input $ / M tokens$0.05$0.07
Output $ / M tokens$0.08$0.14
Results tracked4337

Sponsored placements are available on pages like this one. Advertise on Noometry

Category by category

Coding Phi-4 leads

Llama 3.1-8B: 20.2 (#340), Phi-4: 34.4 (#239)

Coding benchmarks
BenchmarkLlama 3.1-8BPhi-4
BigCodeBench Instruct32.8%45.5%
LMArena Coding11951231
BigCodeBench Complete40.5%55.4%
SciCode13.2%—
WeirdML1.7%—
LiveBench Coding—30.7%
HumanEval+62.8%—
MBPP+55.6%—

Agentic & Tool Use Too close to call

Llama 3.1-8B: 22.5 (#131), Phi-4: 22.8 (#128)

Agentic & Tool Use benchmarks
BenchmarkLlama 3.1-8BPhi-4
Berkeley Function Calling Leaderboard25.8%28.8%
BALROG15.1%11.6%

Reasoning Phi-4 leads

Llama 3.1-8B: 14.9 (#321), Phi-4: 17.7 (#291)

Reasoning benchmarks
BenchmarkLlama 3.1-8BPhi-4
Chess Puzzles0%1%
LMArena Hard Prompts11751220
Epoch Capabilities Index116.57130.42
CritPt0%—
LiveBench Reasoning—47.8%
DTBench50.9%—
LiveBench Data Analysis—45.2%
LMCA5.4%—
LiveBench—41.6%
PIQA81.2%—

Math Phi-4 leads

Llama 3.1-8B: 10.2 (#317), Phi-4: 20.8 (#285)

Math benchmarks
BenchmarkLlama 3.1-8BPhi-4
OTIS Mock AIME 2024-20251.7%13.8%
LMArena Math11791246
MATH Level 522.9%64.9%
Omni-MATH13.7%—
LiveBench Math—42%
GSM8K82.4%—

Knowledge Phi-4 leads

Llama 3.1-8B: 8.0 (#307), Phi-4: 32.6 (#209)

Knowledge benchmarks
BenchmarkLlama 3.1-8BPhi-4
GPQA Diamond27%56.1%
LMArena Expert11441203
MMLU56.1%84.8%
MMLU-Pro40.6%—
Confabulations—29.4%
Vectara Hallucination Rate—3.7%
GPQA (HELM)24.7%—
BoolQ82.8%—

Multilingual Phi-4 leads

Llama 3.1-8B: 34.0 (#249), Phi-4: 37.2 (#237)

Multilingual benchmarks
BenchmarkLlama 3.1-8BPhi-4
LMArena Non-English11481197
LMArena Chinese11511212
LMArena French11771224
LMArena German11441222
LMArena Japanese10611158
LMArena Korean10531151
LMArena Russian11581209
LMArena Spanish11691234

Instruction Following Phi-4 leads

Llama 3.1-8B: 58.9 (#258), Phi-4: 60.4 (#251)

Instruction Following benchmarks
BenchmarkLlama 3.1-8BPhi-4
LMArena Instruction Following11591201
LiveBench Instruction Following—58.4%
IFEval74.3%—

Long Context Phi-4 leads

Llama 3.1-8B: 35.8 (#238), Phi-4: 36.9 (#226)

Long Context benchmarks
BenchmarkLlama 3.1-8BPhi-4
LMArena Longer Query11821217

Writing & Preference Phi-4 leads

Llama 3.1-8B: 29.7 (#290), Phi-4: 40.5 (#244)

Writing & Preference benchmarks
BenchmarkLlama 3.1-8BPhi-4
LMArena Text11871217
LMArena Creative Writing11541182
LMArena Multi-Turn11721206
Short-Story Creative Writing—62.6%
EQ-Bench Creative Writing713—
WildBench68.7%—
LiveBench Language—25.6%

Frequently asked questions

Is Llama 3.1-8B better than Phi-4?

Phi-4 is the stronger model overall, scoring 31.2 to 23.0 on the Noometry Index. Llama 3.1-8B costs 1.5× less per token, which makes it the better buy when Phi-4's lead doesn't matter for your workload.

Which is cheaper, Llama 3.1-8B or Phi-4?

Llama 3.1-8B is cheaper. It lists at $0.05 per million input tokens and $0.08 per million output tokens; Phi-4 lists at $0.07 and $0.14.

Is Llama 3.1-8B or Phi-4 better for coding?

Phi-4 scores higher on coding benchmarks: 34.4 versus 20.2 in the Noometry coding category.

Which has the bigger context window?

Both accept 128K tokens.

How many benchmarks do Llama 3.1-8B and Phi-4 share?

27 benchmarks have published results for both models. Llama 3.1-8B has 43 scored results on Noometry and Phi-4 has 37.

Related comparisons

Go deeper