Compare

Phi-4 vs Mistral NeMo 12B

Phi-4 has 14.7B parameters, 1.2 times the 12.2B of Mistral NeMo 12B. In BF16 the weights take 29.3 GB and 24.5 GB. Phi-4 needs 1.3 times as much KV cache per token (204.8 KB against 163.8 KB): GQA against GQA.

Phi-4Mistral NeMo 12BRatio
Parameters14.7B 14,659,507,20012.2B 12,247,782,4000.84×
Active per tokenall (dense)all (dense)0.84×
Layers4040same
Hidden size (d)5,1205,120same
Attention40 heads, 10 KV heads × 12832 heads, 8 KV heads × 128
FFNSwiGLU, 17,920SwiGLU, 14,336
Vocabulary100,352131,0721.31×
Tied embeddingsnono
Max context16K128K8.00×
Weights, BF1629.3 GB24.5 GB0.84×
Weights, 4-bit7.3 GB6.1 GB0.84×
KV cache per token (BF16)204.8 KB163.8 KB0.80×
KV cache at 32K tokens– (max 16K)5.4 GB1.60×
FLOPs per token (4K context)32.7 GFLOPs27.2 GFLOPs0.83×

The full workings: Phi-4 · Mistral NeMo 12B · change the models