Qwen 2.5 7B vs Phi-4
Architecture Comparison
SpecQwen 2.5 7BPhi-4
TypeDENSEDENSE
Total Parameters7.6B14.7B
Active Parameters7.6B14.7B
Layers2840
Hidden Dimension3,5845,120
Attention Heads2840
KV Heads410
Context Length131,07216,384
Precision (default)BF16BF16
Memory Requirements
PrecisionQwen 2.5 7BPhi-4
BF16 Weights15.2 GB29.4 GB
FP8 Weights7.6 GB14.7 GB
INT4 Weights3.8 GB7.3 GB
KV-Cache / Token57344 B204800 B
Activation Estimate1.00 GB1.50 GB
Minimum GPUs Needed (BF16)
H100 SXM1 GPU1 GPU
L40S1 GPU1 GPU
Quality Benchmarks
BenchmarkQwen 2.5 7BPhi-4
Overall7083
MMLU74.284.8
HumanEval42.867.0
GSM8K82.093.0
MT-Bench79.085.0
Qwen 2.5 7B
MMLU
74.2
HumanEval
42.8
GSM8K
82.0
MT-Bench
79.0
Phi-4
MMLU
84.8
HumanEval
67.0
GSM8K
93.0
MT-Bench
85.0
Capabilities
FeatureQwen 2.5 7BPhi-4
Tool Use✓ Yes✓ Yes
Vision✗ No✗ No
Code✓ Yes✓ Yes
Math✓ Yes✓ Yes
Reasoning✗ No✓ Yes
Multilingual✓ Yes✓ Yes
Structured Output✓ Yes✓ Yes
API Pricing Comparison
Cheapest Output (Qwen 2.5 7B)
$0.20/M
Input: $0.20/M
Cheapest Output (Phi-4)
$0.14/M
Input: $0.07/M
| Provider | Qwen 2.5 7B In $/M | Out $/M | Phi-4 In $/M | Out $/M |
|---|---|---|---|---|
| azure | — | — | $0.07 | $0.14 |
| together | $0.20 | $0.20 | $0.20 | $0.20 |
| fireworks | $0.20 | $0.20 | — | — |
Recommendation Summary
- ‣Phi-4 scores higher on overall quality (83 vs 70).
- ‣Phi-4 is cheaper per output token ($0.14/M vs $0.20/M).
- ‣Qwen 2.5 7B has a smaller memory footprint (15.2 GB vs 29.4 GB BF16), making it easier to deploy on fewer GPUs.
- ‣Qwen 2.5 7B supports a longer context window (131,072 vs 16,384 tokens).
- ‣Phi-4 is stronger at code generation (HumanEval: 67.0 vs 42.8).
- ‣Phi-4 is better at math reasoning (GSM8K: 93.0 vs 82.0).