Gemma 3 12B vs Phi-4
Architecture Comparison
SpecGemma 3 12BPhi-4
TypeDENSEDENSE
Total Parameters12B14.7B
Active Parameters12B14.7B
Layers4840
Hidden Dimension3,0725,120
Attention Heads3240
KV Heads1610
Context Length131,07216,384
Precision (default)BF16BF16
Memory Requirements
PrecisionGemma 3 12BPhi-4
BF16 Weights24.0 GB29.4 GB
FP8 Weights12.0 GB14.7 GB
INT4 Weights6.0 GB7.3 GB
KV-Cache / Token393216 B204800 B
Activation Estimate1.00 GB1.50 GB
Minimum GPUs Needed (BF16)
H100 SXM1 GPU1 GPU
L40S1 GPU1 GPU
Quality Benchmarks
BenchmarkGemma 3 12BPhi-4
Overall7183
MMLU74.084.8
HumanEval44.067.0
GSM8K78.093.0
MT-Bench80.085.0
Gemma 3 12B
MMLU
74.0
HumanEval
44.0
GSM8K
78.0
MT-Bench
80.0
Phi-4
MMLU
84.8
HumanEval
67.0
GSM8K
93.0
MT-Bench
85.0
Capabilities
FeatureGemma 3 12BPhi-4
Tool Use✓ Yes✓ Yes
Vision✓ Yes✗ No
Code✓ Yes✓ Yes
Math✓ Yes✓ Yes
Reasoning✗ No✓ Yes
Multilingual✓ Yes✓ Yes
Structured Output✓ Yes✓ Yes
API Pricing Comparison
Cheapest Output (Gemma 3 12B)
$0.10/M
Input: $0.05/M
Cheapest Output (Phi-4)
$0.14/M
Input: $0.07/M
| Provider | Gemma 3 12B In $/M | Out $/M | Phi-4 In $/M | Out $/M |
|---|---|---|---|---|
| $0.05 | $0.10 | — | — | |
| azure | — | — | $0.07 | $0.14 |
| together | $0.15 | $0.15 | $0.20 | $0.20 |
Recommendation Summary
- ‣Phi-4 scores higher on overall quality (83 vs 71).
- ‣Gemma 3 12B is cheaper per output token ($0.10/M vs $0.14/M).
- ‣Gemma 3 12B has a smaller memory footprint (24.0 GB vs 29.4 GB BF16), making it easier to deploy on fewer GPUs.
- ‣Gemma 3 12B supports a longer context window (131,072 vs 16,384 tokens).
- ‣Phi-4 is stronger at code generation (HumanEval: 67.0 vs 44.0).
- ‣Phi-4 is better at math reasoning (GSM8K: 93.0 vs 78.0).