Gemma 4 31B vs GPT-4.1 Mini
Updated October 21, 2026. 51 benchmarks have a result for both. Coding is ranked on the Vibe Coding Index; every other board is shown as published.
Decision reading
Pick Gemma 4 31B for coding: it scores 38.3 on the Vibe Coding Index against 28.5 for GPT-4.1 Mini.
Pick GPT-4.1 Mini when the context window is larger, 1.05M against 262K tokens, or when what matters is MortgageTax (Vals AI) or SimpleQA Verified, where it leads.
- Shared results
- 51
- Gemma 4 31B only
- 17
- GPT-4.1 Mini only
- 33
- 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
Gemma 4 31B
Gemma 4 31B scores 38.3 against 28.5.
2 benchmarks behind each score
Intelligence
AA Intelligence Index
Gemma 4 31B
Gemma 4 31B leads, 14.7 against 10.2.
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-4.1 Mini has a GPQA Diamond result, 67.9%.
Directional only
Math
AIME
No call
Only GPT-4.1 Mini has a AIME result, 49.4%.
Directional only
Knowledge
MMLU Pro
No call
Only GPT-4.1 Mini has a MMLU Pro result, 77.2%.
Directional only
Web design
Design Arena: websites
No call
Only GPT-4.1 Mini has a Design Arena: websites result, 997.
Directional only
Long documents
Listed context window
GPT-4.1 Mini
GPT-4.1 Mini takes 1.05M tokens against 262K.
Listed by OpenRouter
Everyday cost
1K input + 500 output tokens
Gemma 4 31B
Gemma 4 31B $0.0004, GPT-4.1 Mini $0.0012 per turn.
List prices
Cost per solved task
One SWE-bench Verified task, solved
No call
Only GPT-4.1 Mini has the number, $1.818.
Directional only
At a glance
- Coding index
- Gemma 4 31B 38.3 from 2 benchmarks, GPT-4.1 Mini 28.5 from 2 benchmarks.
- Widest category
- Math, 22.8 points apart on average over 3 shared benchmarks.
- Widest single gap
- IFBench: Gemma 4 31B 75.6% against GPT-4.1 Mini 38.3%, 37.3 points apart on a 0 to 100 scale.
- Output price
- Gemma 4 31B $0.40 against GPT-4.1 Mini $1.60 per million output tokens, 4.0x apart.
- Context window
- Gemma 4 31B takes 262K tokens, GPT-4.1 Mini 1.05M.
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-4.1 Mini | Ties |
|---|---|---|---|---|
| Coding | 5 | 0 | ||
| Intelligence | 2 | 0 | ||
| Agentic work | 1 | 0 | ||
| Reasoning | 8 | 0 | ||
| Math | 3 | 0 | ||
| Knowledge | 4 | 2 | ||
| General | 26 | 0 | ||
| All shared boards | 49 | 2 |
CodingLike-for-likeFour of these boards feed the Vibe Coding Index50
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| Aider polyglot | Not measured | 32.4% | Only GPT-4.1 Mini measured |
| SWE-bench Verified | Not measured | 23.9% | Only GPT-4.1 Mini measured |
| LiveBench coding | 49.0% | Not measured | Only Gemma 4 31B measured |
| LMArena WebDev | 1367 | Not measured | Only Gemma 4 31B measured |
| AA Coding Index | 43.4 | 20.2 | Gemma 4 31B |
| LiveCodeBench (Vals AI) | Not measured | 58.2% | Only GPT-4.1 Mini measured |
| LiveCodeBench (Artificial Analysis run) | Not measured | 48.3% | Only GPT-4.1 Mini measured |
| SciCode | 45.5% | Not measured | Only Gemma 4 31B measured |
| Terminal-Bench Hard (Artificial Analysis run) | 36.4% | 7.6% | Gemma 4 31B |
| WeirdML | 52.3% | 37.6% | Gemma 4 31B |
| ALE-Bench | 925.5 | Not measured | Only Gemma 4 31B measured |
| LMArena Text: coding | 1459 | 1367 | Gemma 4 31B |
| LMArena Text: software and IT | 1463 | 1360 | Gemma 4 31B |
| LMArena WebDev: React | 1359 | Not measured | Only Gemma 4 31B measured |
| LMArena WebDev: HTML | 1380 | Not measured | Only Gemma 4 31B measured |
| Neither model has a result on the other 23 boards here | |||
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index20
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| AA Intelligence Index | 14.7 | 10.2 | Gemma 4 31B |
| Epoch Capabilities Index | 143.0 | 134.9 | Gemma 4 31B |
Agentic workLike-for-likePublic boards, shown as published, kept out of the index10
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | 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% | 52.9% | Gemma 4 31B |
| Neither model has a result on the other 34 boards here | |||
ReasoningLike-for-likePublic boards, shown as published, kept out of the index80
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| GPQA Diamond | Not measured | 67.9% | Only GPT-4.1 Mini measured |
| LiveBench reasoning | 68.3% | Not measured | Only Gemma 4 31B measured |
| MMMU Pro (Vals AI) | Not measured | 70.5% | Only GPT-4.1 Mini measured |
| GPQA Diamond (Artificial Analysis run) | 85.7% | 66.4% | Gemma 4 31B |
| Humanity's Last Exam (Artificial Analysis run) | 23.6% | 5.0% | Gemma 4 31B |
| GPQA Diamond (Epoch AI run) | 75.8% | 65.8% | Gemma 4 31B |
| ARC-AGI | Not measured | 3.5% | Only GPT-4.1 Mini measured |
| ARC-AGI-2 | Not measured | 0.0% | Only GPT-4.1 Mini measured |
| Chess puzzles | Not measured | 1.0% | Only GPT-4.1 Mini measured |
| Mystery game puzzles | Not measured | 7.0% | Only GPT-4.1 Mini measured |
| LMArena Text: hard prompts | 1448 | 1349 | Gemma 4 31B |
| LMArena Text: expert | 1464 | 1338 | Gemma 4 31B |
| LMArena Text: hard prompts in English | 1456 | 1362 | Gemma 4 31B |
| LMArena Vision: diagrams | 1283 | 1182 | Gemma 4 31B |
| LMArena Vision: homework | 1310 | 1214 | Gemma 4 31B |
| Neither model has a result on the other 6 boards here | |||
MathLike-for-likePublic boards, shown as published, kept out of the index30
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| AIME | Not measured | 49.4% | Only GPT-4.1 Mini measured |
| MATH 500 (Vals AI) | Not measured | 88.0% | Only GPT-4.1 Mini measured |
| MGSM (Vals AI) | Not measured | 87.8% | Only GPT-4.1 Mini measured |
| AA Math Index | Not measured | 46.3 | Only GPT-4.1 Mini measured |
| AIME 2025 (Artificial Analysis run) | Not measured | 46.3% | Only GPT-4.1 Mini measured |
| OTIS Mock AIME | 73.3% | 44.7% | Gemma 4 31B |
| FrontierMath, tiers 1 to 3 | Not measured | 6.7% | Only GPT-4.1 Mini measured |
| MATH level 5 | Not measured | 87.3% | Only GPT-4.1 Mini measured |
| LMArena Text: math | 1463 | 1343 | Gemma 4 31B |
| LMArena Text: mathematical work | 1465 | 1347 | Gemma 4 31B |
| Neither model has a result on the other 3 boards here | |||
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index42
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| MMLU Pro | Not measured | 77.2% | Only GPT-4.1 Mini measured |
| LegalBench (Vals AI) | Not measured | 78.0% | Only GPT-4.1 Mini measured |
| CaseLaw (Vals AI) | 52.6% | Not measured | Only Gemma 4 31B measured |
| CorpFin (Vals AI) | Not measured | 57.9% | Only GPT-4.1 Mini measured |
| TaxEval (Vals AI) | Not measured | 71.9% | Only GPT-4.1 Mini measured |
| MortgageTax (Vals AI) | 61.4% | 65.5% | GPT-4.1 Mini |
| MedQA (Vals AI) | Not measured | 84.6% | Only GPT-4.1 Mini measured |
| MMLU Pro (Artificial Analysis run) | Not measured | 78.1% | Only GPT-4.1 Mini measured |
| SimpleQA Verified | 10.4% | 12.7% | GPT-4.1 Mini |
| LMArena Text: science | 1457 | 1328 | Gemma 4 31B |
| LMArena Text: medicine and healthcare | 1451 | 1324 | Gemma 4 31B |
| LMArena Text: legal and government | 1438 | 1343 | Gemma 4 31B |
| LMArena Text: business and finance | 1430 | 1322 | Gemma 4 31B |
| Neither model has a result on the other 4 boards here | |||
Web designDirectional onlyPublic boards, shown as published, kept out of the index7 boards, none shared
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| Design Arena: websites | Not measured | 997 | Only GPT-4.1 Mini measured |
| Design Arena: UI components | Not measured | 961 | Only GPT-4.1 Mini measured |
| Design Arena: game dev | Not measured | 1071 | Only GPT-4.1 Mini measured |
| Design Arena: data viz | Not measured | 1034 | Only GPT-4.1 Mini measured |
| Design Arena: 3D | Not measured | 837 | Only GPT-4.1 Mini measured |
| Design Arena: all code categories | Not measured | 994 | Only GPT-4.1 Mini measured |
| LiveBench design | 58.4% | Not measured | Only Gemma 4 31B measured |
| Neither model has a result on the other 2 boards here | |||
GeneralLike-for-likePublic boards, shown as published, kept out of the index260
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | Leader |
|---|---|---|---|
| LiveBench data analysis | 53.3% | Not measured | Only Gemma 4 31B measured |
| SAGE (Vals AI) | 55.0% | Not measured | Only Gemma 4 31B measured |
| IFBench | 75.6% | 38.3% | Gemma 4 31B |
| Long context reasoning (AA-LCR) | 69.7% | 44.0% | Gemma 4 31B |
| DTBench | 82.7% | 68.8% | Gemma 4 31B |
| LMCA | 39.3% | 21.1% | Gemma 4 31B |
| Fiction.LiveBench | Not measured | 44.4% | Only GPT-4.1 Mini measured |
| Surface Evolver Bench | 30.6% | Not measured | Only Gemma 4 31B measured |
| LMArena Text | 1443 | 1341 | Gemma 4 31B |
| LMArena Text: instruction following | 1433 | 1333 | Gemma 4 31B |
| LMArena Text: creative writing | 1417 | 1299 | Gemma 4 31B |
| LMArena Vision | 1276 | 1181 | Gemma 4 31B |
| LMArena Text: English | 1451 | 1356 | Gemma 4 31B |
| LMArena Text: non-English | 1430 | 1318 | Gemma 4 31B |
| LMArena Text: Chinese | 1475 | 1329 | Gemma 4 31B |
| LMArena Text: German | Not measured | 1350 | Only GPT-4.1 Mini measured |
| LMArena Text: Japanese | Not measured | 1290 | Only GPT-4.1 Mini measured |
| LMArena Text: Korean | Not measured | 1298 | Only GPT-4.1 Mini measured |
| LMArena Text: French | 1436 | 1358 | Gemma 4 31B |
| LMArena Text: Spanish | 1442 | 1319 | Gemma 4 31B |
| LMArena Text: Russian | 1460 | 1324 | Gemma 4 31B |
| LMArena Text: Polish | 1433 | 1326 | Gemma 4 31B |
| LMArena Text: multi-turn | 1452 | 1354 | Gemma 4 31B |
| LMArena Text: longer queries | 1446 | 1344 | Gemma 4 31B |
| LMArena Text: writing and language | 1432 | 1319 | Gemma 4 31B |
| LMArena Text: entertainment and media | 1405 | 1300 | Gemma 4 31B |
| LMArena Vision: English | 1271 | 1191 | Gemma 4 31B |
| LMArena Vision: Chinese | 1326 | 1186 | Gemma 4 31B |
| LMArena Vision: reading text | 1282 | 1188 | Gemma 4 31B |
| LMArena Vision: humor | 1280 | 1182 | Gemma 4 31B |
| LMArena Vision: captioning | 1218 | 1174 | Gemma 4 31B |
| LMArena Vision: recognizing things | 1226 | 1187 | Gemma 4 31B |
| LMArena Vision: creative writing | 1285 | 1182 | Gemma 4 31B |
| LMArena Document | 1425 | Not measured | Only Gemma 4 31B measured |
| Neither model has a result on the other 12 boards here | |||
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | Gemma 4 31B | GPT-4.1 Mini | 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-4.1 Mini |
|---|---|---|
| Maker | OpenAI | |
| Weights | Open weights | No public weights listed |
| Released | April 2, 2026 | April 14, 2025 |
| Context window | 262K | 1.05M |
| Input $/Mtok | $0.20 | $0.40 |
| Output $/Mtok | $0.40 | $1.60 |
| Coding index | 38.3 | 28.5 |
| Independent measurements behind it | 2 | 2 |
| Cost per solved task | Not computable | $1.818 |
| Source | OpenRouter listing | OpenRouter listing |
Questions
Is Gemma 4 31B better than GPT-4.1 Mini for coding?
Pick Gemma 4 31B for coding: it scores 38.3 on the Vibe Coding Index against 28.5 for GPT-4.1 Mini. Pick GPT-4.1 Mini when the context window is larger, 1.05M against 262K tokens, or when what matters is MortgageTax (Vals AI) or SimpleQA Verified, where it leads.
Which is cheaper, Gemma 4 31B or GPT-4.1 Mini?
Gemma 4 31B costs $0.20 per million input tokens and $0.40 per million output tokens; GPT-4.1 Mini costs $0.40 and $1.60. Cost per solved task is known for GPT-4.1 Mini only.
Which has the bigger context window, Gemma 4 31B or GPT-4.1 Mini?
GPT-4.1 Mini, with 1.05M tokens against 262K.
How many benchmarks is the Gemma 4 31B vs GPT-4.1 Mini comparison based on?
51 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-4.1 Mini's on 2. Where only one model has a result, the page says so instead of naming a winner.