Gemma 2 27B vs Phi 4
Updated October 21, 2026. 32 benchmarks have a result for both. Coding is ranked on the Vibe Coding Index; every other board is shown as published.
Decision reading
Neither model has a coding score yet, so the two cannot be ranked on coding.
Gemma 2 27B has the edge where what matters is LMArena Text: coding or Epoch Capabilities Index, where it leads.
- Shared results
- 32
- Gemma 2 27B only
- 4
- Phi 4 only
- 13
- Like-for-like categories
- 6 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.
Coding
Vibe Coding Index, six public coding benchmarks
No call
Neither has a coding score yet.
One side not measured
Intelligence
AA Intelligence Index
No call
Only Phi 4 has a AA Intelligence Index result, 5.9.
Directional only
Long documents
Listed context window
Phi 4
Phi 4 takes 16K tokens against 8K.
Listed by OpenRouter
Everyday cost
1K input + 500 output tokens
Phi 4
Gemma 2 27B $0.0010, Phi 4 $0.0001 per turn.
List prices
At a glance
- Coding index
- Gemma 2 27B not benchmarked, Phi 4 not benchmarked.
- Widest category
- Math, 15.1 points apart on average over 4 shared benchmarks.
- Widest single gap
- MATH level 5: Gemma 2 27B 27.9% against Phi 4 64.9%, 37.0 points apart on a 0 to 100 scale.
- Output price
- Gemma 2 27B $0.65 against Phi 4 $0.14 per million output tokens, 4.6x apart.
- Context window
- Gemma 2 27B takes 8K tokens, Phi 4 16K.
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 2 27B | Bars | Phi 4 | Ties |
|---|---|---|---|---|
| Coding | 1 | 1 | ||
| Intelligence | 0 | 1 | ||
| Reasoning | 0 | 4 | ||
| Math | 0 | 4 | ||
| Knowledge | 3 | 2 | ||
| General | 14 | 2 | ||
| All shared boards | 18 | 14 |
CodingLike-for-likeSix of these boards feed the Vibe Coding Index11
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| LiveCodeBench (Artificial Analysis run) | Not measured | 23.1% | Only Phi 4 measured |
| Terminal-Bench Hard (Artificial Analysis run) | Not measured | 3.8% | Only Phi 4 measured |
| LMArena Text: coding | 1211 | 1231 | Phi 4 |
| LMArena Text: software and IT | 1228 | 1228 | Gemma 2 27B |
| Neither model has a result on the other 34 boards here | |||
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index01
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| AA Intelligence Index | Not measured | 5.9 | Only Phi 4 measured |
| Epoch Capabilities Index | 122.1 | 130.5 | Phi 4 |
Agentic workDirectional onlyPublic boards, shown as published, kept out of the index2 boards, none shared
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| τ²-Bench Telecom | Not measured | 0.0% | Only Phi 4 measured |
| BALROG | Not measured | 11.6% | Only Phi 4 measured |
| Neither model has a result on the other 37 boards here | |||
ReasoningLike-for-likePublic boards, shown as published, kept out of the index04
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| GPQA Diamond (Artificial Analysis run) | Not measured | 57.5% | Only Phi 4 measured |
| Humanity's Last Exam (Artificial Analysis run) | Not measured | 3.8% | Only Phi 4 measured |
| GPQA Diamond (Epoch AI run) | 36.5% | 56.1% | Phi 4 |
| LMArena Text: hard prompts | 1198 | 1220 | Phi 4 |
| LMArena Text: expert | 1171 | 1203 | Phi 4 |
| LMArena Text: hard prompts in English | 1206 | 1230 | Phi 4 |
| Neither model has a result on the other 15 boards here | |||
MathLike-for-likePublic boards, shown as published, kept out of the index04
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| AA Math Index | Not measured | 18.0 | Only Phi 4 measured |
| AIME 2025 (Artificial Analysis run) | Not measured | 18.0% | Only Phi 4 measured |
| OTIS Mock AIME | 1.4% | 13.8% | Phi 4 |
| MATH level 5 | 27.9% | 64.9% | Phi 4 |
| LMArena Text: math | 1212 | 1246 | Phi 4 |
| LMArena Text: mathematical work | 1221 | 1254 | Phi 4 |
| Neither model has a result on the other 7 boards here | |||
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index32
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| LegalBench (Vals AI) | 68.0% | Not measured | Only Gemma 2 27B measured |
| MMLU Pro (Artificial Analysis run) | Not measured | 71.4% | Only Phi 4 measured |
| MMLU | 75.7% | 84.8% | Phi 4 |
| LMArena Text: science | 1228 | 1206 | Gemma 2 27B |
| LMArena Text: medicine and healthcare | 1198 | 1202 | Phi 4 |
| LMArena Text: legal and government | 1241 | 1241 | Gemma 2 27B |
| LMArena Text: business and finance | 1208 | 1199 | Gemma 2 27B |
| Neither model has a result on the other 10 boards here | |||
Web designNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| Neither model has a result on 9 boards here | |||
GeneralLike-for-likePublic boards, shown as published, kept out of the index142
| Benchmark | Gemma 2 27B | Phi 4 | Leader |
|---|---|---|---|
| IFBench | Not measured | 23.5% | Only Phi 4 measured |
| Long context reasoning (AA-LCR) | Not measured | 0.0% | Only Phi 4 measured |
| DTBench | 48.0% | Not measured | Only Gemma 2 27B measured |
| LMCA | 7.1% | Not measured | Only Gemma 2 27B measured |
| Creative writing (Lech Mazur) | Not measured | 62.6% | Only Phi 4 measured |
| LMArena Text | 1231 | 1217 | Gemma 2 27B |
| LMArena Text: instruction following | 1206 | 1201 | Gemma 2 27B |
| LMArena Text: creative writing | 1240 | 1181 | Gemma 2 27B |
| LMArena Text: English | 1242 | 1231 | Gemma 2 27B |
| LMArena Text: non-English | 1217 | 1197 | Gemma 2 27B |
| LMArena Text: Chinese | 1221 | 1212 | Gemma 2 27B |
| LMArena Text: German | 1209 | 1222 | Phi 4 |
| LMArena Text: Japanese | 1175 | 1158 | Gemma 2 27B |
| LMArena Text: Korean | 1174 | 1151 | Gemma 2 27B |
| LMArena Text: French | 1248 | 1224 | Gemma 2 27B |
| LMArena Text: Spanish | 1228 | 1234 | Phi 4 |
| LMArena Text: Russian | 1234 | 1209 | Gemma 2 27B |
| LMArena Text: Polish | 1277 | Not measured | Only Gemma 2 27B measured |
| LMArena Text: multi-turn | 1224 | 1206 | Gemma 2 27B |
| LMArena Text: longer queries | 1230 | 1217 | Gemma 2 27B |
| LMArena Text: writing and language | 1249 | 1198 | Gemma 2 27B |
| LMArena Text: entertainment and media | 1212 | 1162 | Gemma 2 27B |
| Neither model has a result on the other 24 boards here | |||
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | Gemma 2 27B | Phi 4 | 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
Phi 4 costs less
Repository review
50K input + 3K output tokens
Phi 4 costs less
Agent loop
200K input + 10K output tokens
Phi 4 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 2 27B | Microsoft Phi 4 |
|---|---|---|
| Maker | Microsoft | |
| Weights | Open weights | Open weights |
| Released | July 13, 2024 | January 10, 2025 |
| Context window | 8K | 16K |
| Input $/Mtok | $0.65 | $0.07 |
| Output $/Mtok | $0.65 | $0.14 |
| Coding index | Not benchmarked | Not benchmarked |
| Independent measurements behind it | 0 | 0 |
| Cost per solved task | Not computable | Not computable |
| Source | OpenRouter listing | OpenRouter listing |
Questions
Is Gemma 2 27B better than Phi 4 for coding?
Neither model has a coding score yet, so the two cannot be ranked on coding. Gemma 2 27B has the edge where what matters is LMArena Text: coding or Epoch Capabilities Index, where it leads.
Which is cheaper, Gemma 2 27B or Phi 4?
Gemma 2 27B costs $0.65 per million input tokens and $0.65 per million output tokens; Phi 4 costs $0.07 and $0.14. Cost per solved task is known for neither of them.
Which has the bigger context window, Gemma 2 27B or Phi 4?
Phi 4, with 16K tokens against 8K.
How many benchmarks is the Gemma 2 27B vs Phi 4 comparison based on?
32 benchmarks have a result for both models as of October 21, 2026. Gemma 2 27B's coding index rests on 0 independent benchmarks and Phi 4's on 0. Where only one model has a result, the page says so instead of naming a winner.