LLMBenchmark.ai

Enter opens the highlighted result. Esc closes.

Gemma 4 31B vs GPT-4.1

Updated October 21, 2026. 52 benchmarks have a result for both. Coding is ranked on the Vibe Coding Index; every other board is shown as published.

Gemma 4 31BGoogle
Coding
38.3
Overall
14.7
Output $/M
$0.40
49
GPT-4.1OpenAI
Coding
46.5
Overall
12.7
Output $/M
$8.00
3
vs boards won of 52 shared

Decision reading

Pick GPT-4.1 for coding: it scores 46.5 on the Vibe Coding Index against 38.3 for Gemma 4 31B.

Pick Gemma 4 31B when output tokens cost 20.0x less, or when what matters is Terminal-Bench Hard (Artificial Analysis run) or WeirdML, where it leads.

Shared results
52
Gemma 4 31B only
16
GPT-4.1 only
35
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.

At a glance

Coding index
Gemma 4 31B 38.3 from 2 benchmarks, GPT-4.1 46.5 from 2 benchmarks.
Widest category
Math, 22.7 points apart on average over 3 shared benchmarks.
Widest single gap
OTIS Mock AIME: Gemma 4 31B 73.3% against GPT-4.1 38.3%, 35.0 points apart on a 0 to 100 scale.
Output price
Gemma 4 31B $0.40 against GPT-4.1 $8.00 per million output tokens, 20.0x apart.
Context window
Gemma 4 31B takes 262K tokens, GPT-4.1 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.

