LLM Cache Bandits with Query Heterogeneity for Cost-Efficient Inference

Hantao Yang, Hong Xie, Xutong Liu, Defu Lian


Abstract
This paper revisits the LLM cache bandit problem, with a special focus on addressing query heterogeneity for cost-effective LLM inference. Previous works often assume uniform query sizes. Heterogeneous query sizes introduce a combinatorial structure into 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 our theoretical analysis, we prove that the regret of our algorithm achieves an O(√MNT) bound, improving the coefficient of √MN compared to the O(MN√T) result in Zhu et al. (2023), 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. Experiments on real-world data show that our algorithm reduces the total cost by approximately 12%.
Anthology ID:
2026.emnlp-main.1849
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
42054–42087
Language:
URL:
https://aclanthology.org/2026.emnlp-main.1849/
DOI:
Bibkey:
Cite (ACL):
Hantao Yang, Hong Xie, Xutong Liu, and Defu Lian. 2026. LLM Cache Bandits with Query Heterogeneity for Cost-Efficient Inference. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 42054–42087, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
LLM Cache Bandits with Query Heterogeneity for Cost-Efficient Inference (Yang et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.1849.pdf