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 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.
Coding
Vibe Coding Index, six public coding benchmarks
Qwen3.8 27B
Qwen3.8 27B scores 74.2 against 39.0.
2 and 4 benchmarks behind the scores
Intelligence
AA Intelligence Index
Qwen3.8 27B
Qwen3.8 27B leads, 33.7 against 14.7.
Same board, both measured
Agentic work
AA Agentic Index
Qwen3.8 27B
Qwen3.8 27B leads, 45.8 against 4.2.
Same board, both measured
Reasoning
GPQA Diamond
No call
Only Qwen3.8 27B has a GPQA Diamond result, 88.9%.
Directional only
Knowledge
MMLU Pro
No call
Only Qwen3.8 27B has a MMLU Pro result, 84.3%.
Directional only
Long documents
Listed context window
Qwen3.8 27B
Qwen3.8 27B takes 1M tokens against 262K.
Listed by OpenRouter
Everyday cost
1K input + 500 output tokens
Gemma 4 31B
Gemma 4 31B $0.0003, Qwen3.8 27B $0.0017 per turn.
List prices
Cost per solved task
One SWE-bench Verified task, solved
No call
Only Qwen3.8 27B has the number, $1.26.
Directional only
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.
| Category | Gemma 4 31B | Bars | Qwen3.8 27B | Ties |
|---|---|---|---|---|
| Coding | 0 | 8 | ||
| Intelligence | 0 | 2 | ||
| Agentic work | 0 | 4 | ||
| Reasoning | 1 | 7 | ||
| Math | 2 | 0 | ||
| Knowledge | 1 | 4 | ||
| Web design | 0 | 1 | ||
| General | 15 | 11 | ||
| All shared boards | 19 | 37 |
CodingLike-for-likeSix of these boards feed the Vibe Coding Index08
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| LiveBench coding | 49.0% | 86.8% | Qwen3.8 27B |
| LMArena WebDev | 1367 | 1593 | Qwen3.8 27B |
| AA Coding Index | 43.4 | 68.1 | Qwen3.8 27B |
| LiveCodeBench (Vals AI) | Not measured | 84.0% | Only Qwen3.8 27B measured |
| SWE-bench Verified (Vals AI) | Not measured | 86.0% | Only Qwen3.8 27B measured |
| Vibe Code Bench (Vals AI) | Not measured | 64.8% | Only Qwen3.8 27B measured |
| Code migration (Vals AI) | Not measured | 14.2% | Only Qwen3.8 27B measured |
| ProgramBench (Vals AI) | Not measured | 0.0% | Only Qwen3.8 27B measured |
| IOI (Vals AI) | Not measured | 39.1% | Only Qwen3.8 27B measured |
| Terminal-Bench 2.1 (Vals AI) | Not measured | 58.4% | Only Qwen3.8 27B measured |
| SkillsBench (Vals AI) | Not measured | 38.1% | Only Qwen3.8 27B measured |
| CyberBench (Vals AI) | Not measured | 67.8% | Only Qwen3.8 27B measured |
| SciCode | 45.5% | 46.6% | Qwen3.8 27B |
| Terminal-Bench Hard (Artificial Analysis run) | 36.4% | Not measured | Only Gemma 4 31B measured |
| WeirdML | 52.3% | Not measured | Only Gemma 4 31B measured |
| ALE-Bench | 925.5 | Not measured | Only Gemma 4 31B measured |
| LMArena Text: coding | 1459 | 1483 | Qwen3.8 27B |
| LMArena Text: software and IT | 1463 | 1478 | Qwen3.8 27B |
| LMArena WebDev: React | 1359 | 1602 | Qwen3.8 27B |
| LMArena WebDev: HTML | 1380 | 1570 | Qwen3.8 27B |
| LMArena WebDev: from an image | Not measured | 1577 | Only Qwen3.8 27B measured |
| SciCode | 8.9% | Not measured | Only 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
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| AA Intelligence Index | 14.7 | 33.7 | Qwen3.8 27B |
| Epoch Capabilities Index | 143.0 | 151.7 | Qwen3.8 27B |
Agentic workLike-for-likePublic boards, shown as published, kept out of the index04
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| AA Agentic Index | 4.2 | 45.8 | Qwen3.8 27B |
| LiveBench research | 44.4% | 59.4% | Qwen3.8 27B |
| LiveBench browser | 4.0% | 32.0% | Qwen3.8 27B |
| LiveBench long agentic | 13.3% | 27.9% | Qwen3.8 27B |
| Finance Agent (Vals AI) | Not measured | 48.5% | Only Qwen3.8 27B measured |
| Tax Agent Bench (Vals AI) | Not measured | 30.9% | Only Qwen3.8 27B measured |
| Legal Research Bench (Vals AI) | Not measured | 36.1% | Only Qwen3.8 27B measured |
| Excel Modeling Benchmark (Vals AI) | Not measured | 59.7% | Only Qwen3.8 27B measured |
| Terminal-Bench-Science (Vals AI) | Not measured | 0.0% | Only Qwen3.8 27B measured |
| τ²-Bench Telecom | 65.5% | Not measured | Only Gemma 4 31B measured |
| APEX-Agents | Not measured | 47.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
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| GPQA Diamond | Not measured | 88.9% | Only Qwen3.8 27B measured |
| LiveBench reasoning | 68.3% | 80.0% | Qwen3.8 27B |
| MMMU Pro (Vals AI) | Not measured | 83.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 measured | Only Gemma 4 31B measured |
| ARC-AGI | Not measured | 87.5% | Only Qwen3.8 27B measured |
| ARC-AGI-2 | Not measured | 42.4% | Only Qwen3.8 27B measured |
| LMArena Text: hard prompts | 1448 | 1459 | Qwen3.8 27B |
| LMArena Text: expert | 1464 | 1479 | Qwen3.8 27B |
| LMArena Text: hard prompts in English | 1456 | 1461 | Qwen3.8 27B |
| LMArena Vision: diagrams | 1283 | 1285 | Qwen3.8 27B |
| LMArena Vision: homework | 1310 | 1295 | Gemma 4 31B |
| Kagi LLM Benchmark | 63.5% | Not measured | Only 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
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| OTIS Mock AIME | 73.3% | Not measured | Only Gemma 4 31B measured |
| ProofBench | Not measured | 16.0% | Only Qwen3.8 27B measured |
| LMArena Text: math | 1463 | 1455 | Gemma 4 31B |
| LMArena Text: mathematical work | 1465 | 1458 | Gemma 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
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| MMLU Pro | Not measured | 84.3% | Only Qwen3.8 27B measured |
| LegalBench (Vals AI) | Not measured | 82.4% | Only Qwen3.8 27B measured |
| CaseLaw (Vals AI) | 52.6% | Not measured | Only Gemma 4 31B measured |
| TaxEval (Vals AI) | Not measured | 70.8% | Only Qwen3.8 27B measured |
| MortgageTax (Vals AI) | 61.4% | 64.9% | Qwen3.8 27B |
| MedCode (Vals AI) | Not measured | 28.7% | Only Qwen3.8 27B measured |
| SimpleQA Verified | 10.4% | Not measured | Only Gemma 4 31B measured |
| LMArena Text: science | 1457 | 1467 | Qwen3.8 27B |
| LMArena Text: medicine and healthcare | 1451 | 1437 | Gemma 4 31B |
| LMArena Text: legal and government | 1438 | 1447 | Qwen3.8 27B |
| LMArena Text: business and finance | 1430 | 1438 | Qwen3.8 27B |
| FACTS Benchmark Suite | 45.3% | Not measured | Only 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
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| LiveBench design | 58.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
| Benchmark | Gemma 4 31B | Qwen3.8 27B | Leader |
|---|---|---|---|
| LiveBench data analysis | 53.3% | 76.6% | Qwen3.8 27B |
| SAGE (Vals AI) | 55.0% | 52.4% | Gemma 4 31B |
| MedScribe (Vals AI) | Not measured | 83.8% | Only Qwen3.8 27B measured |
| IFBench | 75.6% | Not measured | Only Gemma 4 31B measured |
| Long context reasoning (AA-LCR) | 69.7% | 82.0% | Qwen3.8 27B |
| DTBench | 82.7% | 88.0% | Qwen3.8 27B |
| LMCA | 39.3% | 41.4% | Qwen3.8 27B |
| Surface Evolver Bench | 30.6% | 45.0% | Qwen3.8 27B |
| LMArena Text | 1443 | 1440 | Gemma 4 31B |
| LMArena Text: instruction following | 1433 | 1436 | Qwen3.8 27B |
| LMArena Text: creative writing | 1417 | 1383 | Gemma 4 31B |
| LMArena Vision | 1276 | 1269 | Gemma 4 31B |
| LMArena Text: English | 1451 | 1448 | Gemma 4 31B |
| LMArena Text: non-English | 1430 | 1428 | Gemma 4 31B |
| LMArena Text: Chinese | 1475 | 1501 | Qwen3.8 27B |
| LMArena Text: German | Not measured | 1443 | Only Qwen3.8 27B measured |
| LMArena Text: Japanese | Not measured | 1387 | Only Qwen3.8 27B measured |
| LMArena Text: Korean | Not measured | 1384 | Only Qwen3.8 27B measured |
| LMArena Text: French | 1436 | 1465 | Qwen3.8 27B |
| LMArena Text: Spanish | 1442 | 1449 | Qwen3.8 27B |
| LMArena Text: Russian | 1460 | 1415 | Gemma 4 31B |
| LMArena Text: Polish | 1433 | 1439 | Qwen3.8 27B |
| LMArena Text: multi-turn | 1452 | 1440 | Gemma 4 31B |
| LMArena Text: longer queries | 1446 | 1448 | Qwen3.8 27B |
| LMArena Text: writing and language | 1432 | 1405 | Gemma 4 31B |
| LMArena Text: entertainment and media | 1405 | 1393 | Gemma 4 31B |
| LMArena Vision: English | 1271 | 1267 | Gemma 4 31B |
| LMArena Vision: Chinese | 1326 | 1326 | Gemma 4 31B |
| LMArena Vision: reading text | 1282 | 1281 | Gemma 4 31B |
| LMArena Vision: humor | 1280 | 1235 | Gemma 4 31B |
| LMArena Vision: captioning | 1218 | Not measured | Only Gemma 4 31B measured |
| LMArena Vision: recognizing things | 1226 | Not measured | Only Gemma 4 31B measured |
| LMArena Vision: creative writing | 1285 | 1237 | 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 | Qwen3.8 27B | 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 | Qwen3.8 27B |
|---|---|---|
| Maker | Qwen | |
| Weights | Open weights | Open weights |
| Released | April 2, 2026 | August 14, 2026 |
| Context window | 262K | 1M |
| Input $/Mtok | $0.14 | $0.425 |
| Output $/Mtok | $0.40 | $2.55 |
| Coding index | 39.0 | 74.2 |
| Independent measurements behind it | 2 | 4 |
| Cost per solved task | Not computable | $1.26 |
| Source | OpenRouter listing | OpenRouter 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.