mlsanityData to 7 Oct 2026

Evaluating LLMs on Sequential API Call Through Automated Test Generation

arXiv 2507.09481 ↗First posted 13 Jul 2025cs.SE cs.AI cs.CLcited by 2

On the map: LLM agents and tool use → Tool learning and function calling

Abstract (arXiv)

By integrating tools from external APIs, Large Language Models (LLMs) have expanded their promising capabilities in a diverse spectrum of complex real-world tasks. However, testing, evaluation, and analysis of LLM tool use remain in their early stages. Most existing benchmarks rely on manually collected test cases, many of which cannot be automatically checked for semantic correctness and instead depend on static methods such as string matching. Additionally, these benchmarks often overlook the complex interactions that occur between sequential API calls, which are common in real-world applications. To fill the gap, in this paper, we introduce StateGen, an automated framework designed to generate diverse coding tasks involving sequential API interactions. StateGen combines state-machine-based API constraint solving and validation, energy-based sampling, and control-flow injection to generate executable programs. These programs are then translated into human-like natural language task descriptions through a collaboration of two LLM agents. Utilizing StateGen, we construct StateEval, a benchmark encompassing 120 verified test cases spanning across three representative scenarios: Session Service, Tensor Operation, and ElevenLabs MCP. Experimental results confirm that StateGen can effectively generate challenging and realistic API-oriented tasks, highlighting areas for improvement in current LLMs incorporating APIs.We make our framework and benchmark publicly available to support future research.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Tool learning and function calling, one of 16 directions in LLM agents and tool use. Builds on 42 of its 73 references that are in the map. First posted on arXiv 13 Jul 2025.

Builds on

42 of 73 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024NESTFUL: A Benchmark for Evaluating LLMs on Nested Sequences of API Calls4 Sep
  2. 2023MetaTool Benchmark for Large Language Models: Deciding Whether to Use Tools and Which to Use4 Oct
  3. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs31 Jul
  4. 2023Gorilla: Large Language Model Connected with Massive APIs24 May
  5. 2023API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMs14 Apr
  6. 2023Toolformer: Language Models Can Teach Themselves to Use Tools9 Feb

Other references · 36

  1. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  7. 2023A Survey on Large Language Model based Autonomous Agentscited by 2,203
  8. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  9. 2023A Survey on Evaluation of Large Language Modelscited by 1,227
  10. 2024Qwen2.5-Coder Technical Reportcited by 1,151
  11. 2024A Survey on Large Language Models for Code Generationcited by 646
  12. 2023A Comprehensive Overview of Large Language Modelscited by 639
24 more
  1. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
  2. 2023Identifying the Risks of LM Agents with an LM-Emulated Sandboxcited by 514
  3. 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agentscited by 476
  4. 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 450
  5. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  6. 2022Few-shot training LLMs for project-specific code-summarizationcited by 128
  7. 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
  8. 2024Planning, Creation, Usage: Benchmarking LLMs for Comprehensive Tool Utilization in Real-World Complex Scenarioscited by 85
  9. 2024HumanEval-XL: A Multilingual Code Generation Benchmark for Cross-lingual Natural Language Generalizationcited by 84
  10. 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
  11. 2023Can ChatGPT replace StackOverflow? A Study on Robustness and Reliability of Large Language Model Code Generationcited by 72
  12. 2024StateFlow: Enhancing LLM Task-Solving through State-Driven Workflowscited by 65
  13. 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
  14. 2024ShortcutsBench: A Large-Scale Real-world Benchmark for API-based Agentscited by 36
  15. 2022NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilerscited by 29
  16. 2022Automated Test Generation for REST APIs: No Time to Rest Yetcited by 13
  17. 2022Testing RESTful APIs: A Surveycited by 11
  18. 2022Morest: Model-based RESTful API Testing with Execution Feedbackcited by 10
  19. 2023Private-Library-Oriented Code Generation with Large Language Modelscited by 10
  20. 2024A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputscited by 9
  21. 2023Adaptive REST API Testing with Reinforcement Learningcited by 7
  22. 2024KAT: Dependency-aware Automated API Testing with Large Language Modelscited by 6
  23. 2025LlamaRestTest: Effective REST API Testing with Small Language Modelscited by 4
  24. 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Modelscited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Harnessing LLMs for API Interactions: A Framework for Classification and Synthetic Data Generation
  2. 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancement
  3. 2025A Framework for Testing and Adapting REST APIs as LLM Tools
  4. 2026When LLMs Lag Behind: Knowledge Conflicts from Evolving APIs in Code Generation
  5. 2025Rethinking Testing for LLM Applications: Characteristics, Challenges, and a Lightweight Interaction Protocol
  6. 2025Live API-Bench: 2500+ Live APIs for Testing Multi-Step Tool Calling
  7. 2026LLMs taking shortcuts in test generation: A study with SAP HANA and LevelDB
  8. 2025Challenges in Testing Large Language Model Based Software: A Faceted Taxonomy