INQUIRING LINE

Two fixes for AI's memory-hogging problem: one squeezes more into GPU memory, the other reuses what's already been computed elsewhere.

How does PagedAttention differ from LMCache in solving KV cache memory limits?

This explores two different fixes for the same problem: the KV cache (the model's working memory of the tokens it has already processed) is too big for GPU memory. PagedAttention packs that memory more tightly on the GPU. LMCache moves it off the GPU so it can be reused later.


This explores two different fixes for the same problem: the KV cache is too big for GPU memory. PagedAttention packs that memory more tightly on the GPU. LMCache moves it off the GPU so it can be reused later. One saves space and the other saves work, and they solve different problems.

PagedAttention borrows a trick from operating systems. Before it, each request reserved one contiguous block of GPU memory sized for the longest output it might produce. Much of that reservation went unused, and the leftover gaps were wasted. Paging stores the cache in small blocks that can sit anywhere in memory, so roughly 30% of wasted memory comes back, and requests with the same prefix can share blocks. More requests fit on the GPU at once, which is where vLLM's 2–4× throughput gain comes from Can OS paging techniques reduce LLM serving memory waste?. The goal is to fit more concurrent work into a fixed amount of memory.

LMCache asks a different question: why throw the cache away when the request ends? It pulls KV states out of GPU memory and stores them, so a later query, or even a different serving engine, can load them instead of reading the same document or conversation history from scratch. The reported gains reach 15× on multi-turn and document-heavy enterprise workloads Can KV cache move off GPU memory for reuse?. The non-obvious part is that this only works because storage got fast. Engineers long assumed that fetching cached states from remote storage would be slower than recomputing them. With object stores near 1 GB/s, one enterprise customer saw 22–32% lower time-to-first-token by loading instead of recomputing Can remote storage beat recomputing cached model states?. The memory limit turns into a storage-hierarchy question.

The two approaches stack: vLLM can page memory on the GPU and offload to LMCache at the same time. They also have something in common. Both pay off most when many requests share the same starting text, which is the idea behind commercial prompt caching. Benchmarks show prompt caching cuts agentic API costs by 41–80%, but caching content that never repeats can make latency worse Does prompt caching actually reduce agentic LLM costs?. Reuse is also fragile. Cache hits need an exact prefix match, so letting agents discover tools dynamically, which changes the tool definitions in the prompt, quietly breaks caching Does dynamic tool discovery break prompt caching benefits?.

If you want a third option, some research shrinks the cache itself rather than storing it better. One model structures reasoning as recursive subtask trees and prunes cache entries by rule, which keeps reasoning accurate beyond the context limit Can recursive subtask trees overcome context window limits?. Another line of work argues the real long-context bottleneck isn't memory capacity at all. On that view, it's the compute needed to fold old context into the model's internal state Is long-context bottleneck really about memory or compute?. Taken together: PagedAttention packs the cache better, LMCache reuses it, pruning makes it smaller, and consolidation turns it into something other than a cache.


Sources 7 notes

Can OS paging techniques reduce LLM serving memory waste?

PagedAttention applies OS virtual memory paging to the KV cache, storing blocks non-contiguously and enabling sharing across requests. This eliminates ~30% of memory waste from fragmentation, lifting vLLM throughput 2-4× over FasterTransformer and Orca on the same latency.

Can KV cache move off GPU memory for reuse?

LMCache extracts KV cache from GPU memory for cross-query and cross-engine reuse through optimized data movement, modular interfaces, and unified control APIs. Authors report up to 15× throughput gains on multi-turn and document-heavy enterprise workloads with vLLM.

Can remote storage beat recomputing cached model states?

LMCache reports one enterprise customer achieved 22–32% lower time-to-first-token by loading cached states from remote storage instead of recomputing them. The shift stems from modern object store throughput (S3 Express: ~1 GBps) exceeding the historical assumption that remote loading was too slow.

Does prompt caching actually reduce agentic LLM costs?

A benchmark across OpenAI, Anthropic, and Google found caching reduces API costs 41–80% and improves time-to-first-token 13–31% in multi-turn agentic tasks. However, naive full-context caching can increase latency by caching dynamic content that will never be reused.

Does dynamic tool discovery break prompt caching benefits?

MCP-style dynamic tool discovery breaks prompt caching because tool definitions in the prefix must match exactly for cache hits. Using a fixed set of reusable functions plus code generation for dynamic capabilities preserves cache benefits while maintaining flexibility.

Show all 7 sources
Can recursive subtask trees overcome context window limits?

The Thread Inference Model demonstrates that reasoning structured as recursive subtask trees with rule-based KV cache pruning sustains accurate reasoning beyond context limits, even when manipulating 90% of the cache. This enables single models to replace multi-agent systems by handling full recursive reasoning internally.

Is long-context bottleneck really about memory or compute?

Research shows the bottleneck is not memory capacity but the compute required to consolidate evicted context into fast weights during offline sleep phases. Performance improves with more consolidation passes, following a test-time scaling pattern on harder reasoning tasks.

Papers this line draws on 8

The research behind the notes this line reads — ranked by how closely each paper relates.