ComplexFuncBench: Exploring Multi-Step and Constrained Function Calling under Long-Context Scenario

Lucen Zhong, Zhengxiao Du, Xiaohan Zhang, Haiyi Hu, Jie TangarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have demonstrated impressive capabilities in tool use, yet most evaluations focus on "simple" function calling—executing a single API call with explicit parameters. In real-world scenarios, user requests are often multi-layered and constrained, requiring models to reason across multiple steps, handle implicit constraints, and extract information from massive contexts. To address this, we introduce ComplexFuncBench, a benchmark designed to evaluate LLMs in these high-complexity environments.

An example of a complex function calling query requiring multi-step reasoning and long-context extraction.

The Challenge of Complex Function Calling

Current benchmarks often overestimate the "agentic" capabilities of LLMs. Real-world tasks, such as travel planning, involve dependencies where the output of one function (e.g., flight arrival time) serves as the input for another (e.g., taxi pickup time). Furthermore, users frequently use natural language constraints like "the day before Christmas," which the model must translate into specific ISO dates.

The complexity is compounded by the "long-context" nature of modern APIs. A single flight search might return hundreds of options, resulting in a context length of up to 128k tokens. Models must not only find the "needle in the haystack" but also precisely extract long, unique identifiers (tokens or slugs) to pass to subsequent functions.

Methodology

The ComplexFuncBench Dataset

The dataset comprises 1,000 samples across five domains: Hotels, Flights, Attractions, Car Rental, and Taxi. It was developed through a three-stage pipeline:

  1. Coarse Generation: Initial queries were generated using GPT-4o.
  2. Fine-grained Annotation: Human experts corrected errors, resolved API response ambiguities, and established the "shortest path" for function calls.
  3. Generalization: 100 high-quality templates were expanded into 1,000 diverse samples.

On average, each sample requires 3.26 reasoning steps and 5.07 individual function calls.

ComplexEval: A Robust Evaluation Framework

Traditional exact-match metrics are insufficient for complex tasks where multiple valid paths or synonymous parameter values (e.g., "NY" vs. "New York") exist. ComplexEval introduces a multi-dimensional matching approach:

  • Rule-based Matching: For exact string or numeric matches.
  • Response-based Matching: Verifying if different calls produce identical API results.
  • LLM-based Matching: Utilizing GPT-4o to judge semantic equivalence.
  • Hungarian Mapping: Aligning predicted calls with reference calls to ensure fair scoring of multi-step sequences.

Experimental Results and Insights

The researchers evaluated 12 prominent models, including GPT-4o, Claude 3.5 Sonnet, and the Qwen and Llama series. The results reveal a significant performance gap even among top-tier models.

Performance Leaders

Claude 3.5 Sonnet and GPT-4o led the evaluation with success rates of 61.0% and 60.5%, respectively. While these models are highly capable, a 40% failure rate underscores the difficulty of the benchmark. Among open-source models, Qwen2.5-72B performed best at 40.1%, while Llama-3.1-405B struggled significantly, achieving only a 4.0% success rate due to parameter hallucinations.

The "Value Error" Bottleneck

A key finding is that models rarely fail by calling the wrong function; instead, they fail by passing incorrect values.

Distribution of error types across leading models, highlighting the prevalence of value errors.

As shown in the error analysis, "value errors"—such as hallucinating dates or failing to extract specific tokens from long contexts—account for the vast majority of failures. For Qwen2.5-72B, nearly 79% of errors were value-related.

Efficiency and Context Handling

Models often take "scenic routes," averaging more steps than the annotated shortest path. Furthermore, the study highlights that supporting a 128k context window does not guarantee the ability to reason within it. Models frequently failed to retrieve specific identifiers from large API responses, suggesting that long-context reasoning remains a major hurdle for agentic workflows.

Conclusion

ComplexFuncBench exposes the limitations of current LLMs in handling sophisticated, real-world tool use. The prevalence of value errors and the struggle with long-context extraction indicate that future research should focus on improving parameter reasoning and robust data extraction rather than just increasing context window sizes. Improving a model's ability to self-correct after receiving API format errors will also be crucial for building truly reliable AI agents.

Summary updated

BibTeX
@misc{zhong2025complexfuncbench,
  author = {Lucen Zhong and Zhengxiao Du and Xiaohan Zhang and Haiyi Hu and Jie Tang},
  title = {{ComplexFuncBench: Exploring Multi-Step and Constrained Function Calling under Long-Context Scenario}},
  year = {2025},
  eprint = {2501.10132},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.10132},
}
Figure