将工具调用拆解为选工具和生成参数,让本地模型也能高效准确执行复杂任务。
AgentFlux: Decoupled Fine-Tuning & Inference for On-Device Agentic Systems
- 分两步训练:专用LoRA适配器分别优化工具选择与参数生成
- 在MCP-Bench上使7B模型工具调用准确率提升46%,超越更大模型
- 适合需要隐私保护、低延迟的设备端智能代理应用
将大型语言模型作为智能体调度器部署,正推动任务自动化革新,但隐私保护与成本控制要求模型在终端设备上运行。然而,本地LLM在工具调用场景中表现持续落后,尤其在从大量工具中选择目标及生成复杂参数结构时能力不足。本文提出将工具调用任务解耦为工具选择与参数生成两个子任务,并引入‘解耦微调’方法,通过LoRA微调分别构建针对工具选择和特定工具参数生成的专用适配器,采用独立损失掩码进行训练。同时提出AgentFlux推理框架,利用解耦微调生成的LoRA适配器,在本地模型上实现高效智能体调度。该框架将工具调用生成分解为两步,动态加载对应适配器,并通过分层编排机制限制工具选择数量。在MCP-Bench基准测试中,使用解耦微调训练的Qwen-2.5-7B模型相比基线模型工具调用准确率提升46%,在所有对比情形下均优于同规模本地推理、非推理与微调模型,多数情况下也超越2倍规模的其他模型。
原文摘要 · Abstract (English)
The deployment of Large Language Models (LLMs) as agentic orchestrators has revolutionized task automation, but the need for privacy-preserving, cost-effective solutions demands on-device inference capabilities. However, local LLMs consistently underperform compared to frontier models in tool calling scenarios, struggling with both tool selection from large tool sets and accurate argument generation for complex parameter structures. We introduce a methodology that disaggregates a tool-calling task into two distinct subtasks: tool selection and argument generation. We propose "decoupled fine-tuning", a novel post-training approach that employs LoRA fine-tuning to create dedicated LoRA adapters for tool selection and tool-specific argument generation using separate loss masking for each of the subtasks. Furthermore, we present AgentFlux, an inference framework that leverages the LoRA adapters created using decoupled fine-tuning to perform efficient agent orchestration with the help of local models on end-user devices. AgentFlux decomposes the tool-call generation step into tool selection and argument generation, and dynamically loads the corresponding LoRA adapters to generate tool calls. Additionally, AgentFlux implements hierarchical orchestration to restrict the number of tools required for tool selection. Our experiments on the MCP-Bench benchmark demonstrate that the Qwen-2.5-7B model trained using decoupled fine-tuning improves the tool calling accuracy of the base model by 46%, and outperforms other local reasoning, non-reasoning and fine-tuned models of similar size in all cases, and models that are 2x larger, in most cases.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。