Compare

Llama 3.1 8B vs Qwen2.5 7B

Llama 3.1 8B has 8.03B parameters, 1.1 times the 7.62B of Qwen2.5 7B. In BF16 the weights take 16.1 GB and 15.2 GB. Llama 3.1 8B needs 2.3 times as much KV cache per token (131.1 KB against 57.3 KB): GQA against GQA.

Llama 3.1 8BQwen2.5 7BRatio
Parameters8.03B 8,030,261,2487.62B 7,615,616,5120.95×
Active per tokenall (dense)all (dense)0.95×
Layers32280.88×
Hidden size (d)4,0963,5840.88×
Attention32 heads, 8 KV heads × 12828 heads, 4 KV heads × 128
FFNSwiGLU, 14,336SwiGLU, 18,944
Vocabulary128,256152,0641.19×
Tied embeddingsnono
Max context128K128Ksame
Weights, BF1616.1 GB15.2 GB0.95×
Weights, 4-bit4.0 GB3.8 GB0.95×
KV cache per token (BF16)131.1 KB57.3 KB0.44×
KV cache at 32K tokens4.3 GB1.9 GB0.44×
FLOPs per token (4K context)18.2 GFLOPs16.9 GFLOPs0.93×

The full workings: Llama 3.1 8B · Qwen2.5 7B · change the models