Abstract
The effective training of Large Language Models (LLMs) for function calling faces a critical challenge: balancing exploration of complex reasoning paths with stable policy optimization. Standard methods like Supervised Fine-Tuning (SFT) fail to instill robust reasoning, and traditional Reinforcement Learning (RL) struggles with inefficient exploration. We propose EGPO, a new RL framework built upon Group Relative Policy Optimization (GRPO), designed to address this challenge directly. The core of EGPO is an entropy-enhanced advantage function that integrates the entropy of the model's Chain-of-Thought (CoT) into the policy gradient computation. This encourages the generation of diverse reasoning strategies. To maintain optimization direction, the entropy bonus is carefully constrained by a clipping mechanism. Complemented by a strict, binary reward signal, EGPO effectively guides the model towards discovering structured and accurate tool invocation patterns. On the challenging Berkeley Function Calling Leaderboard (BFCL), a 4B-parameter model trained with EGPO sets a new state-of-the-art among models of comparable size, surpassing a range of strong competitors, including GPT-4o and Gemini-2.5.
Introduction
For LLMs to function as effective agents, they must reliably interact with external tools and APIs—a capability known as function calling. However, training models to do this robustly is difficult. Current approaches typically rely on Supervised Fine-Tuning (SFT), which often results in superficial pattern mimicry rather than genuine reasoning. While Reinforcement Learning (RL) offers a potential solution, it faces two major hurdles: signal scarcity (due to strict syntax requirements) and rewarding redundancy (where complex, step-by-step rewards lead to "gamed" behaviors).
The EGPO Framework
To address these challenges, we introduce Entropy-Guided Policy Optimization (EGPO). Built upon Group Relative Policy Optimization (GRPO), EGPO balances exploration and exploitation through three key components:
- CoT Entropy Bonus: The framework calculates the entropy of tokens generated during the model's Chain-of-Thought (
<think>...</think>) phase. This entropy is added to the advantage calculation, rewarding the model for exploring diverse reasoning strategies. - Advantage Clipping: To prevent the entropy bonus from flipping the sign of the original advantage and derailing learning, EGPO employs a clipping mechanism that preserves the correct optimization direction.
- Single-Criteria Binary Reward: Instead of partial credit, EGPO uses a strict binary reward. A score of
1is granted only if the output format is perfect, follows the reasoning template, and the resulting Abstract Syntax Tree (AST) matches the ground truth.
Key Insights and Emergent Behaviors
A significant finding is that EGPO encourages emergent self-verification. Models trained with EGPO naturally learned to generate "verification" and "structural parameter check" tokens. Over 20% of CoT tokens in EGPO models were dedicated to explicitly verifying parameters before execution—a behavior absent in standard GRPO models.
Furthermore, the research highlights that simple rewards outperform complex ones. Partial credits for intermediate steps (like correct formatting) actually degraded performance. A harsh, binary reward forces the model to focus on final correctness rather than optimizing for intermediate artifacts.
Results and Performance
The EGPO-4B model achieved state-of-the-art results across several benchmarks, notably outperforming much larger proprietary models.
- BFCLv3 Multi-Turn: EGPO-4B scored 56.25%, significantly higher than GPT-4o (42.50%) and the 8B open-source SOTA ToolACE-MT (40.25%).
- BFCLv3 Single-Turn: It achieved 84.92%, surpassing GPT-4o (77.21%) and even the massive Qwen3-235B model (83.37%).
- Error Recovery: The model excelled in "Miss Func" and "Miss Param" scenarios, demonstrating a robust understanding of when to request user clarification rather than hallucinating tool calls.
Conclusion
EGPO demonstrates that integrating reasoning entropy into RL can significantly enhance tool-use capabilities in LLMs. While the strict binary reward is highly effective for the rigid syntax of function calling, future work may explore its applicability to domains requiring more nuanced feedback.
Summary updated