Boards won, where both have a result
CategoryGemma 4 31BBarsGPT-4.1Ties
Coding50
Intelligence20
Agentic work10
Reasoning80
Math30
Knowledge43
General260
All shared boards493
CodingLike-for-likeFour of these boards feed the Vibe Coding Index50
Coding benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
Aider polyglotNot measured52.4%Only GPT-4.1 measured
SWE-bench VerifiedNot measured39.6%Only GPT-4.1 measured
SWE-bench MultimodalNot measured31.1%Only GPT-4.1 measured
LiveBench coding49.0%Not measuredOnly Gemma 4 31B measured
LMArena WebDev1367Not measuredOnly Gemma 4 31B measured
AA Coding Index43.4Not measuredOnly Gemma 4 31B measured
LiveCodeBench (Vals AI)Not measured54.7%Only GPT-4.1 measured
LiveCodeBench (Artificial Analysis run)Not measured45.7%Only GPT-4.1 measured
SciCode45.5%Not measuredOnly Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)36.4%13.6%Gemma 4 31B
WeirdML52.3%39.0%Gemma 4 31B
ALE-Bench925.5558.1Gemma 4 31B
LMArena Text: coding14591390Gemma 4 31B
LMArena Text: software and IT14631391Gemma 4 31B
LMArena WebDev: React1359Not measuredOnly Gemma 4 31B measured
LMArena WebDev: HTML1380Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 22 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index20
Intelligence benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
AA Intelligence Index14.712.7Gemma 4 31B
Epoch Capabilities Index143.0136.7Gemma 4 31B
Agentic workLike-for-likePublic boards, shown as published, kept out of the index10
Agentic work benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
AA Agentic Index4.2Not measuredOnly Gemma 4 31B measured
LiveBench research44.4%Not measuredOnly Gemma 4 31B measured
LiveBench browser4.0%Not measuredOnly Gemma 4 31B measured
LiveBench long agentic13.3%Not measuredOnly Gemma 4 31B measured
τ²-Bench Telecom65.5%47.1%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
Reasoning benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
GPQA DiamondNot measured65.4%Only GPT-4.1 measured
LiveBench reasoning68.3%Not measuredOnly Gemma 4 31B measured
MMMU Pro (Vals AI)Not measured72.4%Only GPT-4.1 measured
GPQA Diamond (Artificial Analysis run)85.7%66.6%Gemma 4 31B
Humanity's Last Exam (Artificial Analysis run)23.6%4.2%Gemma 4 31B
GPQA Diamond (Epoch AI run)75.8%66.9%Gemma 4 31B
ARC-AGINot measured5.5%Only GPT-4.1 measured
ARC-AGI-2Not measured0.4%Only GPT-4.1 measured
SimpleBenchNot measured27.0%Only GPT-4.1 measured
Chess puzzlesNot measured3.0%Only GPT-4.1 measured
LMArena Text: hard prompts14481384Gemma 4 31B
LMArena Text: expert14641364Gemma 4 31B
LMArena Text: hard prompts in English14561393Gemma 4 31B
LMArena Vision: diagrams12831215Gemma 4 31B
LMArena Vision: homework13101248Gemma 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
Math benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
AIMENot measured39.6%Only GPT-4.1 measured
MATH 500 (Vals AI)Not measured87.2%Only GPT-4.1 measured
MGSM (Vals AI)Not measured87.7%Only GPT-4.1 measured
AA Math IndexNot measured34.7Only GPT-4.1 measured
AIME 2025 (Artificial Analysis run)Not measured34.7%Only GPT-4.1 measured
OTIS Mock AIME73.3%38.3%Gemma 4 31B
FrontierMath, tiers 1 to 3Not measured6.0%Only GPT-4.1 measured
MATH level 5Not measured83.0%Only GPT-4.1 measured
LMArena Text: math14631369Gemma 4 31B
LMArena Text: mathematical work14651360Gemma 4 31B
Neither model has a result on the other 3 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index43
Knowledge benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
MMLU ProNot measured80.5%Only GPT-4.1 measured
LegalBench (Vals AI)Not measured83.1%Only GPT-4.1 measured
CaseLaw (Vals AI)52.6%69.9%GPT-4.1
CorpFin (Vals AI)Not measured63.0%Only GPT-4.1 measured
TaxEval (Vals AI)Not measured75.1%Only GPT-4.1 measured
MortgageTax (Vals AI)61.4%65.9%GPT-4.1
MedQA (Vals AI)Not measured91.2%Only GPT-4.1 measured
MMLU Pro (Artificial Analysis run)Not measured80.6%Only GPT-4.1 measured
SimpleQA Verified10.4%31.1%GPT-4.1
GeoBenchNot measured72.0%Only GPT-4.1 measured
LMArena Text: science14571382Gemma 4 31B
LMArena Text: medicine and healthcare14511379Gemma 4 31B
LMArena Text: legal and government14381399Gemma 4 31B
LMArena Text: business and finance14301369Gemma 4 31B
Neither model has a result on the other 3 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index7 boards, none shared
Web design benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
Design Arena: websitesNot measured1039Only GPT-4.1 measured
Design Arena: UI componentsNot measured1000Only GPT-4.1 measured
Design Arena: game devNot measured1080Only GPT-4.1 measured
Design Arena: data vizNot measured1104Only GPT-4.1 measured
Design Arena: 3DNot measured850Only GPT-4.1 measured
Design Arena: all code categoriesNot measured1026Only GPT-4.1 measured
LiveBench design58.4%Not measuredOnly 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
General benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
LiveBench data analysis53.3%Not measuredOnly Gemma 4 31B measured
SAGE (Vals AI)55.0%Not measuredOnly Gemma 4 31B measured
IFBench75.6%43.0%Gemma 4 31B
Long context reasoning (AA-LCR)69.7%68.3%Gemma 4 31B
DTBench82.7%68.3%Gemma 4 31B
LMCA39.3%25.6%Gemma 4 31B
Fiction.LiveBenchNot measured63.9%Only GPT-4.1 measured
Surface Evolver Bench30.6%Not measuredOnly Gemma 4 31B measured
LMArena Text14431383Gemma 4 31B
LMArena Text: instruction following14331367Gemma 4 31B
LMArena Text: creative writing14171363Gemma 4 31B
LMArena Vision12761210Gemma 4 31B
LMArena Text: English14511392Gemma 4 31B
LMArena Text: non-English14301370Gemma 4 31B
LMArena Text: Chinese14751382Gemma 4 31B
LMArena Text: GermanNot measured1381Only GPT-4.1 measured
LMArena Text: JapaneseNot measured1319Only GPT-4.1 measured
LMArena Text: KoreanNot measured1338Only GPT-4.1 measured
LMArena Text: French14361382Gemma 4 31B
LMArena Text: Spanish14421376Gemma 4 31B
LMArena Text: Russian14601377Gemma 4 31B
LMArena Text: Polish14331389Gemma 4 31B
LMArena Text: multi-turn14521397Gemma 4 31B
LMArena Text: longer queries14461385Gemma 4 31B
LMArena Text: writing and language14321371Gemma 4 31B
LMArena Text: entertainment and media14051365Gemma 4 31B
LMArena Vision: English12711209Gemma 4 31B
LMArena Vision: Chinese13261226Gemma 4 31B
LMArena Vision: reading text12821218Gemma 4 31B
LMArena Vision: humor12801196Gemma 4 31B
LMArena Vision: captioning12181207Gemma 4 31B
LMArena Vision: recognizing things12261208Gemma 4 31B
LMArena Vision: creative writing12851210Gemma 4 31B
LMArena Document1425Not measuredOnly 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
Image generation benchmarks for Gemma 4 31B and GPT-4.1
BenchmarkGemma 4 31BGPT-4.1Leader
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$0.0004Fits in one request
GPT-4.1$0.0060Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 4 31B$0.011Fits in one request
GPT-4.1$0.124Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 4 31B$0.044Fits in one request
GPT-4.1$0.480Fits in one request

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.

