This guide covers your GPU Isn’t Slow — It’s Out of.

Every week someone asks the same question in a different shape: my graphics card is fast, so why does this AI model crawl — or refuse to load at all? The honest answer almost never lives in the chip’s speed. It lives in its memory. A language model cannot generate one token until its weights are sitting in memory, and every token of the conversation you are having with it rents more space on top. Local AI is a capacity problem first and a speed problem second. This article is the math a buyer actually needs: three numbers, one worked example on a real model, and the legitimate ways people squeeze under the wall — with the costs of each stated plainly.
The only formula you need
A model’s weight memory is its parameter count multiplied by the bits used to store each weight, divided by eight:
gigabytes ≈ parameters (in billions) × bits per weight ÷ 8
Full precision — 16 bits per weight, the F16/BF16 format models are usually published in — costs 2 bytes per parameter. So an 8-billion-parameter model needs roughly 16 GB before it has answered a single token. That is the whole ballgame, and it is why the parameter count printed on a model card is really a memory price tag.
The worked example: Meta’s Llama 3.1 8B
Take a named, popular open model: Meta’s Llama 3.1 8B Instruct. The llama.cpp project publishes measured sizes for its own GGUF conversions of this exact model, and they track the formula precisely:
| Format | Bits per weight | Weight size |
|---|---|---|
| F16 (as published) | 16.00 | 14.96 GiB |
| Q8_0 | 8.50 | 7.95 GiB |
| Q6_K | 6.56 | 6.14 GiB |
| Q5_K_M | 5.70 | 5.33 GiB |
| Q4_K_M | 4.89 | 4.58 GiB |
| Q3_K_M | 4.00 | 3.74 GiB |
| Q2_K | 3.16 | 2.95 GiB |
Same model, same brain — a five-fold difference in the memory it demands, decided entirely by the format you download. llama.cpp’s summary table makes the same point at the top end: Llama 3.1 70B is a 280.9 GB model in its original form and 43.1 GB as a Q4_K_M file. Neither number is a typo.
Wall #2: the KV cache, a.k.a. your context window
Weights are only the entry fee. While a model runs, it keeps a working memory of the conversation — the key/value (KV) cache — and it grows by one entry for every token of context. Its size is set by the model’s architecture, and for Llama 3.1 8B the model’s own configuration file gives the ingredients: 32 layers, 8 key-value heads, a head dimension of 128. Multiply it out at F16 precision:
128 KiB of KV cache per token.
That sounds like nothing until you price real context lengths:
- 4,096 tokens (Ollama’s default context): ≈ 0.5 GiB
- 32,768 tokens: ≈ 4 GiB
- 131,072 tokens (the model’s full 128K context): ≈ 16 GiB — as much as the full-precision weights themselves
This is the second wall, and it is the one that ambushes people. The weights fit, the chat starts, and then a long document, a big code file, or a marathon session pushes the cache past the card’s remaining room and the runner either errors out or quietly evicts and re-reads context. When a seller advertises a huge context window, they are advertising a memory bill, not a free feature.
What actually happens on real cards
NVIDIA’s published specifications: a GeForce RTX 4060 carries 8 GB of GDDR6; a GeForce RTX 4090 carries 24 GB of GDDR6X. Run the Llama 3.1 8B numbers against the smaller card, leaving room for the runtime and compute buffers a real load also needs:
- Q4_K_M (4.58 GiB of weights): fits, with roughly 3 GB to spare. At a 4K context the KV cache takes about half a gigabyte — comfortable. Push the context to 32K and the cache alone wants ~4 GiB: you are over the card, and something has to give.
- Q8_0 (7.95 GiB of weights): does not fit fully, full stop. The runner’s honest response is a split load — Ollama’s own documentation describes exactly this:
ollama psreports loads like 48%/52% CPU/GPU when part of the model lives in system RAM, and every layer that lives on the CPU runs at CPU speed. The model “runs.” It does not run well. - On the 24 GB card, the same model at Q8_0 with a 32K context totals roughly 12 GiB — roomy. The wall did not move; the room got bigger.
One more consequence of the memory wall, from llama.cpp’s own published measurements of this model: text generation got faster as precision dropped — F16 generated at about 29 tokens per second in their table, Q4_K_M at about 72. Generation reads the entire weight file from memory for every token, so fewer bytes per weight means less to haul per token. Memory is the wall twice: it decides what fits, and its bandwidth decides how fast it answers.

