Enter opens the highlighted result. Esc closes.

Gemma 3 12B vs Phi 4

Updated October 21, 2026. 36 benchmarks have a result for both. Coding is ranked on the Vibe Coding Index; every other board is shown as published.

Gemma 3 12BGoogle
Coding
No data
Overall
3.8
Output $/M
$0.1625
29
Phi 4Microsoft
Coding
No data
Overall
5.9
Output $/M
$0.14
7
vs boards won of 36 shared

Decision reading

Neither model has a coding score yet, so the two cannot be ranked on coding.

Gemma 3 12B has the edge where the context window is larger, 131K against 16K tokens, and where what matters is LiveCodeBench (Artificial Analysis run) or Terminal-Bench Hard (Artificial Analysis run), where it leads.

Shared results
36
Gemma 3 12B only
5
Phi 4 only
9
Like-for-like categories
7 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 3 12B not benchmarked, Phi 4 not benchmarked.
Widest category
Knowledge, 22.7 points apart on average over 5 shared benchmarks.
Widest single gap
LMArena Text: business and finance: Gemma 3 12B 1376 against Phi 4 1199, 29.6 points apart on a 0 to 100 scale.
Output price
Gemma 3 12B $0.1625 against Phi 4 $0.14 per million output tokens, 1.2x apart.
Context window
Gemma 3 12B takes 131K 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 3 12BBarsPhi 4Ties
Coding22
Intelligence02
Agentic work10
Reasoning42
Math50
Knowledge41
General130
All shared boards297
CodingLike-for-likeSix of these boards feed the Vibe Coding Index22
Coding benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
AA Coding Index5.8Not measuredOnly Gemma 3 12B measured
LiveCodeBench (Artificial Analysis run)13.7%23.1%Phi 4
SciCode16.4%Not measuredOnly Gemma 3 12B measured
Terminal-Bench Hard (Artificial Analysis run)0.8%3.8%Phi 4
LMArena Text: coding12811231Gemma 3 12B
LMArena Text: software and IT13131228Gemma 3 12B
Neither model has a result on the other 32 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index02
Intelligence benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
AA Intelligence Index3.85.9Phi 4
Epoch Capabilities Index123.5130.5Phi 4
Agentic workLike-for-likePublic boards, shown as published, kept out of the index10
Agentic work benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
AA Agentic Index0.1Not measuredOnly Gemma 3 12B measured
τ²-Bench Telecom10.8%0.0%Gemma 3 12B
BALROGNot measured11.6%Only Phi 4 measured
Neither model has a result on the other 36 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index42
Reasoning benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
GPQA Diamond (Artificial Analysis run)34.9%57.5%Phi 4
Humanity's Last Exam (Artificial Analysis run)4.2%3.8%Gemma 3 12B
GPQA Diamond (Epoch AI run)39.5%56.1%Phi 4
LMArena Text: hard prompts13091220Gemma 3 12B
LMArena Text: expert12481203Gemma 3 12B
LMArena Text: hard prompts in English13181230Gemma 3 12B
Neither model has a result on the other 15 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index50
Math benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
AA Math Index18.318.0Gemma 3 12B
AIME 2025 (Artificial Analysis run)18.3%18.0%Gemma 3 12B
OTIS Mock AIME16.7%13.8%Gemma 3 12B
MATH level 5Not measured64.9%Only Phi 4 measured
LMArena Text: math13071246Gemma 3 12B
LMArena Text: mathematical work13361254Gemma 3 12B
Neither model has a result on the other 7 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index41
Knowledge benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
MMLU Pro (Artificial Analysis run)59.5%71.4%Phi 4
MMLUNot measured84.8%Only Phi 4 measured
LMArena Text: science13661206Gemma 3 12B
LMArena Text: medicine and healthcare13341202Gemma 3 12B
LMArena Text: legal and government13811241Gemma 3 12B
LMArena Text: business and finance13761199Gemma 3 12B
Neither model has a result on the other 11 boards here
Web designNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
Web design benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
Neither model has a result on 9 boards here
GeneralLike-for-likePublic boards, shown as published, kept out of the index130
General benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 4Leader
IFBench36.7%23.5%Gemma 3 12B
Long context reasoning (AA-LCR)8.3%0.0%Gemma 3 12B
DTBench48.8%Not measuredOnly Gemma 3 12B measured
LMCA4.5%Not measuredOnly Gemma 3 12B measured
Creative writing (Lech Mazur)Not measured62.6%Only Phi 4 measured
LMArena Text13341217Gemma 3 12B
LMArena Text: instruction following12991201Gemma 3 12B
LMArena Text: creative writing13311181Gemma 3 12B
LMArena Text: English13491231Gemma 3 12B
LMArena Text: non-English13181197Gemma 3 12B
LMArena Text: ChineseNot measured1212Only Phi 4 measured
LMArena Text: German13701222Gemma 3 12B
LMArena Text: JapaneseNot measured1158Only Phi 4 measured
LMArena Text: KoreanNot measured1151Only Phi 4 measured
LMArena Text: FrenchNot measured1224Only Phi 4 measured
LMArena Text: SpanishNot measured1234Only Phi 4 measured
LMArena Text: Russian13351209Gemma 3 12B
LMArena Text: multi-turn13341206Gemma 3 12B
LMArena Text: longer queries13171217Gemma 3 12B
LMArena Text: writing and language13071198Gemma 3 12B
LMArena Text: entertainment and media12971162Gemma 3 12B
Neither model has a result on the other 25 boards here
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
Image generation benchmarks for Gemma 3 12B and Phi 4
BenchmarkGemma 3 12BPhi 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 3 12B$0.0002Fits in one request
Phi 4$0.0001Fits in one request

Phi 4 costs less

Repository review

50K input + 3K output tokens

Gemma 3 12B$0.0042Fits in one request
Phi 4$0.0039Exceeds the context window

Phi 4 costs less

Agent loop

200K input + 10K output tokens

Gemma 3 12B$0.017Exceeds 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 3 12B and Phi 4
SpecificationGoogle Gemma 3 12BMicrosoft Phi 4
MakerGoogleMicrosoft
WeightsOpen weightsOpen weights
ReleasedMarch 13, 2025January 10, 2025
Context window131K16K
Input $/Mtok$0.075$0.07
Output $/Mtok$0.1625$0.14
Coding indexNot benchmarkedNot benchmarked
Independent measurements behind it00
Cost per solved taskNot computableNot computable
SourceOpenRouter listingOpenRouter listing

Questions

Is Gemma 3 12B better than Phi 4 for coding?

Neither model has a coding score yet, so the two cannot be ranked on coding. Gemma 3 12B has the edge where the context window is larger, 131K against 16K tokens, and where what matters is LiveCodeBench (Artificial Analysis run) or Terminal-Bench Hard (Artificial Analysis run), where it leads.

Which is cheaper, Gemma 3 12B or Phi 4?

Gemma 3 12B costs $0.075 per million input tokens and $0.1625 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 3 12B or Phi 4?

Gemma 3 12B, with 131K tokens against 16K.

How many benchmarks is the Gemma 3 12B vs Phi 4 comparison based on?

36 benchmarks have a result for both models as of October 21, 2026. Gemma 3 12B'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