Specifications of Gemma 4 31B and GPT-4.1
SpecificationGoogle Gemma 4 31BOpenAI GPT-4.1
MakerGoogleOpenAI
WeightsOpen weightsNo public weights listed
ReleasedApril 2, 2026April 14, 2025
Context window262K1.05M
Input $/Mtok$0.20$2.00
Output $/Mtok$0.40$8.00
Coding index38.346.5
Independent measurements behind it22
Cost per solved taskNot computable$0.37
SourceOpenRouter listingOpenRouter listing

Questions

Is Gemma 4 31B better than GPT-4.1 for coding?

Pick GPT-4.1 for coding: it scores 46.5 on the Vibe Coding Index against 38.3 for Gemma 4 31B. Pick Gemma 4 31B when output tokens cost 20.0x less, or when what matters is Terminal-Bench Hard (Artificial Analysis run) or WeirdML, where it leads.

Which is cheaper, Gemma 4 31B or GPT-4.1?

Gemma 4 31B costs $0.20 per million input tokens and $0.40 per million output tokens; GPT-4.1 costs $2.00 and $8.00. Cost per solved task is known for GPT-4.1 only.

Which has the bigger context window, Gemma 4 31B or GPT-4.1?

GPT-4.1, with 1.05M tokens against 262K.

How many benchmarks is the Gemma 4 31B vs GPT-4.1 comparison based on?

52 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's on 2. Where only one model has a result, the page says so instead of naming a winner.

Compare next

Embed this comparison on your site

Free under CC BY 4.0, while the source link stays visible. Preview the frame · Terms and other embeds

<iframe src="https://llmbenchmark.ai/embed/compare/gemma-4-31b-it-vs-gpt-4-1" title="Gemma 4 31B vs GPT-4.1, LLMBenchmark.ai" width="100%" height="360" style="border:0;max-width:100%" loading="lazy"></iframe>
<p style="font:13px/1.4 sans-serif;margin:6px 0 0">Source: <a href="https://llmbenchmark.ai/compare/gemma-4-31b-it-vs-gpt-4-1">LLMBenchmark.ai, Gemma 4 31B vs GPT-4.1</a></p>