LLM Architectures Tested: Memory Consumption and Speed
A technical analysis of 13 open-weight models tested on an RTX 4060 reveals how memory usage and speed scale as context lengths grow from 1K to 128K tokens.

Recent performance tests examining thirteen open-weight models on a single consumer hardware setup—an RTX 4060 with 8 GB of VRAM and 32 GB of RAM running llama.cpp—shed light on how various architectures handle memory and speed as context windows scale from 1K to 128K tokens. The evaluation specifically measured how model weights, key-value (KV) caches, and computational bottlenecks behave across different design frameworks.
Memory scaling and the KV cache
The study found that the KV cache for every model layout strictly follows established mathematical formulas. Dense models consume between 112 and 144 KiB per token, resulting in caches that require 15 to 19 GB at 128K tokens—roughly double the available VRAM on the test machine. Consequently, dense architectures are typically restricted to 16K or 32K context lengths.
In contrast, alternative architectures employ strategies like local layers, sliding windows, or latent attention to curb memory overhead. For example, Gemma 3 4B utilizes sliding-window layers and only five global layers, reducing its cache requirement to 20 KiB per token. Meanwhile, models utilizing Mixture-of-Experts (MoE) designs or hybrid recurrent structures offload parts of their weights or maintain compact state matrices, allowing them to reach higher context lengths without exhausting GPU memory.
Prefill speed and computational limits
During the prefill phase, where the model reads the incoming prompt, performance is bound by compute capacity. The analysis showed that GPU chips operate at a nearly constant rate of roughly 32 to 41 TFLOP/s when weights reside entirely in VRAM. Therefore, models with more parameters per token process prompts more slowly.
For MoE models, which store a large share of their experts in system RAM, prefill speeds are heavily constrained by PCIe transfer rates. Because data must be copied across the PCIe link for every batch of tokens, processing a 128K prompt with an MoE model can take anywhere from five to nine minutes. Developers looking for flexible options can try top AI models cheaply through one API at https://apixoai.online.
What it means for developers
Understanding these architectural tradeoffs is vital for software engineers deploying large language models locally or via cloud infrastructure. While dense models offer predictable scaling, their heavy VRAM demands for KV caches limit long-context conversations on standard hardware. Hybrid, sparse, and quantized models provide viable workarounds, keeping memory footprints smaller and preserving decoding speeds as context lengths expand. Developers must weigh factors like quantization levels, attention mechanisms, and hardware bandwidth constraints when selecting a model architecture for latency-sensitive or long-context applications.
Decode speed and memory bandwidth
Unlike prefill, the decoding phase—where the model writes out an answer token by token—is strictly limited by memory bandwidth rather than raw compute power. Every generated token requires the system to read all active model weights and the entire KV cache once. Tests demonstrated that models keeping their weights in VRAM consistently utilized around 200 to 231 GB/s, representing roughly 80% of the maximum VRAM bandwidth.
Quantization plays a major role here. Highly quantized models, such as those using 4-bit weights or ternary representations like Bonsai (which packs 27B parameters into 5.7 GB of memory), achieve much faster generation speeds relative to their parameter size because fewer bytes need to be read per token. Conversely, unquantized smaller models are bottlenecked by their native bit-widths relative to memory throughput.
Source: Testing LLM Architectures, Part 1: Memory and Speed — Towards AI. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

