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)을 어시스턴트로 활용합니다. 특정 도시의 날씨, 주식 가격, 심지어 이웃 내 특정 위치에 대해 묻는 경우가 있습니다. 이러한 질문에는 사용자의 질문에 답하기 위해 외부 API를 호출하는 코드를 생성해야 하지만, LLM은 첫 시도에서 정확한 코드를 생성하는 경우가 드물며 실행 결과를 바탕으로 반복적인 코드 개선이 필요합니다. 또한, 높은 질문량을 처리하기 위해 LLM 어시스턴트를 사용하는 것은 비용이 많이 들 수 있습니다. 본 연구에서는 코드 기반 질문에 더 경제적이고 정확하게 답할 수 있도록 돕는 EcoAssistant 프레임워크를 제안합니다. EcoAssistant는 세 가지 구성 요소를 포함합니다. 첫째, LLM 어시스턴트가 자동 코드 실행기와 대화하여 실행 결과를 바탕으로 코드를 반복적으로 개선하거나 답변을 생성할 수 있도록 합니다. 둘째, 더 약하고 저렴한 LLM으로 먼저 질문에 답을 시도한 후, 필요 시 더 강력하고 비싼 LLM으로 전환하는 계층적 LLM 어시스턴트 구조를 사용합니다. 셋째, 이전에 성공한 질문의 해결책을 검색하여 후속 질문에 도움이 되는 컨텍스트 내 예시로 활용합니다. 실험적으로, EcoAssistant는 경제성과 정확성 측면에서 뚜렷한 이점을 제공하며, GPT-4의 비용의 50% 미만으로 GPT-4보다 10% 높은 성공률을 달성함을 보여줍니다.
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.