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

Bingguang Hao, ZengZhuang Xu, Maolin Wang, Yuntao Wen, Yicheng Chen +7 more
5/26/2025
cs.LGcs.IR

No official code found. Best implementation: BingguangHao/BalanceSFT (57 stars, last commit 2025-11-24).

Abstract

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

View on arXivView PDF

Code Implementations(1)

This is the official repository of the paper "BalanceSFT: Improving LLM Function Calling with Balanced Training Signals and Data Hardness"

570May 16, 202511 months ago

Similar Papers

Cite this paper

@article{hao2025funreason,
  title  = {FunReason: Enhancing Large Language Models' Function Calling via Self-Refinement Multiscale Loss and Automated Data Refinement},
  author = {Bingguang Hao and ZengZhuang Xu and Maolin Wang and Yuntao Wen and Yicheng Chen and Cunyin Peng and Long Chen and Dong Wang and Xiangyu Zhao and Jinjie Gu and Chenyi Zhuang and Ji Zhang},
  year   = {2025},
  eprint = {2505.20192},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.20192v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.20192.svg)](https://codeofpaper.com/paper/2505.20192)

Discussion