# Gemma 3 4B vs Llama 3.1-8B

> Gemma 3 4B is the stronger model overall, scoring 27.9 to 22.8 on the Noometry Index.

- Canonical page: https://noometry.com/compare/gemma-3-4b-vs-llama-3-1-8b
- Last updated: 2026-10-10
- Shared benchmarks: 20

## Summary

- They share 20 benchmarks with published results for both. Gemma 3 4B scores higher in 7 categories and Llama 3.1-8B in 2 categories; 9 gaps are clear of the uncertainty.
- The widest gap is in coding, where Gemma 3 4B leads 35.3 to 19.9.
- The biggest single-benchmark swing is Berkeley Function Calling Leaderboard: 19.6% for Gemma 3 4B and 25.8% for Llama 3.1-8B.
- Gemma 3 4B is cheaper at $0.04 / $0.08 per million input/output tokens, against $0.05 / $0.08 for Llama 3.1-8B.
- Gemma 3 4B accepts more context: 131K tokens versus 128K.

## Snapshot

| | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| Provider | Google | Meta |
| Noometry Index | 27.9 | 22.8 |
| Rank | 320 | 347 |
| Context | 131K | 128K |
| Input $/M | $0.04 | $0.05 |
| Output $/M | $0.08 | $0.08 |
| Weights | Open | Open |

## Coding

- Gemma 3 4B: 35.3 (#214)
- Llama 3.1-8B: 19.9 (#335)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| LMArena Coding | 1230 | 1195 |
| SciCode | — | 13.2% |
| WeirdML | — | 1.7% |
| BigCodeBench Instruct | — | 32.8% |
| BigCodeBench Complete | — | 40.5% |
| HumanEval+ | — | 62.8% |
| MBPP+ | — | 55.6% |

## Agentic & Tool Use

- Gemma 3 4B: 20.7 (#134)
- Llama 3.1-8B: 22.3 (#123)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| Berkeley Function Calling Leaderboard | 19.6% | 25.8% |
| BALROG | — | 15.1% |

## Reasoning

- Gemma 3 4B: 12.7 (#330)
- Llama 3.1-8B: 14.5 (#316)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| Chess Puzzles | 0% | 0% |
| LMArena Hard Prompts | 1253 | 1175 |
| DTBench | 50.9% | 50.9% |
| LMCA | 2.8% | 5.4% |
| Epoch Capabilities Index | 116.02 | 116.48 |
| Kagi LLM Benchmark | 25.2% | — |
| CritPt | — | 0% |
| PIQA | — | 81.2% |

## Math

- Gemma 3 4B: 15.8 (#286)
- Llama 3.1-8B: 9.5 (#311)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| OTIS Mock AIME 2024-2025 | 7.5% | 1.7% |
| LMArena Math | 1239 | 1179 |
| Omni-MATH | — | 13.7% |
| MATH Level 5 | — | 22.9% |
| GSM8K | — | 82.4% |

## Knowledge

- Gemma 3 4B: 11.8 (#294)
- Llama 3.1-8B: 8.0 (#302)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| GPQA Diamond | 23.2% | 27% |
| LMArena Expert | 1223 | 1144 |
| MMLU-Pro | — | 40.6% |
| Vectara Hallucination Rate | 6.4% | — |
| GPQA (HELM) | — | 24.7% |
| BoolQ | — | 82.8% |
| MMLU | — | 56.1% |

## Multilingual

- Gemma 3 4B: 42.7 (#189)
- Llama 3.1-8B: 34.2 (#244)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| LMArena Non-English | 1273 | 1148 |
| LMArena German | 1281 | 1144 |
| LMArena Russian | 1294 | 1158 |
| LMArena Chinese | — | 1151 |
| LMArena French | — | 1176 |
| LMArena Japanese | — | 1061 |
| LMArena Korean | — | 1053 |
| LMArena Spanish | — | 1169 |

## Instruction Following

- Gemma 3 4B: 65.4 (#219)
- Llama 3.1-8B: 59.1 (#253)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| LMArena Instruction Following | 1239 | 1159 |
| IFEval | — | 74.3% |

## Long Context

- Gemma 3 4B: 38.6 (#189)
- Llama 3.1-8B: 35.8 (#233)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| LMArena Longer Query | 1274 | 1182 |

## Writing & Preference

- Gemma 3 4B: 42.2 (#234)
- Llama 3.1-8B: 29.9 (#285)

| Benchmark | Gemma 3 4B | Llama 3.1-8B |
|---|---|---|
| LMArena Text | 1291 | 1187 |
| LMArena Creative Writing | 1270 | 1154 |
| EQ-Bench Creative Writing | 1068 | 713 |
| LMArena Multi-Turn | 1255 | 1172 |
| WildBench | — | 68.7% |

## FAQ

### Is Gemma 3 4B better than Llama 3.1-8B?

Gemma 3 4B is the stronger model overall, scoring 27.9 to 22.8 on the Noometry Index.

### Which is cheaper, Gemma 3 4B or Llama 3.1-8B?

Gemma 3 4B is cheaper. It lists at $0.04 per million input tokens and $0.08 per million output tokens; Llama 3.1-8B lists at $0.05 and $0.08.

### Is Gemma 3 4B or Llama 3.1-8B better for coding?

Gemma 3 4B scores higher on coding benchmarks: 35.3 versus 19.9 in the Noometry coding category.

### Which has the bigger context window?

Gemma 3 4B does, with 131K tokens against 128K.

### How many benchmarks do Gemma 3 4B and Llama 3.1-8B share?

20 benchmarks have published results for both models. Gemma 3 4B has 22 scored results on Noometry and Llama 3.1-8B has 43.
