자동회귀 트랜스포머 API의 추론 효율성 메트릭을 저비용으로 평가하기
Cheaply Evaluating Inference Efficiency Metrics for Autoregressive Transformer APIs
May 3, 2023
저자: Deepak Narayanan, Keshav Santhanam, Peter Henderson, Rishi Bommasani, Tony Lee, Percy Liang
cs.AI
초록
대규모 언어 모델(LLMs)은 자연어 처리 분야에서 최첨단 시스템을 구동하는 핵심 요소입니다. 그러나 이러한 모델들은 추론 시점에서도 매우 높은 계산 비용을 요구하며, 이는 더 큰 모델을 배포하는 데 드는 추가 비용이 예상되는 성능 향상을 정당화할 수 있는 시점이 언제인지에 대한 근본적인 질문을 제기합니다. 이러한 절충 관계를 더 잘 이해하기 위해서는 (i) 서로 다른 제공업체의 모델 간에 쉽게 비교 가능하고, (ii) 격리된 성능 환경에서 쿼리를 실행하는 실제 비용을 대표할 수 있는 추론 효율성 지표가 필요합니다. 불행히도, 현재 LLMs에 대한 접근은 대부분 블랙박스 텍스트 생성 API로 제한되어 있으며, 이 인터페이스를 통해 측정된 원시 실행 시간은 이러한 요구 사항을 충족하지 못합니다. 모델 제공업체는 모델과 무관한 다양한 소프트웨어 및 하드웨어 최적화를 적용할 수 있으며, 공유 인프라에서 서비스되는 모델은 성능 경합에 취약합니다. 이러한 문제를 해결하기 위해, 우리는 모델 간 추론 효율성을 비교할 수 있는 새로운 지표를 제안합니다. 이 지표는 모델들이 (i) 균일한 하드웨어와 소프트웨어에서 서비스되고, (ii) 성능 경합 없이 실행되는 것처럼 동등한 조건에서 비교할 수 있도록 합니다. 우리는 이 지표를 이상화된 실행 시간(idealized runtime)이라고 부르며, 자기회귀 트랜스포머 모델에 대해 이 지표를 효율적으로 추정하는 방법론을 제안합니다. 또한, 모델을 서비스하는 데 필요한 가속기 수를 고려한 비용 인식 변형 지표도 제안합니다. 이러한 지표를 사용하여, 우리는 10개의 최첨단 LLMs를 비교하여 추론 효율성과 성능 간의 절충 관계에 대한 첫 번째 분석을 제공합니다. 이 분석을 통해 우리는 특정 API의 우수한 추론 실행 시간 성능이 종종 기본 모델보다는 API 내부의 최적화의 부산물이라는 사실을 포함한 여러 관찰을 도출합니다. 우리의 방법론은 또한 서로 다른 소프트웨어 및 하드웨어 스택을 효율적으로 비교하는 데 도움을 줍니다.
English
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
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.