arXiv:2505.20192cs.LGcs.IR2025-05

通过自精炼多尺度损失和自动数据优化,提升大模型函数调用准确率。

FunReason: Enhancing Large Language Models' Function Calling via Self-Refinement Multiscale Loss and Automated Data Refinement

  • 用大模型生成高质量训练数据,聚焦解析可读性与调用精准度。
  • 提出自精炼多尺度损失,动态平衡推理过程与函数调用精度。
  • 在微调中有效防止灾难性遗忘,性能接近GPT-4o。

大语言模型(LLMs)与函数调用的结合已成为提升其在真实场景中实用性的关键能力。然而,如何有效融合推理过程与精确函数执行仍是重大挑战。传统训练方法难以兼顾详细推理步骤与函数调用精度,导致性能不佳。为此,我们提出FunReason框架,通过自动化数据精炼策略和自精炼多尺度损失(SRML)增强大模型的函数调用能力。该框架利用大模型的自然推理能力生成高质量训练样本,重点优化查询可解析性、推理连贯性和函数调用精准度。SRML在训练过程中动态调节推理与调用精度的贡献权重,解决二者之间的固有权衡问题。实验表明,FunReason在性能上可媲美GPT-4o,同时在微调过程中有效缓解灾难性遗忘。该工作为提升大模型函数调用能力提供了完整的解决方案,包含平衡的训练方法与数据精炼流程。代码与数据集见GitHub仓库:https://github.com/BingguangHao/FunReason。

原文摘要 · Abstract (English)

The integration of large language models (LLMs) with function calling has emerged as a crucial capability for enhancing their practical utility in real-world applications. However, effectively combining reasoning processes with accurate function execution remains a significant challenge. Traditional training approaches often struggle to balance the detailed reasoning steps with the precision of function calls, leading to suboptimal performance. To address these limitations, we introduce FunReason, a novel framework that enhances LLMs' function calling capabilities through an automated data refinement strategy and a Self-Refinement Multiscale Loss (SRML) approach. FunReason leverages LLMs' natural reasoning abilities to generate high-quality training examples, focusing on query parseability, reasoning coherence, and function call precision. The SRML approach dynamically balances the contribution of reasoning processes and function call accuracy during training, addressing the inherent trade-off between these two critical aspects. FunReason achieves performance comparable to GPT-4o while effectively mitigating catastrophic forgetting during fine-tuning. FunReason provides a comprehensive solution for enhancing LLMs' function calling capabilities by introducing a balanced training methodology and a data refinement pipeline. For code and dataset, please refer to our repository at GitHub https://github.com/BingguangHao/FunReason

函数调用大模型自精炼训练优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。