Skip to main navigation Skip to search Skip to main content

MeanCache: User-Centric Semantic Caching for LLM Web Services

  • Waris Gill
  • , Mohamed Elidrisi
  • , Pallavi Kalapatapu
  • , Ammar Ahmed
  • , Ali Anwar
  • , Muhammad Ali Gulzar

Research output: Chapter in Book/Report/Conference proceeding › Conference contribution

Abstract

Large Language Models (LLMs) like ChatGPT and Llama have revolutionized natural language processing and search engine dynamics. However, these models incur exceptionally high computational costs. For instance, GPT-3 consists of 175 billion parameters, where inference demands billions of floating-point operations. Caching is a natural solution to reduce LLM inference costs on repeated queries. However, existing caching methods are incapable of finding semantic similarities among LLM queries nor do they operate effectively on contextual queries, leading to unacceptable false hit-and-miss rates. This paper introduces MeanCache, a user-centric semantic cache for LLM-based services that identifies semantically similar queries to determine cache hit or miss. Using MeanCache, the response to a user's semantically similar query can be retrieved from a local cache rather than re-querying the LLM, thus reducing costs, service provider load, and environmental impact. MeanCache leverages Federated Learning (FL) to collaboratively train a query similarity model without violating user privacy. By placing a local cache in each user's device and using FL, MeanCache reduces the latency, costs, and enhances model performance, resulting in lower false-hit rates. MeanCache also encodes context chains for every cached query, offering a simple yet highly effective mechanism to discern contextual query responses from standalone queries. Our experiments benchmarked against the state-of-the-art caching method reveal that MeanCache attains an approximately 17% higher F -score and a 20% increase in precision during semantic cache hit-and-miss decisions while performing even better on contextual queries. It also reduces the storage requirement by 83% and accelerates semantic cache hit-and-miss decisions by 11%.

Original languageEnglish (US)
Title of host publicationProceedings - 2025 IEEE International Parallel and Distributed Processing Symposium, IPDPS 2025
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages1298-1310
Number of pages13
Edition2025
ISBN (Electronic)9798331532376
DOIs
StatePublished - 2025
Event39th IEEE International Parallel and Distributed Processing Symposium, IPDPS 2025 - Milan, Italy
Duration: Jun 3 2025 → Jun 7 2025

Publication series

Name2025 IEEE International Parallel and Distributed Processing Symposium (IPDPS)

Conference

Conference39th IEEE International Parallel and Distributed Processing Symposium, IPDPS 2025
Country/TerritoryItaly
CityMilan
Period6/3/25 → 6/7/25

Bibliographical note

Publisher Copyright:
© 2025 IEEE.

Keywords

  • Cache
  • Contextual Queries
  • Embedding
  • Large Language Models
  • Privacy-Preserving AI
  • Semantic Cache

Fingerprint

Dive into the research topics of 'MeanCache: User-Centric Semantic Caching for LLM Web Services'. Together they form a unique fingerprint.

Cite this