Enter opens the highlighted result. Esc closes.

Gemma 4 31B vs Qwen3.8 27B

Qwen3.8 27B leads Gemma 4 31B on coding, 74.2 to 39.0 on the Vibe Coding Index, and Gemma 4 31B costs 6.4x less per output token ($0.40 vs $2.55 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
19
Qwen3.8 27BQwen
Coding
74.2
Overall
59.6
Output $/M
$2.55
37
vs boards won of 56 shared

Gemma 4 31B or Qwen3.8 27B: which to pick

Pick Qwen3.8 27B for coding: it scores 74.2 on the Vibe Coding Index against 39.0 for Gemma 4 31B.

Pick Gemma 4 31B for output tokens 6.4x cheaper ($0.40 vs $2.55 per million) and work measured by LMArena Vision: homework or LMArena Text: math, where it leads.

Shared results
56
Gemma 4 31B only
15
Qwen3.8 27B only
29
Like-for-like categories
8 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, Qwen3.8 27B 74.2 from 4 benchmarks.
Widest category
Agentic work, 24.8 points apart on average over 4 shared benchmarks.
Widest single gap
AA Agentic Index: Gemma 4 31B 4.2 against Qwen3.8 27B 45.8, 41.6 points apart on a 0 to 100 scale.
Output price
Gemma 4 31B $0.40 against Qwen3.8 27B $2.55 per million output tokens, 6.4x apart.
Context window
Gemma 4 31B takes 262K tokens, Qwen3.8 27B 1M.

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 31BBarsQwen3.8 27BTies
Coding08
Intelligence02
Agentic work04
Reasoning17
Math20
Knowledge14
Web design01
General1511
All shared boards1937
CodingLike-for-likeSix of these boards feed the Vibe Coding Index08
Coding benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
LiveBench coding49.0%86.8%Qwen3.8 27B
LMArena WebDev13671593Qwen3.8 27B
AA Coding Index43.468.1Qwen3.8 27B
LiveCodeBench (Vals AI)Not measured84.0%Only Qwen3.8 27B measured
SWE-bench Verified (Vals AI)Not measured86.0%Only Qwen3.8 27B measured
Vibe Code Bench (Vals AI)Not measured64.8%Only Qwen3.8 27B measured
Code migration (Vals AI)Not measured14.2%Only Qwen3.8 27B measured
ProgramBench (Vals AI)Not measured0.0%Only Qwen3.8 27B measured
IOI (Vals AI)Not measured39.1%Only Qwen3.8 27B measured
Terminal-Bench 2.1 (Vals AI)Not measured58.4%Only Qwen3.8 27B measured
SkillsBench (Vals AI)Not measured38.1%Only Qwen3.8 27B measured
CyberBench (Vals AI)Not measured67.8%Only Qwen3.8 27B measured
SciCode45.5%46.6%Qwen3.8 27B
Terminal-Bench Hard (Artificial Analysis run)36.4%Not measuredOnly Gemma 4 31B measured
WeirdML52.3%Not measuredOnly Gemma 4 31B measured
ALE-Bench925.5Not measuredOnly Gemma 4 31B measured
LMArena Text: coding14591483Qwen3.8 27B
LMArena Text: software and IT14631478Qwen3.8 27B
LMArena WebDev: React13591602Qwen3.8 27B
LMArena WebDev: HTML13801570Qwen3.8 27B
LMArena WebDev: from an imageNot measured1577Only Qwen3.8 27B measured
SciCode8.9%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 17 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index02
Intelligence benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
AA Intelligence Index14.733.7Qwen3.8 27B
Epoch Capabilities Index143.0151.7Qwen3.8 27B
Agentic workLike-for-likePublic boards, shown as published, kept out of the index04
Agentic work benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
AA Agentic Index4.245.8Qwen3.8 27B
LiveBench research44.4%59.4%Qwen3.8 27B
LiveBench browser4.0%32.0%Qwen3.8 27B
LiveBench long agentic13.3%27.9%Qwen3.8 27B
Finance Agent (Vals AI)Not measured48.5%Only Qwen3.8 27B measured
Tax Agent Bench (Vals AI)Not measured30.9%Only Qwen3.8 27B measured
Legal Research Bench (Vals AI)Not measured36.1%Only Qwen3.8 27B measured
Excel Modeling Benchmark (Vals AI)Not measured59.7%Only Qwen3.8 27B measured
Terminal-Bench-Science (Vals AI)Not measured0.0%Only Qwen3.8 27B measured
τ²-Bench Telecom65.5%Not measuredOnly Gemma 4 31B measured
APEX-AgentsNot measured47.5%Only Qwen3.8 27B measured
Neither model has a result on the other 30 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index17
Reasoning benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
GPQA DiamondNot measured88.9%Only Qwen3.8 27B measured
LiveBench reasoning68.3%80.0%Qwen3.8 27B
MMMU Pro (Vals AI)Not measured83.9%Only Qwen3.8 27B measured
GPQA Diamond (Artificial Analysis run)85.7%90.5%Qwen3.8 27B
Humanity's Last Exam (Artificial Analysis run)23.6%33.9%Qwen3.8 27B
GPQA Diamond (Epoch AI run)75.8%Not measuredOnly Gemma 4 31B measured
ARC-AGINot measured87.5%Only Qwen3.8 27B measured
ARC-AGI-2Not measured42.4%Only Qwen3.8 27B measured
LMArena Text: hard prompts14481459Qwen3.8 27B
LMArena Text: expert14641479Qwen3.8 27B
LMArena Text: hard prompts in English14561461Qwen3.8 27B
LMArena Vision: diagrams12831285Qwen3.8 27B
LMArena Vision: homework13101295Gemma 4 31B
Kagi LLM Benchmark63.5%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 8 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index20
Math benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
OTIS Mock AIME73.3%Not measuredOnly Gemma 4 31B measured
ProofBenchNot measured16.0%Only Qwen3.8 27B measured
LMArena Text: math14631455Gemma 4 31B
LMArena Text: mathematical work14651458Gemma 4 31B
Neither model has a result on the other 9 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index14
Knowledge benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
MMLU ProNot measured84.3%Only Qwen3.8 27B measured
LegalBench (Vals AI)Not measured82.4%Only Qwen3.8 27B measured
CaseLaw (Vals AI)52.6%Not measuredOnly Gemma 4 31B measured
TaxEval (Vals AI)Not measured70.8%Only Qwen3.8 27B measured
MortgageTax (Vals AI)61.4%64.9%Qwen3.8 27B
MedCode (Vals AI)Not measured28.7%Only Qwen3.8 27B measured
SimpleQA Verified10.4%Not measuredOnly Gemma 4 31B measured
LMArena Text: science14571467Qwen3.8 27B
LMArena Text: medicine and healthcare14511437Gemma 4 31B
LMArena Text: legal and government14381447Qwen3.8 27B
LMArena Text: business and finance14301438Qwen3.8 27B
FACTS Benchmark Suite45.3%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 6 boards here
Web designLike-for-likePublic boards, shown as published, kept out of the index01
Web design benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
LiveBench design58.4%75.9%Qwen3.8 27B
Neither model has a result on the other 8 boards here
GeneralLike-for-likePublic boards, shown as published, kept out of the index1511
General benchmarks for Gemma 4 31B and Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
LiveBench data analysis53.3%76.6%Qwen3.8 27B
SAGE (Vals AI)55.0%52.4%Gemma 4 31B
MedScribe (Vals AI)Not measured83.8%Only Qwen3.8 27B measured
IFBench75.6%Not measuredOnly Gemma 4 31B measured
Long context reasoning (AA-LCR)69.7%82.0%Qwen3.8 27B
DTBench82.7%88.0%Qwen3.8 27B
LMCA39.3%41.4%Qwen3.8 27B
Surface Evolver Bench30.6%45.0%Qwen3.8 27B
LMArena Text14431440Gemma 4 31B
LMArena Text: instruction following14331436Qwen3.8 27B
LMArena Text: creative writing14171383Gemma 4 31B
LMArena Vision12761269Gemma 4 31B
LMArena Text: English14511448Gemma 4 31B
LMArena Text: non-English14301428Gemma 4 31B
LMArena Text: Chinese14751501Qwen3.8 27B
LMArena Text: GermanNot measured1443Only Qwen3.8 27B measured
LMArena Text: JapaneseNot measured1387Only Qwen3.8 27B measured
LMArena Text: KoreanNot measured1384Only Qwen3.8 27B measured
LMArena Text: French14361465Qwen3.8 27B
LMArena Text: Spanish14421449Qwen3.8 27B
LMArena Text: Russian14601415Gemma 4 31B
LMArena Text: Polish14331439Qwen3.8 27B
LMArena Text: multi-turn14521440Gemma 4 31B
LMArena Text: longer queries14461448Qwen3.8 27B
LMArena Text: writing and language14321405Gemma 4 31B
LMArena Text: entertainment and media14051393Gemma 4 31B
LMArena Vision: English12711267Gemma 4 31B
LMArena Vision: Chinese13261326Gemma 4 31B
LMArena Vision: reading text12821281Gemma 4 31B
LMArena Vision: humor12801235Gemma 4 31B
LMArena Vision: captioning1218Not measuredOnly Gemma 4 31B measured
LMArena Vision: recognizing things1226Not measuredOnly Gemma 4 31B measured
LMArena Vision: creative writing12851237Gemma 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 Qwen3.8 27B
BenchmarkGemma 4 31BQwen3.8 27BLeader
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
Qwen3.8 27B$0.0017Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 4 31B$0.0082Fits in one request
Qwen3.8 27B$0.029Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 4 31B$0.032Fits in one request
Qwen3.8 27B$0.111Fits 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 Qwen3.8 27B
SpecificationGoogle Gemma 4 31BQwen3.8 27B
MakerGoogleQwen
WeightsOpen weightsOpen weights
ReleasedApril 2, 2026August 14, 2026
Context window262K1M
Input $/Mtok$0.14$0.425
Output $/Mtok$0.40$2.55
Coding index39.074.2
Independent measurements behind it24
Cost per solved taskNot computable$1.26
SourceOpenRouter listingOpenRouter listing

Questions

Is Gemma 4 31B better than Qwen3.8 27B for coding?

Pick Qwen3.8 27B for coding: it scores 74.2 on the Vibe Coding Index against 39.0 for Gemma 4 31B. Pick Gemma 4 31B for output tokens 6.4x cheaper ($0.40 vs $2.55 per million) and work measured by LMArena Vision: homework or LMArena Text: math, where it leads.

Which is cheaper, Gemma 4 31B or Qwen3.8 27B?

Gemma 4 31B costs $0.14 per million input tokens and $0.40 per million output tokens; Qwen3.8 27B costs $0.425 and $2.55. Cost per solved task is known for Qwen3.8 27B only.

Which has the bigger context window, Gemma 4 31B or Qwen3.8 27B?

Qwen3.8 27B, with 1M tokens against 262K.

How many benchmarks is the Gemma 4 31B vs Qwen3.8 27B 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 Qwen3.8 27B's on 4. 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-qwen3-8-27b" title="Gemma 4 31B vs Qwen3.8 27B, 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-qwen3-8-27b">LLMBenchmark.ai, Gemma 4 31B vs Qwen3.8 27B</a></p>