LMCache 实现 LLM 推理 14 倍加速与 90% 成本降低
Researchers made LLM inference 14x faster and 90% cheaper.
做推理优化的同学必看,LMCache 把 KV 缓存管理重构为独立进程,实测 14 倍加速,赶紧拿你的多文档场景压测一下。
Researchers made LLM inference 14x faster and 90% cheaper.
The video below depicts the speed up in action.
Providers discount cached input tokens by as much as 90% because a cache hit skips prefill compute entirely.
For stable system prompts and tool definitions, hit rates of 60 to 85% are achievable, which makes it the highest-leverage inference optimization.
But the cost saving only works when the cached text is an exact, byte-for-byte prefix of the new request. If you change one character anywhere before it, the entire cached region is missed.
Three common request patterns produce full cache misses:
- A query that needs documents A and B together can't reuse B's standalone cache, because those KV entries were computed without A in front of them.
- The same three documents retrieved in a different order produce a full cache miss, even though nothing about the documents changed.
- In multi-turn conversations, every new turn invalidates whatever was cached beyond the stable prefix.
Alibaba's production data did a study on this and found that just 10% of cached KV blocks serve 77% of all cache hits.
So most of what gets cached sits in storage and is never used a single time. And the root cause is that KV entries are position-dependent.
Each token's KV encodes attention to everything before it, so a cached block is only valid in the exact context it was computed in.
There's a second, less discussed problem as well.
Cache management runs inside the inference engine's process.
Moving KV tensors between GPU, CPU, and disk competes with inference for the same resources.
This is why Google's TurboQuant compresses KV caches to 3 bits with no accuracy loss and still causes a 20%+ slowdown when it runs in-process.
Fixing both problems means restructuring where caching lives. Cache management moves into its own process, the engine only exchanges block IDs over shared GPU memory, and heavy data movement runs across GPU, CPU, disk, and remote storage in parallel.
Non-prefix reuse gets handled by selectively recomputing only the small set of tokens that attend across document boundaries.
LMCache is the open-source project (10k+ stars) that implements this exact architecture, and it plugs into vLLM, SGLang, and TensorRT-LLM.
The selective recomputation part is implemented in its CacheBlend technique, which makes cached docs in any order and combination, with 2-4x faster multi-document processing.
On H200s running Qwen3-235B with 50 concurrent users, LMCache's multiprocess mode delivers 14x faster time-to-first-token and 4x faster decoding compared to in-process caching.
GitHub repo: https://github.com/LMCache/LMCache
(don't forget to star 🌟)
My co-founder wrote a full breakdown of KV cache management.
It covers the disaggregated architecture behind the 14x speed up, how CacheBlend preserves generation quality while skipping recomputation, and how to turn every document in a knowledge base into a reusable cached asset.
Read it below.
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力