Model comparison

Gemma 4 31B IT vs Llama 3.1-8B

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

Last verified . 24 shared benchmarks.

Gemma 4 31B IT Google

43.5

Rank #90 Confirmed

Llama 3.1-8B Meta

23.0

Rank #352 Confirmed

Summary

  • They share 24 benchmarks with published results for both. Gemma 4 31B IT scores higher in 8 categories and Llama 3.1-8B in 0 categories; 8 gaps are clear of the uncertainty.
  • The widest gap is in math, where Gemma 4 31B IT leads 43.2 to 10.2.
  • The biggest single-benchmark swing is OTIS Mock AIME 2024-2025: 73.3% for Gemma 4 31B IT and 1.7% for Llama 3.1-8B.
  • Llama 3.1-8B is cheaper at $0.05 / $0.08 per million input/output tokens, against $0.09 / $0.34 for Gemma 4 31B IT.
  • Gemma 4 31B IT accepts more context: 262K tokens versus 128K.

Side by side

Gemma 4 31B IT and Llama 3.1-8B specifications
Gemma 4 31B ITLlama 3.1-8B
ProviderGoogleMeta
Noometry Index43.523.0
Released2026-04-022024-07-23
WeightsOpenOpen
Context window262K128K
Max output33K4K
Input $ / M tokens$0.09$0.05
Output $ / M tokens$0.34$0.08
Results tracked3543

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

Category by category

Coding Gemma 4 31B IT leads

Gemma 4 31B IT: 42.3 (#108), Llama 3.1-8B: 20.2 (#340)

Coding benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
SciCode43.4%13.2%
WeirdML52.3%1.7%
LMArena Coding14591195
LMArena WebDev1366—
BigCodeBench Instruct—32.8%
BigCodeBench Complete—40.5%
ALE-Bench925.5—
HumanEval+—62.8%
MBPP+—55.6%

Agentic & Tool Use Not comparable

Gemma 4 31B IT: —, Llama 3.1-8B: 22.5 (#131)

Agentic & Tool Use benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
Berkeley Function Calling Leaderboard—25.8%
BALROG—15.1%

Reasoning Gemma 4 31B IT leads

Gemma 4 31B IT: 27.2 (#122), Llama 3.1-8B: 14.9 (#321)

Reasoning benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
CritPt1.4%0%
Chess Puzzles5%0%
LMArena Hard Prompts14481175
DTBench82.7%50.9%
LMCA39.3%5.4%
Epoch Capabilities Index142.74116.57
Kagi LLM Benchmark63.5%—
NYT Connections (extended)70.6%—
Thematic Generalization53%—
Surface Evolver Bench30.6%—
PIQA—81.2%

Math Gemma 4 31B IT leads

Gemma 4 31B IT: 43.2 (#81), Llama 3.1-8B: 10.2 (#317)

Math benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
OTIS Mock AIME 2024-202573.3%1.7%
LMArena Math14651179
Omni-MATH—13.7%
MATH Level 5—22.9%
GSM8K—82.4%

Knowledge Gemma 4 31B IT leads

Gemma 4 31B IT: 37.9 (#151), Llama 3.1-8B: 8.0 (#307)

Knowledge benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
GPQA Diamond75.8%27%
LMArena Expert14651144
SimpleQA Verified10.4%—
MMLU-Pro—40.6%
Vectara Hallucination Rate7.4%—
GPQA (HELM)—24.7%
BoolQ—82.8%
MMLU—56.1%

Multimodal Not comparable

Gemma 4 31B IT: 41.6 (#34), Llama 3.1-8B: —

Multimodal benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
LMArena Vision1277—
LMArena Document1425—

Multilingual Gemma 4 31B IT leads

Gemma 4 31B IT: 53.8 (#57), Llama 3.1-8B: 34.0 (#249)

Multilingual benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
LMArena Non-English14311148
LMArena Chinese14761151
LMArena French14351177
LMArena Russian14601158
LMArena Spanish14441169
LMArena German—1144
LMArena Japanese—1061
LMArena Korean—1053

Instruction Following Gemma 4 31B IT leads

Gemma 4 31B IT: 75.5 (#61), Llama 3.1-8B: 58.9 (#258)

Instruction Following benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
LMArena Instruction Following14331159
IFEval—74.3%

Long Context Gemma 4 31B IT leads

Gemma 4 31B IT: 44.2 (#71), Llama 3.1-8B: 35.8 (#238)

Long Context benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
LMArena Longer Query14461182

Writing & Preference Gemma 4 31B IT leads

Gemma 4 31B IT: 60.5 (#96), Llama 3.1-8B: 29.7 (#290)

Writing & Preference benchmarks
BenchmarkGemma 4 31B ITLlama 3.1-8B
LMArena Text14431187
LMArena Creative Writing14151154
EQ-Bench Creative Writing1368713
LMArena Multi-Turn14521172
WildBench—68.7%
EQ-Bench 41120—

Frequently asked questions

Is Gemma 4 31B IT better than Llama 3.1-8B?

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

Which is cheaper, Gemma 4 31B IT or Llama 3.1-8B?

Llama 3.1-8B is cheaper. It lists at $0.05 per million input tokens and $0.08 per million output tokens; Gemma 4 31B IT lists at $0.09 and $0.34.

Is Gemma 4 31B IT or Llama 3.1-8B better for coding?

Gemma 4 31B IT scores higher on coding benchmarks: 42.3 versus 20.2 in the Noometry coding category.

Which has the bigger context window?

Gemma 4 31B IT does, with 262K tokens against 128K.

How many benchmarks do Gemma 4 31B IT and Llama 3.1-8B share?

24 benchmarks have published results for both models. Gemma 4 31B IT has 35 scored results on Noometry and Llama 3.1-8B has 43.

Related comparisons

Go deeper