arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.02440cs.LG
收藏

低成本评估自回归Transformer API的推理效率指标

Cheaply Evaluating Inference Efficiency Metrics for Autoregressive Transformer APIs

Microsoft Research(微软研究院);Stanford University(斯坦福大学)

Deepak Narayanan, Keshav Santhanam, Peter Henderson, Rishi Bommasani, Tony Lee, Percy Liang

AI总结:

针对黑盒LLM API原始运行时无法公平反映模型推理效率的问题,提出理想化运行时指标及成本感知变体,可低成本估计自回归Transformer的推理效率,首次开展10个前沿LLM的效率-能力权衡分析。

摘要:

大语言模型(LLM)支撑着自然语言处理领域诸多最先进的系统。然而,这类模型的计算成本极高,即便在推理阶段也是如此,这自然引发了一个问题:部署更大模型的额外成本何时能与其预期的能力提升相匹配?要从根本上更好地理解这种权衡,亟需一种推理效率指标,该指标需同时满足两个条件:(i)可轻松跨不同提供商的模型进行比较,(ii)能代表在隔离性能环境中运行查询的真实成本。遗憾的是,目前的LLM访问大多局限于黑盒文本生成API,而通过该接口测得的原始运行时并不满足这些要求:模型提供商可能应用各种与模型本身无关的软硬件优化,且部署在共享基础设施上的模型易受性能争用的影响。为规避这些问题,我们提出了一种用于跨模型比较推理效率的新指标。该指标将所有模型置于同等条件下,假设它们(i)在统一的软硬件上运行,且(ii)不存在性能争用。我们将该指标称为“理想化运行时(idealized runtime)”,并提出了一种可高效估计自回归Transformer模型该指标的方法。我们还提出了结合服务模型所需加速器数量的成本感知变体指标。利用这些指标,我们对10个最先进的LLM进行了比较,首次开展了推理效率-能力权衡分析;我们从该分析中得出了多项观察结果,包括某些API更优的推理运行时性能往往是API内部优化的副产品,而非底层模型本身的优势。我们的方法还有助于高效比较不同的软硬件栈。

英文摘要:

Large language models (LLMs) power many state-of-the-art systems in natural language processing. However, these models are extremely computationally expensive, even at inference time, raising the natural question: when is the extra cost of deploying a larger model worth the anticipated boost in capabilities? Better understanding this tradeoff fundamentally could benefit from an inference efficiency metric that is both (i) easily comparable across models from different providers, and (ii) representative of the true cost of running queries in an isolated performance environment. Unfortunately, access to LLMs today is largely restricted to black-box text generation APIs and raw runtimes measured through this interface do not satisfy these desiderata: model providers can apply various software and hardware optimizations orthogonal to the model, and models served on shared infrastructure are susceptible to performance contention. To circumvent these problems, we propose a new metric for comparing inference efficiency across models. This metric puts models on equal footing as though they were served (i) on uniform hardware and software, and (ii) without performance contention. We call this metric the \emph{idealized runtime}, and we propose a methodology to efficiently estimate this metric for autoregressive Transformer models. We also propose cost-aware variants that incorporate the number of accelerators needed to serve the model. Using these metrics, we compare ten state-of-the-art LLMs to provide the first analysis of inference efficiency-capability tradeoffs; we make several observations from this analysis, including the fact that the superior inference runtime performance of certain APIs is often a byproduct of optimizations within the API rather than the underlying model. Our methodology also facilitates the efficient comparison of different software and hardware stacks.

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

↑