Enter opens the highlighted result. Esc closes.

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.

Gemma 2 27BGoogle
Coding
No data
Overall
No data
Output $/M
$0.65
18
Phi 4Microsoft
Coding
No data
Overall
5.9
Output $/M
$0.14
14
vs boards won of 32 shared

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.

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.

Boards won, where both have a result
CategoryGemma 2 27BBarsPhi 4Ties
Coding11
Intelligence01
Reasoning04
Math04
Knowledge32
General142
All shared boards1814
CodingLike-for-likeSix of these boards feed the Vibe Coding Index11
Coding benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
LiveCodeBench (Artificial Analysis run)Not measured23.1%Only Phi 4 measured
Terminal-Bench Hard (Artificial Analysis run)Not measured3.8%Only Phi 4 measured
LMArena Text: coding12111231Phi 4
LMArena Text: software and IT12281228Gemma 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
Intelligence benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
AA Intelligence IndexNot measured5.9Only Phi 4 measured
Epoch Capabilities Index122.1130.5Phi 4
Agentic workDirectional onlyPublic boards, shown as published, kept out of the index2 boards, none shared
Agentic work benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
τ²-Bench TelecomNot measured0.0%Only Phi 4 measured
BALROGNot measured11.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
Reasoning benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
GPQA Diamond (Artificial Analysis run)Not measured57.5%Only Phi 4 measured
Humanity's Last Exam (Artificial Analysis run)Not measured3.8%Only Phi 4 measured
GPQA Diamond (Epoch AI run)36.5%56.1%Phi 4
LMArena Text: hard prompts11981220Phi 4
LMArena Text: expert11711203Phi 4
LMArena Text: hard prompts in English12061230Phi 4
Neither model has a result on the other 15 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index04
Math benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
AA Math IndexNot measured18.0Only Phi 4 measured
AIME 2025 (Artificial Analysis run)Not measured18.0%Only Phi 4 measured
OTIS Mock AIME1.4%13.8%Phi 4
MATH level 527.9%64.9%Phi 4
LMArena Text: math12121246Phi 4
LMArena Text: mathematical work12211254Phi 4
Neither model has a result on the other 7 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index32
Knowledge benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
LegalBench (Vals AI)68.0%Not measuredOnly Gemma 2 27B measured
MMLU Pro (Artificial Analysis run)Not measured71.4%Only Phi 4 measured
MMLU75.7%84.8%Phi 4
LMArena Text: science12281206Gemma 2 27B
LMArena Text: medicine and healthcare11981202Phi 4
LMArena Text: legal and government12411241Gemma 2 27B
LMArena Text: business and finance12081199Gemma 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
Web design benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
Neither model has a result on 9 boards here
GeneralLike-for-likePublic boards, shown as published, kept out of the index142
General benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
IFBenchNot measured23.5%Only Phi 4 measured
Long context reasoning (AA-LCR)Not measured0.0%Only Phi 4 measured
DTBench48.0%Not measuredOnly Gemma 2 27B measured
LMCA7.1%Not measuredOnly Gemma 2 27B measured
Creative writing (Lech Mazur)Not measured62.6%Only Phi 4 measured
LMArena Text12311217Gemma 2 27B
LMArena Text: instruction following12061201Gemma 2 27B
LMArena Text: creative writing12401181Gemma 2 27B
LMArena Text: English12421231Gemma 2 27B
LMArena Text: non-English12171197Gemma 2 27B
LMArena Text: Chinese12211212Gemma 2 27B
LMArena Text: German12091222Phi 4
LMArena Text: Japanese11751158Gemma 2 27B
LMArena Text: Korean11741151Gemma 2 27B
LMArena Text: French12481224Gemma 2 27B
LMArena Text: Spanish12281234Phi 4
LMArena Text: Russian12341209Gemma 2 27B
LMArena Text: Polish1277Not measuredOnly Gemma 2 27B measured
LMArena Text: multi-turn12241206Gemma 2 27B
LMArena Text: longer queries12301217Gemma 2 27B
LMArena Text: writing and language12491198Gemma 2 27B
LMArena Text: entertainment and media12121162Gemma 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
Image generation benchmarks for Gemma 2 27B and Phi 4
BenchmarkGemma 2 27BPhi 4Leader
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 2 27B$0.0010Fits in one request
Phi 4$0.0001Fits in one request

Phi 4 costs less

Repository review

50K input + 3K output tokens

Gemma 2 27B$0.034Exceeds the context window
Phi 4$0.0039Exceeds the context window

Phi 4 costs less

Agent loop

200K input + 10K output tokens

Gemma 2 27B$0.137Exceeds the context window
Phi 4$0.015Exceeds the context window

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.

Specifications of Gemma 2 27B and Phi 4
SpecificationGoogle Gemma 2 27BMicrosoft Phi 4
MakerGoogleMicrosoft
WeightsOpen weightsOpen weights
ReleasedJuly 13, 2024January 10, 2025
Context window8K16K
Input $/Mtok$0.65$0.07
Output $/Mtok$0.65$0.14
Coding indexNot benchmarkedNot benchmarked
Independent measurements behind it00
Cost per solved taskNot computableNot computable
SourceOpenRouter listingOpenRouter 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.

Compare next