MeanCache:面向LLM Web服务的用户中心语义缓存
MeanCache: User-Centric Semantic Caching for LLM Web Services
AI总结:
MeanCache提出用户中心语义缓存,利用联邦学习训练查询相似性模型,识别语义相似查询,减少LLM重复推理成本,相比最先进方法F分数提升17%,精度提升20%,存储降低83%。
摘要:
像ChatGPT和Llama这样的大型语言模型(LLMs)已经彻底改变了自然语言处理和搜索引擎的动态。然而,这些模型产生了异常高的计算成本。例如,GPT-3包含1750亿个参数,其推理需要数十亿次浮点运算。缓存是降低LLM在重复查询上推理成本的自然解决方案,这些重复查询约占总查询的31%。然而,现有的缓存方法无法发现LLM查询之间的语义相似性,也不适用于上下文查询,导致不可接受的假命中和假未命中率。本文介绍了MeanCache,一种面向基于LLM的服务的用户中心语义缓存,它识别语义相似的查询以确定缓存命中或未命中。使用MeanCache,用户语义相似查询的响应可以从本地缓存中检索,而不是重新查询LLM,从而降低成本、服务提供商负载和环境影响。MeanCache利用联邦学习(FL)协作训练查询相似性模型,同时不侵犯用户隐私。通过在每个用户设备上放置本地缓存并使用FL,MeanCache降低了延迟和成本,并增强了模型性能,从而降低了假命中率。MeanCache还为每个缓存的查询编码上下文链,提供了一种简单但非常有效的机制来区分上下文查询响应与独立查询响应。我们的实验与最先进的缓存方法进行了基准比较,结果表明,MeanCache在语义缓存命中与未命中决策中获得了约17%更高的F分数和20%的精度提升,在上下文查询上表现更好。它还将存储需求降低了83%,并将语义缓存命中与未命中决策加速了11%。
英文摘要:
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, which constitute about 31% of the total queries. However, existing caching methods are incapable of finding semantic similarities among LLM queries nor do they operate 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 and 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. 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%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。