A research team on Nov. 30 posted measurements comparing memory use and passkey retrieval in LLaMA 7B, Mistral 7B v0.1 and Qwen2.5-7B, using one 16 GB Nvidia T4 GPU. The arXiv paper1 is a preprint and has not been peer reviewed.
For operators running models on constrained GPUs, the results point to a practical trade-off: attention design and tokenization affect how much prompt history fits in memory, while a sliding window can limit access to older text. The tests compare the models as configured, rather than establishing that one is better for general-purpose use.
The study measured KV-cache memory at 512 KiB per token for LLaMA, 128 KiB for Mistral and 56 KiB for Qwen2.5. The cache stores attention information used during text generation. In the reported setup, LLaMA ran out of memory at 32,000 tokens, while Qwen2.5 held 64,000 tokens in 3.5 GiB; Mistral's cache was limited to 512 MiB. The paper's abstract1 attributes the differences to design choices including the number of KV heads: 32 in LLaMA, eight in Mistral and four in Qwen2.5.
In 134 Mistral passkey trials, the model retrieved the key in all 72 tests where it was within 4,089 tokens of the prompt's end, and in none of the 62 tests where it was at least 4,098 tokens away. The researchers say the 4,096-token sliding window caused that cutoff: with the same weights and the window disabled, Mistral succeeded at every tested position in 8,000-token prompts. At 16,000 and 32,000 tokens, however, the window-free model failed all 30 trials, while the windowed model continued to retrieve keys placed inside its window, according to the study1. Qwen2.5 retrieved the passkey in all 60 reported trials up to 32,000 tokens.
The team also compared tokenization on 1,997 parallel sentences across 15 languages. Qwen2.5's tokenizer produced 38% to 58% fewer tokens than the comparison for five languages and 3% to 11% fewer for the other 10. Combining those token-count differences with KV-cache sharing, the authors calculated that LLaMA would need 9.5 to 22 times more cache memory than Qwen2.5 for the same sentence. The GitHub repository2 includes code and raw results, listing 4-bit weights and software versions used for the experiments.