Parrot: セマンティック変数を用いたLLMベースアプリケーションの効率的な提供
Parrot: Efficient Serving of LLM-based Applications with Semantic Variable
May 30, 2024
著者: Chaofan Lin, Zhenhua Han, Chengruidong Zhang, Yuqing Yang, Fan Yang, Chen Chen, Lili Qiu
cs.AI
要旨
大規模言語モデル(LLM)の台頭により、LLMを基盤としたアプリケーション(AIエージェントやコパイロットとも呼ばれる)という新しいソフトウェアパラダイムが可能となりました。これは、LLMと従来のソフトウェアの強みを組み合わせたものです。異なるテナントからの多様なLLMアプリケーションは、複数のLLMリクエストを使用して複雑なワークフローを設計し、1つのタスクを達成することができます。しかし、現在のパブリックLLMサービスが提供する過度に簡素化されたリクエストレベルのAPIを使用せざるを得ず、アプリケーションレベルの重要な情報が失われています。パブリックLLMサービスは、個々のLLMリクエストを盲目的に最適化するため、LLMアプリケーションのエンドツーエンドのパフォーマンスが最適化されない結果となっています。
本論文では、LLMベースのアプリケーションのエンドツーエンド体験に焦点を当てたLLMサービスシステム「Parrot」を紹介します。Parrotは、アプリケーションレベルの知識をパブリックLLMサービスに公開するための統一された抽象化として「セマンティック変数」を提案します。セマンティック変数は、リクエストのプロンプト内の入力/出力変数に注釈を付け、複数のLLMリクエストを接続する際にデータパイプラインを作成し、LLMアプリケーションをプログラミングする自然な方法を提供します。セマンティック変数をパブリックLLMサービスに公開することで、従来のデータフロー分析を実行し、複数のLLMリクエスト間の相関関係を明らかにすることができます。この相関関係は、LLMベースのアプリケーションのエンドツーエンドパフォーマンスのための全く新しい最適化の余地を開きます。広範な評価により、ParrotがLLMアプリケーションの人気のある実用的なユースケースにおいて、最大で桁違いの改善を達成できることが実証されています。
English
The rise of large language models (LLMs) has enabled LLM-based applications
(a.k.a. AI agents or co-pilots), a new software paradigm that combines the
strength of LLM and conventional software. Diverse LLM applications from
different tenants could design complex workflows using multiple LLM requests to
accomplish one task. However, they have to use the over-simplified
request-level API provided by today's public LLM services, losing essential
application-level information. Public LLM services have to blindly optimize
individual LLM requests, leading to sub-optimal end-to-end performance of LLM
applications.
This paper introduces Parrot, an LLM service system that focuses on the
end-to-end experience of LLM-based applications. Parrot proposes Semantic
Variable, a unified abstraction to expose application-level knowledge to public
LLM services. A Semantic Variable annotates an input/output variable in the
prompt of a request, and creates the data pipeline when connecting multiple LLM
requests, providing a natural way to program LLM applications. Exposing
Semantic Variables to the public LLM service allows it to perform conventional
data flow analysis to uncover the correlation across multiple LLM requests.
This correlation opens a brand-new optimization space for the end-to-end
performance of LLM-based applications. Extensive evaluations demonstrate that
Parrot can achieve up to an order-of-magnitude improvement for popular and
practical use cases of LLM applications.Summary
AI-Generated Summary