让工具调用更精准:通过初始化对齐词向量空间提升大模型工具使用能力
Re-Initialization Token Learning for Tool-Augmented Large Language Models
- 用工具名称/描述构建先验嵌入,初始化工具令牌以对齐词向量空间
- 在GSM8K-XL等4个数据集上,工具调用准确率显著优于CoT、REACT等基线
- 适合需要复杂推理与外部工具协同的大模型应用开发者
大型语言模型在复杂任务如数值推理和计划生成上表现受限。将计算器、数据库等外部工具集成至大模型是增强其求解能力的关键。现有方法为每个工具分配唯一令牌,通过令牌预测实现工具调用,但未考虑工具令牌与词令牌间的关联,限制了预训练模型的适应性。为此,本文提出一种新的令牌学习方法,从初始化角度将工具令牌与现有词嵌入空间对齐,从而提升模型性能。首先基于工具名称或描述构建先验令牌嵌入,用于初始化和正则化可学习的工具令牌嵌入,确保学习后的嵌入与词令牌空间良好对齐,提升工具调用准确性。在GSM8K-XL、FuncQA、KAMEL和VirtualHome数据集上评估,结果表明该方法在数值推理、基于知识的问题回答及具身计划生成任务中均显著优于CoT、REACT、ICL和ToolkenGPT等近期基线,验证了通过相关令牌在多领域有效增强大模型工具能力的有效性。
原文摘要 · Abstract (English)
Large language models have demonstrated exceptional performance, yet struggle with complex tasks such as numerical reasoning, plan generation. Integrating external tools, such as calculators and databases, into large language models (LLMs) is crucial for enhancing problem-solving capabilities. Current methods assign a unique token to each tool, enabling LLMs to call tools through token prediction-similar to word generation. However, this approach fails to account for the relationship between tool and word tokens, limiting adaptability within pre-trained LLMs. To address this issue, we propose a novel token learning method that aligns tool tokens with the existing word embedding space from the perspective of initialization, thereby enhancing model performance. We begin by constructing prior token embeddings for each tool based on the tool's name or description, which are used to initialize and regularize the learnable tool token embeddings. This ensures the learned embeddings are well-aligned with the word token space, improving tool call accuracy. We evaluate the method on tasks such as numerical reasoning, knowledge-based question answering, and embodied plan generation using GSM8K-XL, FuncQA, KAMEL, and VirtualHome datasets. The results demonstrate clear improvements over recent baselines, including CoT, REACT, ICL, and ToolkenGPT, indicating that our approach effectively augments LLMs with tools through relevant tokens across diverse domains.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。