Large language models (LLMs) have demonstrated remarkable capabilities in function calling for autonomous agents, yet current mechanisms lack explicit reasoning transparency during parameter generation, particularly for complex functions with interdependent parameters. While existing approaches like chain-of-thought prompting operate at the agent level, they fail to provide fine-grained reasoning guidance for individual function parameters. To address these limitations, we propose Think-Augmented Function Calling (TAFC), a novel framework that enhances function calling accuracy through explicit reasoning at both function and parameter levels. Our method introduces a universal "think" parameter augmentation that enables models to articulate their decision-making process, with dynamic optimization for parameter descriptions to improve reasoning quality. For complex parameters, TAFC automatically triggers granular reasoning based on complexity scoring, ensuring appropriate justification for critical decisions. Additionally, we propose reasoning-guided optimization to align generated reasoning with human expectations. TAFC requires no architectural modifications to existing LLMs while maintaining full API compatibility. Evaluation on ToolBench across proprietary and open-source models demonstrates significant improvements in parameter generation accuracy and reasoning coherence for multi-parameter functions, while providing enhanced interpretability for debugging AI agent behaviors.
翻译:大语言模型在自主智能体的函数调用方面展现出卓越能力,但现有机制在参数生成过程中缺乏显式的推理透明度,尤其对于具有相互依赖参数的复杂函数。尽管思维链提示等现有方法在智能体层面运行,却无法为单个函数参数提供细粒度的推理指导。为突破这些局限,我们提出思维增强函数调用框架,该创新框架通过在函数和参数双层级实施显式推理来提升函数调用精度。我们的方法引入通用的“思维”参数增强机制,使模型能够阐明其决策过程,并通过参数描述的动态优化来提升推理质量。针对复杂参数,该框架基于复杂度评分自动触发细粒度推理,确保关键决策获得充分论证。此外,我们提出推理引导优化方法,使生成的推理过程与人类预期保持一致。该框架无需修改现有大语言模型架构,同时保持完整的应用程序接口兼容性。在ToolBench上对专有模型和开源模型的评估表明,该方法在多参数函数的参数生成准确性和推理连贯性方面取得显著提升,同时为调试人工智能智能体行为提供了更强的可解释性。