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 3BPhi-3 MiniRatio
Parameters3.21B 3,212,749,8243.82B 3,821,079,5521.19×
Active per tokenall (dense)all (dense)1.19×
Layers28321.14×
Hidden size (d)3,0723,072same
Attention24 heads, 8 KV heads × 12832 heads, 32 KV heads × 96
FFNSwiGLU, 8,192SwiGLU, 8,192
Vocabulary128,25632,0640.25×
Tied embeddingsyesno
Max context128K4K0.03×
Weights, BF166.4 GB7.6 GB1.19×
Weights, 4-bit1.6 GB1.9 GB1.19×
KV cache per token (BF16)114.7 KB393.2 KB3.43×
KV cache at 32K tokens3.8 GB– (max 4K)0.43×
FLOPs per token (4K context)7.8 GFLOPs8.4 GFLOPs1.08×

The full workings: Llama 3.2 3B · Phi-3 Mini · change the models