IC-Cache: Efficient Large Language Model Serving via In-context Caching

Yifan Yu, Yu Gan, Nikhil Sarda, Lillian Tsai, Jiaming Shen +5 more
1/22/2025
cs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Large language models (LLMs) have excelled in various applications, yet serving them at scale is challenging due to their substantial resource demands and high latency. Our real-world studies reveal that over 70% of user requests to LLMs have semantically similar counterparts, suggesting the potential for knowledge transfer among requests. However, naively caching and reusing past responses leads to a big quality drop. In this paper, we introduce IC-Cache, a caching system that enables live LLM capability augmentation to improve serving efficiency: by leveraging historical request-response pairs from larger models as in-context examples, IC-Cache empowers small LLMs to imitate and even exceed the compositional abilities (e.g., reasoning) of their larger counterparts, enabling selective offloading of requests to reduce cost and latency. Achieving this live augmentation at scale introduces intricate trade-offs between response quality, latency, and system throughput. For a new request, IC-Cache efficiently selects similar, high-utility examples to prepend them to the new request's input. At scale, it adaptively routes requests across LLMs of varying capabilities, accounting for response quality and serving loads. IC-Cache employs a cost-aware cache replay mechanism that refines example quality offline to maximize online cache utility and efficiency. Evaluations on millions of realistic requests demonstrate that IC-Cache improves LLM serving throughput by 1.4-5.9x and reduces latency by 28-71% without hurting response quality.

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. 2 weaker matches are hidden by default — 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{yu2025iccache,
  title  = {IC-Cache: Efficient Large Language Model Serving via In-context Caching},
  author = {Yifan Yu and Yu Gan and Nikhil Sarda and Lillian Tsai and Jiaming Shen and Yanqi Zhou and Arvind Krishnamurthy and Fan Lai and Henry M. Levy and David Culler},
  year   = {2025},
  eprint = {2501.12689},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.12689v3}
}

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/2501.12689.svg)](https://codeofpaper.com/paper/2501.12689)

Discussion