[논문 리뷰] CRAFT: Customizing LLMs by Creating and Retrieving from Specialized Toolsets
CRAFT는 실행 가능한 코드 조각의 작업 특화 도구 세트를 구성하고 다중 뷰 매칭으로 이를 검색하여 파인튜닝 없이 LLM을 보강하고 시각-언어, 표 형식, 수학적 추론 태스크의 성능을 향상시킵니다.
Large language models (LLMs) are often augmented with tools to solve complex tasks. By generating code snippets and executing them through task-specific Application Programming Interfaces (APIs), they can offload certain functions to dedicated external modules, such as image encoding and performing calculations. However, most existing approaches to augment LLMs with tools are constrained by general-purpose APIs and lack the flexibility for tailoring them to specific tasks. In this work, we present CRAFT, a general tool creation and retrieval framework for LLMs. It creates toolsets specifically curated for the tasks and equips LLMs with a component that retrieves tools from these sets to enhance their capability to solve complex tasks. For each task, we collect specific code solutions by prompting GPT-4 to solve the training examples. Following a validation step ensuring the correctness, these solutions are abstracted into code snippets to enhance reusability, and deduplicated for higher quality. At inference time, the language model retrieves snippets from the toolsets and then executes them or generates the output conditioning on the retrieved snippets. Our method is designed to be flexible and offers a plug-and-play approach to adapt off-the-shelf LLMs to unseen domains and modalities, without any finetuning. Experiments on vision-language, tabular processing, and mathematical reasoning tasks show that our approach achieves substantial improvements compared to strong baselines. In addition, our in-depth analysis reveals that: (1) consistent performance improvement can be achieved by scaling up the number of tools and the capability of the backbone models; (2) each component of our approach contributes to the performance gains; (3) the created tools are well-structured and reliable with low complexity and atomicity. The code is available at https://github.com/lifan-yuan/CRAFT.
연구 동기 및 목표
- LLM을 일반 목적 API가 아닌 curated 도구를 사용해 특수 도메인에 맞춤화해야 할 필요성에 동기를 부여합니다.
- 고품질의 재사용 가능한 도구를 생성하기 위한 오프라인 도구 생성, 검증, 중복 제거를 위한 전체 파이프라인을 제안합니다.
- 문제 텍스트, API 이름, 도큐스트링을 기반으로 도구를 선택하는 다중 뷰 검색 메커니즘을 개발하여 추론을 안내합니다.
- 미세조정 없이 파라미터 프리한 적응을 시연하고 다양한 태스크에서 평가하여 확장성과 견고성을 보입니다.
제안 방법
- 오프라인으로 문제를 샘플링하고 GPT-4로 실행 가능한 파이썬 솔루션을 생성한 뒤 정확한 것만 남깁니다.
- 입력 래핑과 변수 이름 바꾸기를 통해 다양한 도메인에 적용 가능하도록 솔루션을 일반적이고 재사용 가능한 도구로 추상화합니다.
- 원래 문제에서 추상화된 함수들을 테스트하여 도구를 검증하고 실패를 버립니다.
- 함수 이름과 입력 수로 그룹화하고 각 그룹에서 가장 일반적인 도구를 선택하여 도구를 중복 제거합니다.
- 추론 시 (문제, 함수 이름, 도큐스트링)에 대한 다중 뷰 매칭을 통해 SimCSE 기반 유사도로 도구를 검색하고 다수 결정을 통해 주어진 태스크에 필요한 최종 도구 세트를 구성합니다.
- 검색된 도구를 실행 가능한 코드 조각으로 LLM 프롬프트에 추가하여 솔루션 생성 중 도구 호출을 가능하게 합니다.
- VQA, 표 처리, 대수적 추론 전반에 걸쳐 GPT-3.5-Turbo로 종단 간 평가하고(보조 분석에서 GPT-4) 다양한 baselines와 비교합니다.
실험 결과
연구 질문
- RQ1대형으로 선별된 실행 가능한 도구 세트가 모델 미세조정 없이 외부 도구가 필요한 태스크에서 LLM 성능을 향상시킬 수 있나요?
- RQ2문제 텍스트, API 이름, 도큐스트링을 이용한 다중 뷰 검색 전략이 관련 도구를 선택하는 데 있어 더 단순한 검색 방법보다 우수한가요?
- RQ3도구 생성, 추상화, 검증, 중복 제거가 전체 성능에 각각 어떻게 기여하나요?
- RQ4도구 세트 크기와 백본 모델의 능력이 CRAFT의 이익에 어떤 영향을 미치나요?
- RQ5생성된 도구 세트의 특성(복잡도, 다양성)은 신뢰성에 어떻게 영향을 미치나요?
주요 결과
- CRAFT는 강력한 기준선 대비 상당한 개선을 달성하며, 시각-언어 태스크에서 두드러진 이익을 보입니다.
- 도구의 수와 백본 능력이 증가할수록 성능이 향상됩니다.
- 각 구성요소(추상화, 문제/이름/도큐스트링 매칭)가 이익에 기여하며 어떤 뷰를 제거하면 성능이 저하됩니다.
- 생성된 도구는 일반적으로 사이클로매틱 복잡도가 낮고 다양성이 높은 경향이 있어 신뢰성과 넓은 적용 가능성을 시사합니다.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.