Model comparison

phi-2 vs Llama-3.1-8B-Instruct

At Q4_K_M, phi-2 is the smaller download — 1,737,636,384 bytes against 4,920,739,168. At long context the gap widens: Llama-3.1-8B-Instruct's KV cache at 32K is 2.5× smaller, which usually matters more than the difference in weights.

From the file· summed bytes, KV per layer

Side by side

phi-2Llama-3.1-8B-Instruct
Parameters2.8B8.0B
Architecturephi2llama
Layers3232
Native context2,048131,072
Mixture of expertsnono
Quantizations published3445
Smallest quantization1.03 GiB2.02 GiB
Q4_K_M1.62 GiB4.58 GiB
Licenceotherllama3.1

KV cache by context

the term that decides long-context viability
Contextphi-2Llama-3.1-8B-InstructRatio
4,0961.25 GiB0.50 GiB2.50×
8,1922.50 GiB1.00 GiB2.50×
16,3845.00 GiB2.00 GiB2.50×
32,76810.00 GiB4.00 GiB2.50×
65,53620.00 GiB8.00 GiB2.50×
131,07240.00 GiB16.00 GiB2.50×