LLM Cache Bandit Revisited: Addressing Query Heterogeneity for Cost-Effective LLM Inference

Hantao Yang, Hong Xie, Defu Lian, Enhong Chen
9/19/2025
cs.CL

No confident code implementation found for this paper.

Abstract

This paper revisits the LLM cache bandit problem, with a special focus on addressing the query heterogeneity for cost-effective LLM inference. Previous works often assume uniform query sizes. Heterogeneous query sizes introduce a combinatorial structure for cache selection, making the cache replacement process more computationally and statistically challenging. We treat optimal cache selection as a knapsack problem and employ an accumulation-based strategy to effectively balance computational overhead and cache updates. In theoretical analysis, we prove that the regret of our algorithm achieves an $O(\sqrt{MNT})$ bound, improving the coefficient of $\sqrt{MN}$ compared to the $O(MN\sqrt{T})$ result in Berkeley, where $N$ is the total number of queries and $M$ is the cache size. Additionally, we also provide a problem-dependent bound, which was absent in previous works. The experiment rely on real-world data show that our algorithm reduces the total cost by approximately 12\%.

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{yang2025cache,
  title  = {LLM Cache Bandit Revisited: Addressing Query Heterogeneity for Cost-Effective LLM Inference},
  author = {Hantao Yang and Hong Xie and Defu Lian and Enhong Chen},
  year   = {2025},
  eprint = {2509.15515},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.15515v1}
}

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

Discussion