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 8B | Qwen2.5 7B | Ratio | |
|---|---|---|---|
| Parameters | 8.03B 8,030,261,248 | 7.62B 7,615,616,512 | 0.95× |
| Active per token | all (dense) | all (dense) | 0.95× |
| Layers | 32 | 28 | 0.88× |
| Hidden size (d) | 4,096 | 3,584 | 0.88× |
| Attention | 32 heads, 8 KV heads × 128 | 28 heads, 4 KV heads × 128 | |
| FFN | SwiGLU, 14,336 | SwiGLU, 18,944 | |
| Vocabulary | 128,256 | 152,064 | 1.19× |
| Tied embeddings | no | no | |
| Max context | 128K | 128K | same |
| Weights, BF16 | 16.1 GB | 15.2 GB | 0.95× |
| Weights, 4-bit | 4.0 GB | 3.8 GB | 0.95× |
| KV cache per token (BF16) | 131.1 KB | 57.3 KB | 0.44× |
| KV cache at 32K tokens | 4.3 GB | 1.9 GB | 0.44× |
| FLOPs per token (4K context) | 18.2 GFLOPs | 16.9 GFLOPs | 0.93× |
The full workings: Llama 3.1 8B · Qwen2.5 7B · change the models