Writing
Beyond the GPU: Solving the Memory Wall in LLM Inference
A simple walk through the paper “Reimagining LLM Inference Infrastructure with Memory-Centric KV Cache Servers”, and why memory, not math, is what limits most LLM inference today.
Buying the Wrong Hardware
Every AI company is in a race to buy GPUs. Data centers are filling up with chips that cost around $30,000 each, built for one thing above all: doing enormous amounts of math very fast.
The paper “Reimagining LLM Inference Infrastructure with Memory-Centric KV Cache Servers” (Kiyawat & Skadron, University of Virginia, HotInfra ’26) makes a provocative claim. For most of what AI chatbots actually do today, the math isn’t the bottleneck. Memory is. And if that’s true, we’re spending a fortune on the wrong kind of hardware.
To see why, we need to understand one concept first.
What Is a “KV Cache”?
When a large language model answers, it actually works in two phases.
- Prefill. The model reads your whole prompt in one go. This is heavy math on lots of tokens at once, and GPUs are brilliant at it.
- Decode. The model writes its answer one token (roughly one word piece) at a time. To pick each new token it has to look back at everything that came before.
Recomputing all of that history for every new word would be absurdly wasteful. So the model keeps notes: for every token it has seen, it stores two small vectors called a Key and a Value. That notebook is called the KV cache.
The Memory Bottleneck
That notebook gets big very fast. The paper’s headline example: for LLaMA-3-70B with a 128,000-token context, the KV cache for a single request is about 34 GB. Add the model’s own weights (about 140 GB) and you need roughly 174 GB of memory.
An NVIDIA H100, the flagship AI GPU, has 80 GB. So before the model generates even one word, the job has to be split across multiple GPUs. Not because it needs their math, but because it needs their memory.
Things are getting worse, not better. In 2023 a typical chatbot answer was 100 to 200 tokens long. Today’s “reasoning” models (DeepSeek-R1, OpenAI o1) routinely think out loud for 8,000 to 32,000 tokens. That’s 40 to 160 times more KV cache pressure in under two years.
Why Scaling Memory Isn’t That Simple
The obvious fix is to give the GPU more memory. But there are physical limits to doing so:
- GPUs are out of beachfront. High-bandwidth memory (HBM) sits in stacks right next to the chip, and there’s only so much edge to attach them to. The H100 already uses six stacks. A seventh means a bigger chip, which runs into manufacturing size limits, or taller stacks, which overheat.
- CPUs are out of pins. Each regular DDR5 memory channel takes around 100 connection pads on the processor. There’s no room left on the socket to add more.
Why Modern GPUs Are Overkill for Inference
Here’s the uncomfortable consequence. During decode, GPUs typically use under 30% of their compute, while their memory is completely full. Take serving DeepSeek-R1 (671B parameters) with 32K reasoning tokens: it needs 19 H100s running at about 15% compute utilization. You would be paying for 18,791 TFLOPS of number-crunching power to run a job whose real limit is how fast data can be moved.
Meanwhile, the most valuable thing in many workloads isn’t computing new notes, it’s reusing old ones.
Production systems report that 50–90% of KV cache is reused across requests (think of the same system prompt shared by thousands of users, or multi-turn chats). In multi-agent setups it’s 75–95%. Sharing KV across engines alone has delivered 15× throughput gains.
So the question becomes: if the job is mostly storing and fetching notes, why are we building it around a math engine?
Introducing the KV Cache Server
The paper proposes a new kind of machine for the data center: the KV cache server. It sits between the fast GPUs and slow storage, much as cloud storage split memory from compute long ago.
It’s built on CXL (Compute Express Link), a standard that lets you attach large pools of memory over a single x16 link. Need more? Add more memory modules. No extra chip area, no extra pins. Capacity scales to terabytes.
The authors describe a spectrum of three device types (they call them archetypes):
- CXL DDRx expander. Plain, cheap memory. Stores KV cache and lets many machines share it. No compute.
- CXL + PNM (Processing-Near-Memory). Adds a small helper next to the memory. It can pick which tokens matter, manage the cache or do light memory-bound work.
- CXL + PNM + PIM (Processing-In-Memory). Puts compute inside the memory chips themselves, enough to run decoding or even a whole inference job without a GPU.
A CPU coordinates everything, but hands routine scheduling off to the CXL switch or the memory devices, stepping in only when tasks depend on each other. The authors also imagine future memory-to-memory links, like NVLink does for GPUs, so memory devices can pass KV cache directly to each other.
The Three Memory Design Patterns
The authors don’t say “throw out the GPUs.” They describe three operating modes, and real systems can mix them:
Agentic AI is a blend of all three. A shared system prompt lives once in the pool, while each agent keeps its private notes on its own memory node. The agents work in parallel and only sync up, through the CPU or directly between memory devices, when one needs another’s result.
What the Benchmarks Show
To ground the idea, the authors do a back-of-the-envelope comparison with DeepSeek-R1 (671B) generating 32,000 reasoning tokens.
Because DeepSeek-R1 is a Mixture-of-Experts model, only 37B parameters are active per token, and its attention design compresses the KV cache about 64 times compared to standard attention. Even so, each new token requires moving about 75 GB of data (74 GB of weights plus about 1 GB of KV cache). Speed is therefore set almost entirely by memory bandwidth.
They compare:
| GPU cluster | KV cache server | |
|---|---|---|
| Hardware | 19 × H100 | 1 CPU, 2 CXL switches, 23 × 64 GB PIM-DIMMs |
| Memory | 1,520 GB | 1,472 GB |
| Usable bandwidth | 63.7 TB/s | 150.7 TB/s (6.55 TB/s per stick) |
A PIM-DIMM is a memory stick with compute built into each memory bank. Because the compute sits inside the banks, it sees their internal bandwidth rather than the narrow channel out of the stick. The result is roughly the same memory but 2.4× the usable bandwidth at a fraction of the price.
The Devil in the Details
These numbers are striking, and the authors are upfront that they come from a simplified model, not from a built system. A few things to keep in mind:
- It’s a projection. Throughput is calculated from memory bandwidth at an assumed 80% efficiency. No full KV cache server has been built and benchmarked at this scale.
- PIM-DIMMs aren’t off the shelf. The study assumes they cost $12/GB, 2 to 4× regular DDR5. Real pricing for a new product category could differ a lot.
- The comparison isn’t perfectly symmetric. The GPU cluster’s cost and power leave out its CPU and NVSwitches, which favors the GPUs, while the KV cache server’s rental price is simply scaled down from its purchase price.
- Prefill is set aside. The study models the long decode phase only. Workloads with heavy prefill still need GPUs, which is why the paper frames this as a new tier alongside GPUs and not a replacement.
- The software doesn’t exist yet. Today’s KV cache systems, such as vLLM, SGLang, LMCache and Mooncake, manage the cache in software and could extend to these tiers, but the authors say a full hardware-plus-software study is still needed.
The Main Point
Generating the next word in a modern AI conversation is mostly a job of remembering, not calculating. We’ve built AI data centers around calculating.
The authors make two calls to action:
- Treat the KV cache as shared, first-class data with its own dedicated hardware.
- Extend GPU-style high-speed links to connect memory devices directly to each other.
Their closing question sums it up: “What is the minimum hardware needed to generate the next token?” For most of today’s inference traffic, they argue, the answer is a memory device with a little compute built in, not a $30,000 GPU.