The pressure valves — and what each one costs
Quantization is the big one, and the trade is real: storing weights at 4–5 bits instead of 16 discards information. llama.cpp’s documentation is blunt that quantization “may introduce some accuracy loss,” measured in perplexity and KL divergence. Graded honestly: Q8_0 is treated as effectively transparent next to F16; Q5_K_M and Q4_K_M are the working compromise most local runners actually use — a small, measurable quality cost in exchange for halving (or thirding) the memory bill; at Q3 and below the losses stop being subtle, and 2-bit formats are a stunt unless the alternative is not running the model at all.
KV-cache quantization attacks the second wall. Ollama’s documentation offers OLLAMA_KV_CACHE_TYPE with q8_0 at roughly half the F16 cache size and q4_0 at roughly a quarter, with — in Ollama’s own words — a very small precision loss for q8_0 and a small-to-medium one for q4_0 that grows more noticeable at high context sizes. On the 8 GB card above, q8_0 cache is the difference between a 32K context fitting (≈ 4.6 GiB weights + ≈ 2 GiB cache) and not.
Context discipline is free: Ollama defaults to a 4,096-token context for a reason. Raising it because the model card brags about 128K is choosing the 16 GiB cache bill on purpose.
Partial offload — splitting layers between GPU and system RAM — always “works” and always costs speed proportional to how much of the model fell off the card. It is a bridge, not a destination.
Unified memory is the structural exception. Apple describes its silicon design as a single pool of memory in one package, where every part of the chip can access the same data without copying between pools. There is no separate VRAM wall on a Mac: a 32 GB Apple-silicon machine can hold models that a 24 GB graphics card cannot — at memory-bandwidth speeds well below a big discrete card’s, which is the honest trade. Capacity or pace; pick per workload.
The buyer’s rule
When you shop for local AI, read the spec sheet in this order: memory capacity first, memory bandwidth second, everything else third. Decide the largest model you genuinely want to run, price it at Q4_K_M-to-Q5_K_M with the context length you will actually use — weights plus cache plus a gigabyte or two of headroom — and buy the card (or the memory configuration) that holds that number. A faster chip behind too little memory does not give you a slower model. It gives you no model, or a split one. The wall is not the processor. It never was.
By Karl Amber
Sources
- llama.cpp
llama-quantizedocumentation (ggml-org/llama.cpp) — the measured bits-per-weight and GiB sizes for meta-llama/Llama-3.1-8B quoted in the table (F16 14.96 GiB; Q8_0 7.95 GiB; Q6_K 6.14 GiB; Q5_K_M 5.33 GiB; Q4_K_M 4.58 GiB; Q3_K_M 3.74 GiB; Q2_K 2.95 GiB), the Llama 3.1 family summary (8B original 32.1 GB → Q4_K_M 4.9 GB; 70B 280.9 GB → 43.1 GB), the generation-speed figures, and the statement that quantization may introduce accuracy loss measured in perplexity and KL divergence. - Meta Llama 3.1 8B Instruct model configuration (config.json, mirrored at NousResearch on Hugging Face) — 32 hidden layers, 8 key-value heads, 4096 hidden size (128 per head), 131,072 maximum position embeddings. The KV-cache figures are arithmetic from those published values.
- Ollama FAQ and documentation (docs.ollama.com) — default context window of 4,096 tokens;
ollama psCPU/GPU load splits; KV cache types f16 (default), q8_0 at approximately half the memory, q4_0 at approximately a quarter, with Ollama’s stated quality impact for each; Flash Attention described as significantly reducing memory usage as context grows. - NVIDIA GeForce product specifications (nvidia.com) — GeForce RTX 4060: 8 GB GDDR6; GeForce RTX 4090: 24 GB GDDR6X.
- Apple Newsroom, M1 announcement — the unified memory architecture described as a single pool of memory within a custom package, accessible to all technologies in the chip without copying between multiple pools.
Editor’s note: this article is part of ScanderLoud’s Cybersecurity & Networking series. It was researched from the projects’ and manufacturers’ own documentation — our coverage is original.
That is the complete picture on your GPU Isn’t Slow — It’s Out of.
Featured image: Quinn Dombrowski from Berkeley, USA, CC BY-SA 2.0, via Wikimedia Commons

Leave a Reply