ChatPaper.aiChatPaper

EcoAssistant: LLMアシスタントをより低コストかつ高精度に活用する方法

EcoAssistant: Using LLM Assistant More Affordably and Accurately

October 3, 2023
著者: Jieyu Zhang, Ranjay Krishna, Ahmed H. Awadallah, Chi Wang
cs.AI

要旨

今日、ユーザーは大規模言語モデル(LLM)をアシスタントとして、外部知識を必要とするクエリに答えてもらうよう求めています。特定の都市の天気、株価、さらには近隣の特定の場所について尋ねることもあります。これらのクエリでは、LLMが外部APIを呼び出すコードを生成してユーザーの質問に答える必要がありますが、LLMが最初の試行で正しいコードを生成することは稀で、実行結果に基づいてコードを反復的に改良する必要があります。さらに、高頻度のクエリをサポートするためにLLMアシスタントを使用すると、コストがかかることがあります。本研究では、コード駆動型のクエリに対して、より経済的かつ正確に答えることを可能にするフレームワーク「EcoAssistant」を提案します。EcoAssistantは3つのコンポーネントで構成されています。まず、LLMアシスタントが自動コード実行器と対話し、実行結果に基づいてコードを反復的に改良したり、答えを生成したりできるようにします。次に、LLMアシスタントの階層を使用し、より弱くて安価なLLMでクエリに答えようと試み、それでも解決できない場合にのみ、より強力で高価なLLMに切り替えます。最後に、過去の成功したクエリから解決策を取得し、後続のクエリを支援するための文脈内デモンストレーションとして使用します。実証的に、EcoAssistantは経済性と正確性において明確な利点を提供し、GPT-4の成功率を10ポイント上回り、GPT-4のコストの50%未満で達成できることを示しています。
English
Today, users ask Large language models (LLMs) as assistants to answer queries that require external knowledge; they ask about the weather in a specific city, about stock prices, and even about where specific locations are within their neighborhood. These queries require the LLM to produce code that invokes external APIs to answer the user's question, yet LLMs rarely produce correct code on the first try, requiring iterative code refinement upon execution results. In addition, using LLM assistants to support high query volumes can be expensive. In this work, we contribute a framework, EcoAssistant, that enables LLMs to answer code-driven queries more affordably and accurately. EcoAssistant contains three components. First, it allows the LLM assistants to converse with an automatic code executor to iteratively refine code or to produce answers based on the execution results. Second, we use a hierarchy of LLM assistants, which attempts to answer the query with weaker, cheaper LLMs before backing off to stronger, expensive ones. Third, we retrieve solutions from past successful queries as in-context demonstrations to help subsequent queries. Empirically, we show that EcoAssistant offers distinct advantages for affordability and accuracy, surpassing GPT-4 by 10 points of success rate with less than 50% of GPT-4's cost.
PDF61December 15, 2024