Model comparison

Llama 3.1-8B vs Phi-4 Mini

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

Last verified . 2 shared benchmarks.

Llama 3.1-8B Meta

23.0

Rank #352 Confirmed

Phi-4 Mini Microsoft

30.9

Rank #283 Reported

Summary

  • They share 2 benchmarks with published results for both. Llama 3.1-8B scores higher in 0 categories and Phi-4 Mini in 3 categories; 3 gaps are clear of the uncertainty.
  • The widest gap is in knowledge, where Phi-4 Mini leads 25.3 to 8.0.
  • Llama 3.1-8B is cheaper at $0.05 / $0.08 per million input/output tokens, against $0.075 / $0.30 for Phi-4 Mini.

Side by side

Llama 3.1-8B and Phi-4 Mini specifications
Llama 3.1-8BPhi-4 Mini
ProviderMetaMicrosoft
Noometry Index23.030.9
Released2024-07-232024-12-11
WeightsOpenOpen
Context window128K128K
Max output4K4K
Input $ / M tokens$0.05$0.075
Output $ / M tokens$0.08$0.30
Results tracked433

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

Category by category

Coding Phi-4 Mini leads

Llama 3.1-8B: 20.2 (#340), Phi-4 Mini: 28.1 (#317)

Coding benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
SciCode13.2%10.8%
WeirdML1.7%—
BigCodeBench Instruct32.8%—
LMArena Coding1195—
BigCodeBench Complete40.5%—
HumanEval+62.8%—
MBPP+55.6%—

Agentic & Tool Use Not comparable

Llama 3.1-8B: 22.5 (#131), Phi-4 Mini: —

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

Reasoning Phi-4 Mini leads

Llama 3.1-8B: 14.9 (#321), Phi-4 Mini: 22.4 (#195)

Reasoning benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
CritPt0%0%
Chess Puzzles0%—
LMArena Hard Prompts1175—
DTBench50.9%—
LMCA5.4%—
Epoch Capabilities Index116.57—
PIQA81.2%—

Math Not comparable

Llama 3.1-8B: 10.2 (#317), Phi-4 Mini: —

Math benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
OTIS Mock AIME 2024-20251.7%—
Omni-MATH13.7%—
LMArena Math1179—
MATH Level 522.9%—
GSM8K82.4%—

Knowledge Phi-4 Mini leads

Llama 3.1-8B: 8.0 (#307), Phi-4 Mini: 25.3 (#262)

Knowledge benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
GPQA Diamond27%—
MMLU-Pro40.6%—
Vectara Hallucination Rate—23.5%
GPQA (HELM)24.7%—
LMArena Expert1144—
BoolQ82.8%—
MMLU56.1%—

Multilingual Not comparable

Llama 3.1-8B: 34.0 (#249), Phi-4 Mini: —

Multilingual benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
LMArena Non-English1148—
LMArena Chinese1151—
LMArena French1177—
LMArena German1144—
LMArena Japanese1061—
LMArena Korean1053—
LMArena Russian1158—
LMArena Spanish1169—

Instruction Following Not comparable

Llama 3.1-8B: 58.9 (#258), Phi-4 Mini: —

Instruction Following benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
IFEval74.3%—
LMArena Instruction Following1159—

Long Context Not comparable

Llama 3.1-8B: 35.8 (#238), Phi-4 Mini: —

Long Context benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
LMArena Longer Query1182—

Writing & Preference Not comparable

Llama 3.1-8B: 29.7 (#290), Phi-4 Mini: —

Writing & Preference benchmarks
BenchmarkLlama 3.1-8BPhi-4 Mini
LMArena Text1187—
LMArena Creative Writing1154—
EQ-Bench Creative Writing713—
WildBench68.7%—
LMArena Multi-Turn1172—

Frequently asked questions

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

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

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

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

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

Phi-4 Mini scores higher on coding benchmarks: 28.1 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 Mini share?

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

Related comparisons

Go deeper