arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.02003cs.LGcs.AIcs.PFcs.SYeess.SYstat.ML
收藏

关于大型模型推理的最优缓存与模型多路复用

On Optimal Caching and Model Multiplexing for Large Model Inference

UC Berkeley(加州大学伯克利分校);Stanford University(斯坦福大学)

Banghua Zhu, Ying Sheng, Lianmin Zheng, Clark Barrett, Michael I. Jordan, Jiantao Jiao

AI总结:

本文针对大型模型推理的资源消耗与延迟问题,提出联合优化缓存与模型多路复用的最优算法,在离线和在线设置中实现最优速率,实验显示最高可提升50倍性能。

摘要:

大型语言模型(LLM)和其他大型基础模型取得了显著成功,但其规模加剧了现有的资源消耗和延迟挑战。特别是,这些模型的大规模部署受到推理过程中大量资源需求的阻碍。在本文中,我们研究了两种缓解这些挑战的方法:使用缓存存储先前的查询,以及学习一个模型多路复用器以从模型集合中选择用于查询处理的模型。理论上,我们提供了一种最优算法,用于联合优化这两种方法,以在离线和在线表格设置中降低推理成本。通过将缓存算法(即贪婪双尺寸与频率(GDSF)或最小期望成本(LEC))与模型多路复用器相结合,我们在离线和在线设置中均实现了最优速率。实证上,模拟表明,我们的缓存和模型多路复用算法的组合大大优于基线,当最大成本与最小成本之比为100时,比基线提高了高达50倍。在真实数据集上的实验显示,当FLOPs之比为10时,FLOPs比基线提高了4.3倍;当平均延迟之比为1.85时,延迟提高了1.8倍。

英文摘要:

Large Language Models (LLMs) and other large foundation models have achieved noteworthy success, but their size exacerbates existing resource consumption and latency challenges. In particular, the large-scale deployment of these models is hindered by the significant resource requirements during inference. In this paper, we study two approaches for mitigating these challenges: employing a cache to store previous queries and learning a model multiplexer to choose from an ensemble of models for query processing. Theoretically, we provide an optimal algorithm for jointly optimizing both approaches to reduce the inference cost in both offline and online tabular settings. By combining a caching algorithm, namely Greedy Dual Size with Frequency (GDSF) or Least Expected Cost (LEC), with a model multiplexer, we achieve optimal rates in both offline and online settings. Empirically, simulations show that the combination of our caching and model multiplexing algorithms greatly improves over the baselines, with up to $50\times$ improvement over the baseline when the ratio between the maximum cost and minimum cost is $100$. Experiments on real datasets show a $4.3\times$ improvement in FLOPs over the baseline when the ratio for FLOPs is $10$, and a $1.8\times$ improvement in latency when the ratio for average latency is $1.85$.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