TLDR: FunRL is a new reinforcement learning framework that significantly improves Large Language Models’ ability to make function calls. It uses entropy-enhanced exploration and a two-stage data pipeline to address challenges like insufficient exploration and lack of structured reasoning. FunRL achieved state-of-the-art performance on the BFCLv2 benchmark, especially benefiting code-pretrained models, by fostering more robust and accurate function calling.
Large Language Models (LLMs) are becoming increasingly powerful, moving beyond just generating text to interacting with the real world through “function calls.” This capability allows LLMs to use external tools, access up-to-date information, and perform specific actions, greatly expanding their utility. However, training LLMs to make robust and accurate function calls has been a significant challenge.
Current training methods, such as supervised fine-tuning and standard reinforcement learning, often fall short. Supervised fine-tuning can lead models to rely on superficial pattern matching, while traditional reinforcement learning struggles with the complex nature of structured function calls. Issues like sparse rewards (where a small error invalidates the whole call), the difficulty of exploring complex tool APIs, and a lack of transparent reasoning have hindered progress.
A new research paper introduces FunRL, a novel reinforcement learning framework designed to significantly enhance LLMs’ function calling capabilities. FunRL addresses these critical challenges by improving Group Relative Policy Optimization (GRPO) through strategic entropy-based exploration. This innovative approach helps models explore more diverse reasoning paths, which is crucial for complex parameter selection and verification in function calls.
FunRL tackles three key areas: insufficient exploration during policy learning, the absence of structured reasoning in chain-of-thought generation, and inadequate verification of parameter extraction. To ensure high-quality training, the researchers developed a two-stage data preparation pipeline. This pipeline involves iterative LLM evaluation and abstract syntax tree (AST) validation, ensuring that the training samples are accurate and well-formatted.
The framework uses a binary reward structure that emphasizes both correctness and format compliance, providing precise feedback signals during training. By integrating Chain-of-Thought (CoT) entropy into the advantage calculation, FunRL encourages the model to explore different thinking patterns while maintaining stable optimization for accurate function calling.
Extensive experiments conducted on the Berkeley Function Calling Leaderboard (BFCLv2) demonstrate FunRL’s effectiveness. It achieved state-of-the-art performance among open-source models with an impressive 86.02% overall accuracy. Notably, FunRL outperformed standard GRPO by up to 6% in complex multi-function scenarios. The framework showed particularly strong improvements on code-pretrained models, suggesting that their inherent structured language generation capabilities provide an excellent starting point for reinforcement learning in function calling tasks.
For instance, in a currency conversion task, both GRPO and FunRL models correctly identified the need for a `convert_currency` function. However, FunRL’s internal “think” process was more detailed and formal in verifying the parameters, indicating a more robust reasoning strategy. The paper highlights that FunRL leads to a larger KL divergence during training, meaning the model explores more diverse thinking patterns compared to GRPO, which contributes to its superior performance.
Also Read:
- Enhancing Code Generation with Reasoning-Aware Reinforcement Learning
- Light-IF: A New Approach for LLMs to Master Complex Instructions
The researchers plan to release all code, models, and datasets to benefit the wider community, fostering further advancements in this crucial area of LLM development. You can find the full research paper here: Exploring Superior Function Calls via Reinforcement Learning.


