LLMBenchmark.ai

Enter opens the highlighted result. Esc closes.

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.

Gemma 4 31BGoogle
Coding
38.3
Overall
14.7
Output $/M
$0.40
39
GPT-5OpenAI
Coding
72.2
Overall
23.0
Output $/M
$10.00
17
vs boards won of 56 shared

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.

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.

Boards won, where both have a result
CategoryGemma 4 31BBarsGPT-5Ties
Coding44
Intelligence02
Agentic work01
Reasoning62
Math21
Knowledge43
General234
All shared boards3917
CodingLike-for-likeFour of these boards feed the Vibe Coding Index44
Coding benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
Aider polyglotNot measured88.0%Only GPT-5 measured
SWE-bench VerifiedNot measured74.4%Only GPT-5 measured
LiveBench coding49.0%Not measuredOnly Gemma 4 31B measured
LMArena WebDev13671418GPT-5
AA Coding Index43.437.8Gemma 4 31B
LiveCodeBench (Vals AI)Not measured85.9%Only GPT-5 measured
SWE-bench Verified (Vals AI)Not measured69.0%Only GPT-5 measured
Vibe Code Bench (Vals AI)Not measured20.1%Only GPT-5 measured
LiveCodeBench (Artificial Analysis run)Not measured84.6%Only GPT-5 measured
SciCode45.5%Not measuredOnly Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)36.4%37.9%GPT-5
Terminal-BenchNot measured49.6%Only GPT-5 measured
GSO-BenchNot measured6.9%Only GPT-5 measured
WeirdML52.3%60.7%GPT-5
ALE-Bench925.5807.6Gemma 4 31B
LMArena Text: coding14591436Gemma 4 31B
LMArena Text: software and IT14631420Gemma 4 31B
LMArena WebDev: React1359Not measuredOnly Gemma 4 31B measured
LMArena WebDev: HTML13801427GPT-5
Neither model has a result on the other 19 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index02
Intelligence benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
AA Intelligence Index14.723.0GPT-5
Epoch Capabilities Index143.0150.0GPT-5
Agentic workLike-for-likePublic boards, shown as published, kept out of the index01
Agentic work benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
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%86.5%GPT-5
METR time horizonsNot measured69.6%Only GPT-5 measured
Remote Labor IndexNot measured1.7%Only GPT-5 measured
GDPvalNot measured34.8%Only GPT-5 measured
BALROGNot measured32.8%Only GPT-5 measured
DeepResearch BenchNot measured49.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
Reasoning benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
GPQA DiamondNot measured85.6%Only GPT-5 measured
LiveBench reasoning68.3%Not measuredOnly Gemma 4 31B measured
MMMU Pro (Vals AI)Not measured81.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-AGINot measured65.7%Only GPT-5 measured
ARC-AGI-2Not measured9.9%Only GPT-5 measured
SimpleBenchNot measured56.7%Only GPT-5 measured
Chess puzzlesNot measured36.0%Only GPT-5 measured
Mystery game puzzlesNot measured23.0%Only GPT-5 measured
EBR-benchNot measured12.7%Only GPT-5 measured
VPCTNot measured66.0%Only GPT-5 measured
LMArena Text: hard prompts14481415Gemma 4 31B
LMArena Text: expert14641419Gemma 4 31B
LMArena Text: hard prompts in English14561419Gemma 4 31B
LMArena Vision: diagrams12831252Gemma 4 31B
LMArena Vision: homework13101278Gemma 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
Math benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
AIMENot measured93.4%Only GPT-5 measured
MATH 500 (Vals AI)Not measured96.0%Only GPT-5 measured
MGSM (Vals AI)Not measured92.8%Only GPT-5 measured
AA Math IndexNot measured94.3Only GPT-5 measured
AIME 2025 (Artificial Analysis run)Not measured94.3%Only GPT-5 measured
OTIS Mock AIME73.3%91.4%GPT-5
FrontierMath, tiers 1 to 3Not measured55.4%Only GPT-5 measured
FrontierMath, tier 4Not measured22.0%Only GPT-5 measured
ProofBenchNot measured18.0%Only GPT-5 measured
MATH level 5Not measured98.1%Only GPT-5 measured
LMArena Text: math14631407Gemma 4 31B
LMArena Text: mathematical work14651405Gemma 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
Knowledge benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
MMLU ProNot measured86.5%Only GPT-5 measured
LegalBench (Vals AI)Not measured86.0%Only GPT-5 measured
CaseLaw (Vals AI)52.6%66.5%GPT-5
CorpFin (Vals AI)Not measured61.1%Only GPT-5 measured
TaxEval (Vals AI)Not measured73.4%Only GPT-5 measured
MortgageTax (Vals AI)61.4%65.5%GPT-5
MedQA (Vals AI)Not measured96.3%Only GPT-5 measured
MedCode (Vals AI)Not measured49.6%Only GPT-5 measured
MMLU Pro (Artificial Analysis run)Not measured87.1%Only GPT-5 measured
SimpleQA Verified10.4%50.1%GPT-5
GeoBenchNot measured81.0%Only GPT-5 measured
LMArena Text: science14571416Gemma 4 31B
LMArena Text: medicine and healthcare14511413Gemma 4 31B
LMArena Text: legal and government14381431Gemma 4 31B
LMArena Text: business and finance14301400Gemma 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
Web design benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
Design Arena: websitesNot measured1185Only GPT-5 measured
Design Arena: UI componentsNot measured1179Only GPT-5 measured
Design Arena: game devNot measured1185Only GPT-5 measured
Design Arena: data vizNot measured1221Only GPT-5 measured
Design Arena: 3DNot measured1056Only GPT-5 measured
Design Arena: all code categoriesNot measured1168Only GPT-5 measured
Design Arena: SVGNot measured1188Only GPT-5 measured
Design Arena: ASCII artNot measured1140Only GPT-5 measured
LiveBench design58.4%Not measuredOnly Gemma 4 31B measured
GeneralLike-for-likePublic boards, shown as published, kept out of the index234
General benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
LiveBench data analysis53.3%Not measuredOnly Gemma 4 31B measured
SAGE (Vals AI)55.0%43.7%Gemma 4 31B
MedScribe (Vals AI)Not measured83.7%Only GPT-5 measured
IFBench75.6%73.1%Gemma 4 31B
Long context reasoning (AA-LCR)69.7%78.2%GPT-5
DTBench82.7%90.7%GPT-5
LMCA39.3%40.0%GPT-5
Fiction.LiveBenchNot measured97.2%Only GPT-5 measured
Creative writing (Lech Mazur)Not measured86.0%Only GPT-5 measured
Surface Evolver Bench30.6%Not measuredOnly Gemma 4 31B measured
LMArena Text14431406Gemma 4 31B
LMArena Text: instruction following14331388Gemma 4 31B
LMArena Text: creative writing14171365Gemma 4 31B
LMArena Vision12761232Gemma 4 31B
LMArena Text: English14511409Gemma 4 31B
LMArena Text: non-English14301397Gemma 4 31B
LMArena Text: Chinese14751422Gemma 4 31B
LMArena Text: GermanNot measured1416Only GPT-5 measured
LMArena Text: JapaneseNot measured1409Only GPT-5 measured
LMArena Text: KoreanNot measured1360Only GPT-5 measured
LMArena Text: French14361409Gemma 4 31B
LMArena Text: Spanish14421399Gemma 4 31B
LMArena Text: Russian14601407Gemma 4 31B
LMArena Text: Polish14331431Gemma 4 31B
LMArena Text: multi-turn14521426Gemma 4 31B
LMArena Text: longer queries14461399Gemma 4 31B
LMArena Text: writing and language14321384Gemma 4 31B
LMArena Text: entertainment and media14051379Gemma 4 31B
LMArena Vision: English12711231Gemma 4 31B
LMArena Vision: Chinese13261267Gemma 4 31B
LMArena Vision: reading text12821246Gemma 4 31B
LMArena Vision: humor12801219Gemma 4 31B
LMArena Vision: captioning12181212Gemma 4 31B
LMArena Vision: recognizing things12261263GPT-5
LMArena Vision: creative writing12851210Gemma 4 31B
LMArena Document1425Not measuredOnly 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
Image generation benchmarks for Gemma 4 31B and GPT-5
BenchmarkGemma 4 31BGPT-5Leader
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-5$0.0063Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 4 31B$0.011Fits in one request
GPT-5$0.092Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 4 31B$0.044Fits in one request
GPT-5$0.350Fits 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-5
SpecificationGoogle Gemma 4 31BOpenAI GPT-5
MakerGoogleOpenAI
WeightsOpen weightsNo public weights listed
ReleasedApril 2, 2026August 7, 2025
Context window262K400K
Input $/Mtok$0.20$1.25
Output $/Mtok$0.40$10.00
Coding index38.372.2
Independent measurements behind it23
Cost per solved taskNot computable$0.39
SourceOpenRouter listingOpenRouter 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.

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-5" title="Gemma 4 31B vs GPT-5, 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-5">LLMBenchmark.ai, Gemma 4 31B vs GPT-5</a></p>