Compare
Llama 3.2 3B vs Phi-3 Mini
Phi-3 Mini has 3.82B parameters, 1.2 times the 3.21B of Llama 3.2 3B. In BF16 the weights take 6.4 GB and 7.6 GB. Phi-3 Mini needs 3.4 times as much KV cache per token (393.2 KB against 114.7 KB): MHA against GQA.
| Llama 3.2 3B | Phi-3 Mini | Ratio | |
|---|---|---|---|
| Parameters | 3.21B 3,212,749,824 | 3.82B 3,821,079,552 | 1.19× |
| Active per token | all (dense) | all (dense) | 1.19× |
| Layers | 28 | 32 | 1.14× |
| Hidden size (d) | 3,072 | 3,072 | same |
| Attention | 24 heads, 8 KV heads × 128 | 32 heads, 32 KV heads × 96 | |
| FFN | SwiGLU, 8,192 | SwiGLU, 8,192 | |
| Vocabulary | 128,256 | 32,064 | 0.25× |
| Tied embeddings | yes | no | |
| Max context | 128K | 4K | 0.03× |
| Weights, BF16 | 6.4 GB | 7.6 GB | 1.19× |
| Weights, 4-bit | 1.6 GB | 1.9 GB | 1.19× |
| KV cache per token (BF16) | 114.7 KB | 393.2 KB | 3.43× |
| KV cache at 32K tokens | 3.8 GB | – (max 4K) | 0.43× |
| FLOPs per token (4K context) | 7.8 GFLOPs | 8.4 GFLOPs | 1.08× |
The full workings: Llama 3.2 3B · Phi-3 Mini · change the models