InstCache: A Predictive Cache for LLM Serving

Longwei Zou, Yan Liu, Jiamu Kang, Tingfeng Liu, Jiangang Kong +1 more
11/21/2024
cs.CLcs.DC

No confident code implementation found for this paper.

Abstract

The revolutionary capabilities of Large Language Models (LLMs) are attracting rapidly growing popularity and leading to soaring user requests to inference serving systems. Caching techniques, which leverage data reuse to reduce computation, offer opportunities to optimize the performance of LLM inference engines. On the one hand, the low-level key-value (KV) cache working at the token level is widely adopted, albeit it incurs significant overhead as request volume grows. On the other hand, instruction-level caching, which stores full instruction-response pairs, is expected to play an increasingly crucial role. However, the high variability in the content and length of instructions make it rare for identical instructions to recur within a short time window, presenting challenges for effective caching instruction-response pairs. To address this challenge, we propose InstCache, a predictive caching mechanism for LLM serving systems. Leveraging the capability of LLMs, we can effectively reorder the representation space of instruction texts and develop a sufficient level of spatial locality. Such spatial locality enables us to predict potential instructions located in a compact region in the space, resulting in an effective caching system at runtime. Experimental results demonstrate that InstCache achieves a 2.3x higher hit rate compared to the upper bound of traditional caching mechanisms on WildChat dataset and reduces the time per output token of vLLM by up to 42.0% and 50.0% on LMSys and Moss datasets, respectively.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zou2024instcache,
  title  = {InstCache: A Predictive Cache for LLM Serving},
  author = {Longwei Zou and Yan Liu and Jiamu Kang and Tingfeng Liu and Jiangang Kong and Yangdong Deng},
  year   = {2024},
  eprint = {2411.13820},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.13820v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.13820.svg)](https://codeofpaper.com/paper/2411.13820)

Discussion