Enter opens the highlighted result. Esc closes.

Gemma 4 31B vs GPT-5.4 Nano

GPT-5.4 Nano leads Gemma 4 31B on coding, 44.8 to 39.0 on the Vibe Coding Index, and Gemma 4 31B costs 3.1x less per output token ($0.40 vs $1.25 per million). Updated October 22, 2026; 56 benchmarks have a result for both.

Gemma 4 31BGoogle
Coding
39.0
Overall
42.1
Output $/M
$0.40
42
GPT-5.4 NanoOpenAI
Coding
44.8
Overall
45.7
Output $/M
$1.25
14
vs boards won of 56 shared

Gemma 4 31B or GPT-5.4 Nano: which to pick

Pick GPT-5.4 Nano for coding: it scores 44.8 on the Vibe Coding Index against 39.0 for Gemma 4 31B.

Pick Gemma 4 31B for output tokens 3.1x cheaper ($0.40 vs $1.25 per million) and work measured by WeirdML or LMArena Text: coding, where it leads.

Shared results
56
Gemma 4 31B only
15
GPT-5.4 Nano only
29
Like-for-like categories
7 of 9

Only benchmarks that tested both models count toward a pick; a result only one model has is shown but not compared.

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 39.0 from 2 benchmarks, GPT-5.4 Nano 44.8 from 2 benchmarks.
Widest category
General, 12.2 points apart on average over 26 shared benchmarks.
Widest single gap
Kagi LLM Benchmark: Gemma 4 31B 63.5% against GPT-5.4 Nano 39.7%, 23.8 points apart on a 0 to 100 scale.
Output price
Gemma 4 31B $0.40 against GPT-5.4 Nano $1.25 per million output tokens, 3.1x apart.
Context window
Gemma 4 31B takes 262K tokens, GPT-5.4 Nano 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-5.4 NanoTies
Coding34
Intelligence02
Agentic work02
Reasoning72
Math21
Knowledge61
General242
All shared boards4214
CodingLike-for-likeSix of these boards feed the Vibe Coding Index34
Coding benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
LiveBench coding49.0%Not measuredOnly Gemma 4 31B measured
LMArena WebDev1367Not measuredOnly Gemma 4 31B measured
AA Coding Index43.456.1GPT-5.4 Nano
LiveCodeBench (Vals AI)Not measured84.0%Only GPT-5.4 Nano measured
SWE-bench Verified (Vals AI)Not measured69.8%Only GPT-5.4 Nano measured
Vibe Code Bench (Vals AI)Not measured26.1%Only GPT-5.4 Nano measured
Code migration (Vals AI)Not measured14.5%Only GPT-5.4 Nano measured
Terminal-Bench 2.1 (Vals AI)Not measured41.6%Only GPT-5.4 Nano measured
SciCode45.5%47.2%GPT-5.4 Nano
Terminal-Bench Hard (Artificial Analysis run)36.4%42.4%GPT-5.4 Nano
WeirdML52.3%49.2%Gemma 4 31B
ALE-Bench925.51004.5GPT-5.4 Nano
LMArena Text: coding14591404Gemma 4 31B
LMArena Text: software and IT14631402Gemma 4 31B
LMArena WebDev: React1359Not measuredOnly Gemma 4 31B measured
LMArena WebDev: HTML1380Not measuredOnly Gemma 4 31B measured
SciCode8.9%Not 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 index02
Intelligence benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
AA Intelligence Index14.720.7GPT-5.4 Nano
Epoch Capabilities Index143.0146.0GPT-5.4 Nano
Agentic workLike-for-likePublic boards, shown as published, kept out of the index02
Agentic work benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
AA Agentic Index4.216.0GPT-5.4 Nano
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
Finance Agent (Vals AI)Not measured38.2%Only GPT-5.4 Nano measured
Tax Agent Bench (Vals AI)Not measured5.0%Only GPT-5.4 Nano measured
Legal Research Bench (Vals AI)Not measured6.3%Only GPT-5.4 Nano measured
Excel Modeling Benchmark (Vals AI)Not measured44.8%Only GPT-5.4 Nano measured
τ²-Bench Telecom65.5%76.0%GPT-5.4 Nano
Neither model has a result on the other 32 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index72
Reasoning benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
GPQA DiamondNot measured77.5%Only GPT-5.4 Nano measured
LiveBench reasoning68.3%Not measuredOnly Gemma 4 31B measured
MMMU Pro (Vals AI)Not measured73.6%Only GPT-5.4 Nano measured
GPQA Diamond (Artificial Analysis run)85.7%81.7%Gemma 4 31B
Humanity's Last Exam (Artificial Analysis run)23.6%28.3%GPT-5.4 Nano
GPQA Diamond (Epoch AI run)75.8%78.5%GPT-5.4 Nano
ARC-AGINot measured51.5%Only GPT-5.4 Nano measured
ARC-AGI-2Not measured5.7%Only GPT-5.4 Nano measured
Chess puzzlesNot measured45.0%Only GPT-5.4 Nano measured
Mystery game puzzlesNot measured9.0%Only GPT-5.4 Nano measured
LMArena Text: hard prompts14481381Gemma 4 31B
LMArena Text: expert14641396Gemma 4 31B
LMArena Text: hard prompts in English14561387Gemma 4 31B
LMArena Vision: diagrams12831210Gemma 4 31B
LMArena Vision: homework13101225Gemma 4 31B
Kagi LLM Benchmark63.5%39.7%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 index21
Math benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
AIMENot measured88.8%Only GPT-5.4 Nano measured
OTIS Mock AIME73.3%87.8%GPT-5.4 Nano
FrontierMath, tiers 1 to 3Not measured44.9%Only GPT-5.4 Nano measured
FrontierMath, tier 4Not measured12.2%Only GPT-5.4 Nano measured
ProofBenchNot measured5.0%Only GPT-5.4 Nano measured
LMArena Text: math14631405Gemma 4 31B
LMArena Text: mathematical work14651409Gemma 4 31B
Neither model has a result on the other 6 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index61
Knowledge benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
MMLU ProNot measured77.2%Only GPT-5.4 Nano measured
LegalBench (Vals AI)Not measured77.9%Only GPT-5.4 Nano measured
CaseLaw (Vals AI)52.6%51.9%Gemma 4 31B
CorpFin (Vals AI)Not measured61.2%Only GPT-5.4 Nano measured
TaxEval (Vals AI)Not measured67.4%Only GPT-5.4 Nano measured
MortgageTax (Vals AI)61.4%59.1%Gemma 4 31B
MedCode (Vals AI)Not measured41.0%Only GPT-5.4 Nano measured
SimpleQA Verified10.4%11.7%GPT-5.4 Nano
LMArena Text: science14571374Gemma 4 31B
LMArena Text: medicine and healthcare14511369Gemma 4 31B
LMArena Text: legal and government14381368Gemma 4 31B
LMArena Text: business and finance14301366Gemma 4 31B
FACTS Benchmark Suite45.3%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 5 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index1 board, none shared
Web design benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
LiveBench design58.4%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 8 boards here
GeneralLike-for-likePublic boards, shown as published, kept out of the index242
General benchmarks for Gemma 4 31B and GPT-5.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
LiveBench data analysis53.3%Not measuredOnly Gemma 4 31B measured
SAGE (Vals AI)55.0%38.1%Gemma 4 31B
MedScribe (Vals AI)Not measured77.1%Only GPT-5.4 Nano measured
Vals Multimodal IndexNot measured47.6%Only GPT-5.4 Nano measured
IFBench75.6%75.9%GPT-5.4 Nano
Long context reasoning (AA-LCR)69.7%76.7%GPT-5.4 Nano
DTBench82.7%80.3%Gemma 4 31B
LMCA39.3%36.9%Gemma 4 31B
Surface Evolver Bench30.6%Not measuredOnly Gemma 4 31B measured
LMArena Text14431372Gemma 4 31B
LMArena Text: instruction following14331362Gemma 4 31B
LMArena Text: creative writing14171315Gemma 4 31B
LMArena Vision12761196Gemma 4 31B
LMArena Text: English14511381Gemma 4 31B
LMArena Text: non-English14301359Gemma 4 31B
LMArena Text: Chinese14751391Gemma 4 31B
LMArena Text: GermanNot measured1368Only GPT-5.4 Nano measured
LMArena Text: JapaneseNot measured1343Only GPT-5.4 Nano measured
LMArena Text: KoreanNot measured1321Only GPT-5.4 Nano measured
LMArena Text: French14361395Gemma 4 31B
LMArena Text: Spanish14421371Gemma 4 31B
LMArena Text: Russian14601363Gemma 4 31B
LMArena Text: Polish14331366Gemma 4 31B
LMArena Text: multi-turn14521382Gemma 4 31B
LMArena Text: longer queries14461365Gemma 4 31B
LMArena Text: writing and language14321338Gemma 4 31B
LMArena Text: entertainment and media14051325Gemma 4 31B
LMArena Vision: English12711202Gemma 4 31B
LMArena Vision: Chinese13261232Gemma 4 31B
LMArena Vision: reading text12821204Gemma 4 31B
LMArena Vision: humor12801161Gemma 4 31B
LMArena Vision: captioning1218Not measuredOnly Gemma 4 31B measured
LMArena Vision: recognizing things12261141Gemma 4 31B
LMArena Vision: creative writing12851159Gemma 4 31B
LMArena Document1425Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 11 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.4 Nano
BenchmarkGemma 4 31BGPT-5.4 NanoLeader
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.0003Fits in one request
GPT-5.4 Nano$0.0008Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 4 31B$0.0082Fits in one request
GPT-5.4 Nano$0.014Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 4 31B$0.032Fits in one request
GPT-5.4 Nano$0.052Fits 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.4 Nano
SpecificationGoogle Gemma 4 31BOpenAI GPT-5.4 Nano
MakerGoogleOpenAI
WeightsOpen weightsNo public weights listed
ReleasedApril 2, 2026March 17, 2026
Context window262K400K
Input $/Mtok$0.14$0.20
Output $/Mtok$0.40$1.25
Coding index39.044.8
Independent measurements behind it22
Cost per solved taskNot computable$0.14
SourceOpenRouter listingOpenRouter listing

Questions

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

Pick GPT-5.4 Nano for coding: it scores 44.8 on the Vibe Coding Index against 39.0 for Gemma 4 31B. Pick Gemma 4 31B for output tokens 3.1x cheaper ($0.40 vs $1.25 per million) and work measured by WeirdML or LMArena Text: coding, where it leads.

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

Gemma 4 31B costs $0.14 per million input tokens and $0.40 per million output tokens; GPT-5.4 Nano costs $0.20 and $1.25. Cost per solved task is known for GPT-5.4 Nano only.

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

GPT-5.4 Nano, with 400K tokens against 262K.

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

56 benchmarks have a result for both models as of October 22, 2026. Gemma 4 31B's coding index rests on 2 independent benchmarks and GPT-5.4 Nano'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-5-4-nano" title="Gemma 4 31B vs GPT-5.4 Nano, 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-4-nano">LLMBenchmark.ai, Gemma 4 31B vs GPT-5.4 Nano</a></p>