arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2309.17428cs.CLcs.AIcs.LG
收藏

CRAFT:通过创建和检索专用工具集来定制大语言模型

CRAFT: Customizing LLMs by Creating and Retrieving from Specialized Toolsets

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Lifan Yuan, Yangyi Chen, Xingyao Wang, Yi R. Fung, Hao Peng, Heng Ji

AI总结:

CRAFT提出一种无需微调的通用工具创建与检索框架,通过为任务生成并验证代码片段形成工具集,在推理时检索执行,显著提升LLM在视觉-语言、表格和数学推理任务上的表现。

摘要:

大型语言模型(LLMs)通常通过工具来增强以解决复杂任务。通过生成代码片段并通过任务特定的应用程序编程接口(APIs)执行这些片段,它们可以将某些功能(如图像编码和执行计算)卸载到专用的外部模块。然而,现有的大多数为LLMs增强工具的方法受限于通用API,缺乏针对特定任务进行定制的灵活性。在这项工作中,我们提出了CRAFT,一个用于LLMs的通用工具创建和检索框架。它为任务专门策划工具集,并为LLMs配备一个从这些集合中检索工具的组件,以增强其解决复杂任务的能力。对于每个任务,我们通过提示GPT-4解决训练示例来收集特定的代码解决方案。在验证步骤确保正确性之后,这些解决方案被抽象为代码片段以增强可重用性,并进行去重以提高质量。在推理时,语言模型从工具集中检索片段,然后执行它们或根据检索到的片段生成输出。我们的方法设计灵活,提供了一种即插即用的方法,使现成的LLMs适应未见过的领域和模态,无需任何微调。在视觉-语言、表格处理和数学推理任务上的实验表明,与强基线相比,我们的方法实现了显著的改进。此外,我们的深入分析揭示:(1)通过增加工具数量和骨干模型的能力,可以实现一致的性能提升;(2)我们方法的每个组成部分都对性能提升有所贡献;(3)创建的工具结构良好且可靠,具有低复杂性和原子性。代码可在https://github.com/lifan-yuan/CRAFT获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