Gemma 4 31B vs GPT-5
Updated October 21, 2026. 56 benchmarks have a result for both. Coding is ranked on the Vibe Coding Index; every other board is shown as published.
Decision reading
Pick GPT-5 for coding: it scores 72.2 on the Vibe Coding Index against 38.3 for Gemma 4 31B.
Pick Gemma 4 31B when output tokens cost 25.0x less, or when what matters is AA Coding Index or ALE-Bench, where it leads.
- Shared results
- 56
- Gemma 4 31B only
- 12
- GPT-5 only
- 53
- Like-for-like categories
- 7 of 9
Shared results can support a head-to-head reading. Results only one model has describe coverage, not superiority.
Which one for your work
Each card is decided by one number both models carry. Where only one has it, the card says so and makes no call.
Coding
Vibe Coding Index, four public coding benchmarks
GPT-5
GPT-5 scores 72.2 against 38.3.
2 and 3 benchmarks behind the scores
Intelligence
AA Intelligence Index
GPT-5
GPT-5 leads, 23.0 against 14.7.
Same board, both measured
Agentic work
AA Agentic Index
No call
Only Gemma 4 31B has a AA Agentic Index result, 4.2.
Directional only
Reasoning
GPQA Diamond
No call
Only GPT-5 has a GPQA Diamond result, 85.6%.
Directional only
Math
AIME
No call
Only GPT-5 has a AIME result, 93.4%.
Directional only
Knowledge
MMLU Pro
No call
Only GPT-5 has a MMLU Pro result, 86.5%.
Directional only
Web design
Design Arena: websites
No call
Only GPT-5 has a Design Arena: websites result, 1185.
Directional only
Long documents
Listed context window
GPT-5
GPT-5 takes 400K tokens against 262K.
Listed by OpenRouter
Everyday cost
1K input + 500 output tokens
Gemma 4 31B
Gemma 4 31B $0.0004, GPT-5 $0.0063 per turn.
List prices
Cost per solved task
One SWE-bench Verified task, solved
No call
Only GPT-5 has the number, $0.39.
Directional only
At a glance
- Coding index
- Gemma 4 31B 38.3 from 2 benchmarks, GPT-5 72.2 from 3 benchmarks.
- Widest category
- Agentic work, 21.1 points apart on average over 1 shared benchmark.
- Widest single gap
- SimpleQA Verified: Gemma 4 31B 10.4% against GPT-5 50.1%, 39.7 points apart on a 0 to 100 scale.
- Output price
- Gemma 4 31B $0.40 against GPT-5 $10.00 per million output tokens, 25.0x apart.
- Context window
- Gemma 4 31B takes 262K tokens, GPT-5 400K.
Benchmark by benchmark
First the score: boards each model leads, per category, where both have a result. Then every board, a category to a fold; bars are each result on a 0 to 100 scale, so compare the two in a row, not one row with another.
| Category | Gemma 4 31B | Bars | GPT-5 | Ties |
|---|---|---|---|---|
| Coding | 4 | 4 | ||
| Intelligence | 0 | 2 | ||
| Agentic work | 0 | 1 | ||
| Reasoning | 6 | 2 | ||
| Math | 2 | 1 | ||
| Knowledge | 4 | 3 | ||
| General | 23 | 4 | ||
| All shared boards | 39 | 17 |
CodingLike-for-likeFour of these boards feed the Vibe Coding Index44
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| Aider polyglot | Not measured | 88.0% | Only GPT-5 measured |
| SWE-bench Verified | Not measured | 74.4% | Only GPT-5 measured |
| LiveBench coding | 49.0% | Not measured | Only Gemma 4 31B measured |
| LMArena WebDev | 1367 | 1418 | GPT-5 |
| AA Coding Index | 43.4 | 37.8 | Gemma 4 31B |
| LiveCodeBench (Vals AI) | Not measured | 85.9% | Only GPT-5 measured |
| SWE-bench Verified (Vals AI) | Not measured | 69.0% | Only GPT-5 measured |
| Vibe Code Bench (Vals AI) | Not measured | 20.1% | Only GPT-5 measured |
| LiveCodeBench (Artificial Analysis run) | Not measured | 84.6% | Only GPT-5 measured |
| SciCode | 45.5% | Not measured | Only Gemma 4 31B measured |
| Terminal-Bench Hard (Artificial Analysis run) | 36.4% | 37.9% | GPT-5 |
| Terminal-Bench | Not measured | 49.6% | Only GPT-5 measured |
| GSO-Bench | Not measured | 6.9% | Only GPT-5 measured |
| WeirdML | 52.3% | 60.7% | GPT-5 |
| ALE-Bench | 925.5 | 807.6 | Gemma 4 31B |
| LMArena Text: coding | 1459 | 1436 | Gemma 4 31B |
| LMArena Text: software and IT | 1463 | 1420 | Gemma 4 31B |
| LMArena WebDev: React | 1359 | Not measured | Only Gemma 4 31B measured |
| LMArena WebDev: HTML | 1380 | 1427 | GPT-5 |
| Neither model has a result on the other 19 boards here | |||
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index02
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| AA Intelligence Index | 14.7 | 23.0 | GPT-5 |
| Epoch Capabilities Index | 143.0 | 150.0 | GPT-5 |
Agentic workLike-for-likePublic boards, shown as published, kept out of the index01
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| AA Agentic Index | 4.2 | Not measured | Only Gemma 4 31B measured |
| LiveBench research | 44.4% | Not measured | Only Gemma 4 31B measured |
| LiveBench browser | 4.0% | Not measured | Only Gemma 4 31B measured |
| LiveBench long agentic | 13.3% | Not measured | Only Gemma 4 31B measured |
| τ²-Bench Telecom | 65.5% | 86.5% | GPT-5 |
| METR time horizons | Not measured | 69.6% | Only GPT-5 measured |
| Remote Labor Index | Not measured | 1.7% | Only GPT-5 measured |
| GDPval | Not measured | 34.8% | Only GPT-5 measured |
| BALROG | Not measured | 32.8% | Only GPT-5 measured |
| DeepResearch Bench | Not measured | 49.6% | Only GPT-5 measured |
| Neither model has a result on the other 29 boards here | |||
ReasoningLike-for-likePublic boards, shown as published, kept out of the index62
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| GPQA Diamond | Not measured | 85.6% | Only GPT-5 measured |
| LiveBench reasoning | 68.3% | Not measured | Only Gemma 4 31B measured |
| MMMU Pro (Vals AI) | Not measured | 81.5% | Only GPT-5 measured |
| GPQA Diamond (Artificial Analysis run) | 85.7% | 85.4% | Gemma 4 31B |
| Humanity's Last Exam (Artificial Analysis run) | 23.6% | 28.5% | GPT-5 |
| GPQA Diamond (Epoch AI run) | 75.8% | 86.2% | GPT-5 |
| ARC-AGI | Not measured | 65.7% | Only GPT-5 measured |
| ARC-AGI-2 | Not measured | 9.9% | Only GPT-5 measured |
| SimpleBench | Not measured | 56.7% | Only GPT-5 measured |
| Chess puzzles | Not measured | 36.0% | Only GPT-5 measured |
| Mystery game puzzles | Not measured | 23.0% | Only GPT-5 measured |
| EBR-bench | Not measured | 12.7% | Only GPT-5 measured |
| VPCT | Not measured | 66.0% | Only GPT-5 measured |
| LMArena Text: hard prompts | 1448 | 1415 | Gemma 4 31B |
| LMArena Text: expert | 1464 | 1419 | Gemma 4 31B |
| LMArena Text: hard prompts in English | 1456 | 1419 | Gemma 4 31B |
| LMArena Vision: diagrams | 1283 | 1252 | Gemma 4 31B |
| LMArena Vision: homework | 1310 | 1278 | Gemma 4 31B |
| Neither model has a result on the other 3 boards here | |||
MathLike-for-likePublic boards, shown as published, kept out of the index21
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| AIME | Not measured | 93.4% | Only GPT-5 measured |
| MATH 500 (Vals AI) | Not measured | 96.0% | Only GPT-5 measured |
| MGSM (Vals AI) | Not measured | 92.8% | Only GPT-5 measured |
| AA Math Index | Not measured | 94.3 | Only GPT-5 measured |
| AIME 2025 (Artificial Analysis run) | Not measured | 94.3% | Only GPT-5 measured |
| OTIS Mock AIME | 73.3% | 91.4% | GPT-5 |
| FrontierMath, tiers 1 to 3 | Not measured | 55.4% | Only GPT-5 measured |
| FrontierMath, tier 4 | Not measured | 22.0% | Only GPT-5 measured |
| ProofBench | Not measured | 18.0% | Only GPT-5 measured |
| MATH level 5 | Not measured | 98.1% | Only GPT-5 measured |
| LMArena Text: math | 1463 | 1407 | Gemma 4 31B |
| LMArena Text: mathematical work | 1465 | 1405 | Gemma 4 31B |
| Neither model has a result on the other 1 board here | |||
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index43
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| MMLU Pro | Not measured | 86.5% | Only GPT-5 measured |
| LegalBench (Vals AI) | Not measured | 86.0% | Only GPT-5 measured |
| CaseLaw (Vals AI) | 52.6% | 66.5% | GPT-5 |
| CorpFin (Vals AI) | Not measured | 61.1% | Only GPT-5 measured |
| TaxEval (Vals AI) | Not measured | 73.4% | Only GPT-5 measured |
| MortgageTax (Vals AI) | 61.4% | 65.5% | GPT-5 |
| MedQA (Vals AI) | Not measured | 96.3% | Only GPT-5 measured |
| MedCode (Vals AI) | Not measured | 49.6% | Only GPT-5 measured |
| MMLU Pro (Artificial Analysis run) | Not measured | 87.1% | Only GPT-5 measured |
| SimpleQA Verified | 10.4% | 50.1% | GPT-5 |
| GeoBench | Not measured | 81.0% | Only GPT-5 measured |
| LMArena Text: science | 1457 | 1416 | Gemma 4 31B |
| LMArena Text: medicine and healthcare | 1451 | 1413 | Gemma 4 31B |
| LMArena Text: legal and government | 1438 | 1431 | Gemma 4 31B |
| LMArena Text: business and finance | 1430 | 1400 | Gemma 4 31B |
| Neither model has a result on the other 2 boards here | |||
Web designDirectional onlyPublic boards, shown as published, kept out of the index9 boards, none shared
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| Design Arena: websites | Not measured | 1185 | Only GPT-5 measured |
| Design Arena: UI components | Not measured | 1179 | Only GPT-5 measured |
| Design Arena: game dev | Not measured | 1185 | Only GPT-5 measured |
| Design Arena: data viz | Not measured | 1221 | Only GPT-5 measured |
| Design Arena: 3D | Not measured | 1056 | Only GPT-5 measured |
| Design Arena: all code categories | Not measured | 1168 | Only GPT-5 measured |
| Design Arena: SVG | Not measured | 1188 | Only GPT-5 measured |
| Design Arena: ASCII art | Not measured | 1140 | Only GPT-5 measured |
| LiveBench design | 58.4% | Not measured | Only Gemma 4 31B measured |
GeneralLike-for-likePublic boards, shown as published, kept out of the index234
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| LiveBench data analysis | 53.3% | Not measured | Only Gemma 4 31B measured |
| SAGE (Vals AI) | 55.0% | 43.7% | Gemma 4 31B |
| MedScribe (Vals AI) | Not measured | 83.7% | Only GPT-5 measured |
| IFBench | 75.6% | 73.1% | Gemma 4 31B |
| Long context reasoning (AA-LCR) | 69.7% | 78.2% | GPT-5 |
| DTBench | 82.7% | 90.7% | GPT-5 |
| LMCA | 39.3% | 40.0% | GPT-5 |
| Fiction.LiveBench | Not measured | 97.2% | Only GPT-5 measured |
| Creative writing (Lech Mazur) | Not measured | 86.0% | Only GPT-5 measured |
| Surface Evolver Bench | 30.6% | Not measured | Only Gemma 4 31B measured |
| LMArena Text | 1443 | 1406 | Gemma 4 31B |
| LMArena Text: instruction following | 1433 | 1388 | Gemma 4 31B |
| LMArena Text: creative writing | 1417 | 1365 | Gemma 4 31B |
| LMArena Vision | 1276 | 1232 | Gemma 4 31B |
| LMArena Text: English | 1451 | 1409 | Gemma 4 31B |
| LMArena Text: non-English | 1430 | 1397 | Gemma 4 31B |
| LMArena Text: Chinese | 1475 | 1422 | Gemma 4 31B |
| LMArena Text: German | Not measured | 1416 | Only GPT-5 measured |
| LMArena Text: Japanese | Not measured | 1409 | Only GPT-5 measured |
| LMArena Text: Korean | Not measured | 1360 | Only GPT-5 measured |
| LMArena Text: French | 1436 | 1409 | Gemma 4 31B |
| LMArena Text: Spanish | 1442 | 1399 | Gemma 4 31B |
| LMArena Text: Russian | 1460 | 1407 | Gemma 4 31B |
| LMArena Text: Polish | 1433 | 1431 | Gemma 4 31B |
| LMArena Text: multi-turn | 1452 | 1426 | Gemma 4 31B |
| LMArena Text: longer queries | 1446 | 1399 | Gemma 4 31B |
| LMArena Text: writing and language | 1432 | 1384 | Gemma 4 31B |
| LMArena Text: entertainment and media | 1405 | 1379 | Gemma 4 31B |
| LMArena Vision: English | 1271 | 1231 | Gemma 4 31B |
| LMArena Vision: Chinese | 1326 | 1267 | Gemma 4 31B |
| LMArena Vision: reading text | 1282 | 1246 | Gemma 4 31B |
| LMArena Vision: humor | 1280 | 1219 | Gemma 4 31B |
| LMArena Vision: captioning | 1218 | 1212 | Gemma 4 31B |
| LMArena Vision: recognizing things | 1226 | 1263 | GPT-5 |
| LMArena Vision: creative writing | 1285 | 1210 | Gemma 4 31B |
| LMArena Document | 1425 | Not measured | Only Gemma 4 31B measured |
| Neither model has a result on the other 10 boards here | |||
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | Gemma 4 31B | GPT-5 | Leader |
|---|---|---|---|
| Neither model has a result on 5 boards here | |||
What each workload costs
Three fixed token mixes at each model's listed price, so per-token rates become a bill.
Chat turn
1K input + 500 output tokens
Gemma 4 31B costs less
Repository review
50K input + 3K output tokens
Gemma 4 31B costs less
Agent loop
200K input + 10K output tokens
Gemma 4 31B costs less
Listed OpenRouter rates, without cache or batch discounts. A workload that does not fit a model's context window would need splitting.
Specification differences
The leading value in a row is marked; a row with a missing value names no leader. Our two rows are marked in red.
| Specification | Google Gemma 4 31B | OpenAI GPT-5 |
|---|---|---|
| Maker | OpenAI | |
| Weights | Open weights | No public weights listed |
| Released | April 2, 2026 | August 7, 2025 |
| Context window | 262K | 400K |
| Input $/Mtok | $0.20 | $1.25 |
| Output $/Mtok | $0.40 | $10.00 |
| Coding index | 38.3 | 72.2 |
| Independent measurements behind it | 2 | 3 |
| Cost per solved task | Not computable | $0.39 |
| Source | OpenRouter listing | OpenRouter listing |
Questions
Is Gemma 4 31B better than GPT-5 for coding?
Pick GPT-5 for coding: it scores 72.2 on the Vibe Coding Index against 38.3 for Gemma 4 31B. Pick Gemma 4 31B when output tokens cost 25.0x less, or when what matters is AA Coding Index or ALE-Bench, where it leads.
Which is cheaper, Gemma 4 31B or GPT-5?
Gemma 4 31B costs $0.20 per million input tokens and $0.40 per million output tokens; GPT-5 costs $1.25 and $10.00. Cost per solved task is known for GPT-5 only.
Which has the bigger context window, Gemma 4 31B or GPT-5?
GPT-5, with 400K tokens against 262K.
How many benchmarks is the Gemma 4 31B vs GPT-5 comparison based on?
56 benchmarks have a result for both models as of October 21, 2026. Gemma 4 31B's coding index rests on 2 independent benchmarks and GPT-5's on 3. Where only one model has a result, the page says so instead of naming a winner.