Enter opens the highlighted result. Esc closes.

Gemma 3 4B 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 4BGoogle
Coding
No data
Overall
4.8
Output $/M
$0.075
24
Phi 4Microsoft
Coding
No data
Overall
5.9
Output $/M
$0.14
12
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 4B has the edge where output tokens cost 1.9x less, and where the context window is larger, 131K against 16K tokens.

Shared results
36
Gemma 3 4B only
3
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 4B not benchmarked, Phi 4 not benchmarked.
Widest category
Knowledge, 20.5 points apart on average over 5 shared benchmarks.
Widest single gap
GPQA Diamond (Epoch AI run): Gemma 3 4B 23.2% against Phi 4 56.1%, 32.8 points apart on a 0 to 100 scale.
Output price
Gemma 3 4B $0.075 against Phi 4 $0.14 per million output tokens, 1.9x apart.
Context window
Gemma 3 4B 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 4BBarsPhi 4Ties
Coding13
Intelligence02
Agentic work10
Reasoning42
Math14
Knowledge41
General130
All shared boards2412
CodingLike-for-likeSix of these boards feed the Vibe Coding Index13
Coding benchmarks for Gemma 3 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
AA Coding Index2.7Not measuredOnly Gemma 3 4B measured
LiveCodeBench (Artificial Analysis run)11.2%23.1%Phi 4
Terminal-Bench Hard (Artificial Analysis run)0.8%3.8%Phi 4
LMArena Text: coding12301231Phi 4
LMArena Text: software and IT12691228Gemma 3 4B
Neither model has a result on the other 33 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index02
Intelligence benchmarks for Gemma 3 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
AA Intelligence Index4.85.9Phi 4
Epoch Capabilities Index115.9130.5Phi 4
Agentic workLike-for-likePublic boards, shown as published, kept out of the index10
Agentic work benchmarks for Gemma 3 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
τ²-Bench Telecom5.0%0.0%Gemma 3 4B
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 index42
Reasoning benchmarks for Gemma 3 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
GPQA Diamond (Artificial Analysis run)29.1%57.5%Phi 4
Humanity's Last Exam (Artificial Analysis run)5.3%3.8%Gemma 3 4B
GPQA Diamond (Epoch AI run)23.2%56.1%Phi 4
LMArena Text: hard prompts12531220Gemma 3 4B
LMArena Text: expert12231203Gemma 3 4B
LMArena Text: hard prompts in English12531230Gemma 3 4B
Neither model has a result on the other 15 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index14
Math benchmarks for Gemma 3 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
AA Math Index12.718.0Phi 4
AIME 2025 (Artificial Analysis run)12.7%18.0%Phi 4
OTIS Mock AIME7.5%13.8%Phi 4
MATH level 5Not measured64.9%Only Phi 4 measured
LMArena Text: math12391246Phi 4
LMArena Text: mathematical work12561254Gemma 3 4B
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 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
MMLU Pro (Artificial Analysis run)41.7%71.4%Phi 4
MMLUNot measured84.8%Only Phi 4 measured
LMArena Text: science13061206Gemma 3 4B
LMArena Text: medicine and healthcare13421202Gemma 3 4B
LMArena Text: legal and government13271241Gemma 3 4B
LMArena Text: business and finance13111199Gemma 3 4B
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 4B and Phi 4
BenchmarkGemma 3 4BPhi 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 4B and Phi 4
BenchmarkGemma 3 4BPhi 4Leader
IFBench28.3%23.5%Gemma 3 4B
Long context reasoning (AA-LCR)6.7%0.0%Gemma 3 4B
DTBench50.9%Not measuredOnly Gemma 3 4B measured
LMCA2.8%Not measuredOnly Gemma 3 4B measured
Creative writing (Lech Mazur)Not measured62.6%Only Phi 4 measured
LMArena Text12911217Gemma 3 4B
LMArena Text: instruction following12391201Gemma 3 4B
LMArena Text: creative writing12701181Gemma 3 4B
LMArena Text: English13001231Gemma 3 4B
LMArena Text: non-English12731197Gemma 3 4B
LMArena Text: ChineseNot measured1212Only Phi 4 measured
LMArena Text: German12811222Gemma 3 4B
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: Russian12941209Gemma 3 4B
LMArena Text: multi-turn12551206Gemma 3 4B
LMArena Text: longer queries12731217Gemma 3 4B
LMArena Text: writing and language12881198Gemma 3 4B
LMArena Text: entertainment and media12331162Gemma 3 4B
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 4B and Phi 4
BenchmarkGemma 3 4BPhi 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 4B$0.0001Fits in one request
Phi 4$0.0001Fits in one request

Gemma 3 4B costs less

Repository review

50K input + 3K output tokens

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

Gemma 3 4B costs less

Agent loop

200K input + 10K output tokens

Gemma 3 4B$0.0097Exceeds the context window
Phi 4$0.015Exceeds the context window

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

Questions

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

Neither model has a coding score yet, so the two cannot be ranked on coding. Gemma 3 4B has the edge where output tokens cost 1.9x less, and where the context window is larger, 131K against 16K tokens.

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

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

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

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

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