TokenLake: A Unified Segment-level Prefix Cache Pool for Fine-grained Elastic Long-Context LLM Serving

Bingyang Wu, Zili Zhang, Yinmin Zhong, Guanzhe Huang, Yibo Zhu, Xuanzhe Liu, Xin JinarXiv 2025 · DOI

TL;DR

TokenLake is a unified, segment-level GPU memory pool designed to manage prefix caches for Large Language Model (LLM) serving. By decoupling cache management from request scheduling and using a declarative interface, it eliminates the load imbalance and data redundancy common in existing systems, boosting throughput by up to 2.6× and hit rates by up to 2.1×.

Introduction: The Bottlenecks of Long-Context Serving

In long-context LLM serving, "prefix caching"—reusing the KV cache of shared prompts or previous conversation turns—is essential for performance. However, current cluster-level systems suffer from three major issues:

  1. Load Imbalance: Request routers often send all requests with the same prefix to a single "hot" instance, over-utilizing its memory bandwidth while others sit idle.
  2. Data Redundancy: To balance computation, systems often replicate shared prefixes across multiple instances, wasting precious GPU memory.
  3. Memory Fragmentation: Because caches are managed as whole trees on specific instances, small "slots" of memory across the cluster cannot be aggregated, leading to failed allocations even when total free memory is sufficient.
Existing cache-aware request routers face significant challenges including overload, thrashing, and data redundancy.

These problems are exacerbated by PD (Prefill-Decode) Disaggregation, where different instances handle different phases of inference, making it even harder to share and balance cache resources efficiently.

Methods: TokenLake Architecture

The authors introduce TokenLake, which shifts from "instance-local" caching to a "global pool" model. Its core innovations include:

  • Segment-level Management: Instead of caching entire prefix trees, TokenLake breaks prefixes into fixed-size segments. This allows the system to distribute a single request's cache across multiple GPUs.
  • Declarative Interface: Unlike traditional imperative put/get APIs, TokenLake uses a declarative interface. The scheduler simply "declares" which query tensors and prefix segments are needed; TokenLake’s internal engines handle the data movement and attention computation transparently.
  • Heavy-Hitter-Aware Load Balancing: The system uses a hash-based strategy to spread "normal" segments across the cluster. For "heavy-hitter" segments (frequently accessed ones like system prompts), it uses selective replication to prevent any single GPU from becoming a bottleneck.
TokenLake architecture overview, showing the global prefix tree, scheduler, and the internal components of a homogeneous instance.
  • Bipartite Matching Dispatch: To minimize communication overhead, TokenLake uses the Hungarian algorithm to solve a bipartite matching problem, placing computation on instances that already hold (or are near) the required cache segments.
  • P2P Asynchronous Architecture: It employs dedicated "Query" and "Transfer" engines that run alongside the main compute engine (using NVIDIA MPS). This allows data transfer to be overlapped with computation, hiding network latency.

Evaluation and Key Results

The system was evaluated using three real-world workloads: LooGLE (long contexts, many shared prefixes), SCBench (multi-turn sessions), and ShareGPT (modified with long system prompts).

Key Performance Metrics

  • Throughput: TokenLake improved P90 goodput (throughput while meeting a latency Service Level Objective) by up to 2.6× compared to SGLang-Router and 2.0× compared to MoonCake.
  • Cache Hit Rate: It boosted hit rates by 2.0× to 2.1× by eliminating the fragmentation and isolation inherent in per-instance caching.
  • Load Balance: The Coefficient of Variation (CV) for cache access—a measure of imbalance—was reduced from 99% in SGLang to just 11% in TokenLake.
  • Latency: In multi-turn scenarios (SCBench), TokenLake significantly reduced decoding latency because it avoided the frequent, heavy cache transfers required by traditional PD-disaggregation systems.

Discussion: Insights and Limitations

A key "aha moment" in this research is the realization that strict data locality isn't necessary for high performance. As long as a cache segment is larger than a specific threshold (~568 tokens for their hardware), the time saved by harvesting remote memory bandwidth outweighs the network latency of fetching the data. Furthermore, by making the scheduler "stateless" regarding the cache, the system can focus entirely on compute efficiency (e.g., adjusting the Degree of Parallelism or batch sizes) without worrying about where the data lives.

Limitations and Future Work

TokenLake’s ability to hide latency relies on high-speed interconnects like NVLink or InfiniBand. Performance might degrade in environments with slower networking. Additionally, the dynamic programming algorithm used for scheduling could become a bottleneck in extremely high-concurrency scenarios. Future directions include exploring hierarchical caching (integrating CPU/Host memory) and further optimizing the interaction between the declarative interface and emerging hardware features.

Summary updated

BibTeX
@misc{wu2025tokenlake,
  author = {Bingyang Wu and Zili Zhang and Yinmin Zhong and Guanzhe Huang and Yibo Zhu and Xuanzhe Liu and Xin Jin},
  title = {{TokenLake: A Unified Segment-level Prefix Cache Pool for Fine-grained Elastic Long-Context LLM Serving}},
  year = {2025},
  eprint = {2508.17219},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.17219},
}
Figure