API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMs

TL;DR

API-Bank benchmark evaluates tool-augmented LLMs with 73 APIs, boosting tool utilization by training and testing models like Lynx, GPT-3.5, GPT-4.

cs.CL 🔴 Advanced 2023-04-14 69 views
Minghao Li Yingxiu Zhao Bowen Yu Feifan Song Hangyu Li Haiyang Yu Zhoujun Li Fei Huang Yongbin Li
LLM API benchmark tool augmentation deep learning

Key Findings

Methodology

Constructed a runnable evaluation system with 73 APIs, annotating 314 dialogues with 753 calls. Developed a training set of 1888 dialogues across 1000 domains using multi-agent data generation, fine-tuning Lynx from Alpaca. Evaluated GPT-3.5, GPT-4, and Lynx, analyzing capabilities in planning, retrieval, and calling, with error analysis revealing bottlenecks.

Key Results

  • GPT-3.5 improved API call accuracy to ~60%, significantly better than GPT-3, but still lagging in planning/retrieval. Lynx outperformed Alpaca by 26 points, approaching GPT-3.5. GPT-4 achieved over 70% accuracy in multi-API tasks, demonstrating strong planning and coordination. The models show promising generalization but face challenges in complex multi-step scenarios.
  • Performance varies across domains and task complexity. Error analysis highlights issues in API selection, parameter passing, and multi-API coordination, guiding future improvements.
  • The benchmark provides a comprehensive, realistic evaluation framework, advancing research in tool-augmented language models.

Significance

This work fills a critical gap by providing a standardized, detailed benchmark for tool utilization in LLMs, fostering progress toward models capable of dynamic, real-world task execution. It bridges theoretical research and practical deployment, enabling systematic improvements in AI's ability to leverage external tools for up-to-date information, complex reasoning, and multi-step workflows.

Technical Contribution

Introduces API-Bank, a comprehensive benchmark covering diverse domains and capabilities. Uses multi-agent systems for automatic data generation, reducing annotation costs by 98%. Trains Lynx, a model with enhanced tool usage, validated through extensive experiments. Provides detailed metrics for call accuracy, retrieval, and planning, setting new standards for evaluation of tool-augmented LLMs.

Novelty

First to create a large-scale, multi-domain, multi-capability benchmark integrating real API calls, multi-turn dialogues, and automated data generation. Combines evaluation and training in a unified framework, pushing forward the frontier of tool-augmented AI. The multi-agent data synthesis approach is particularly innovative, enabling scalable, high-quality dataset creation.

Limitations

  • Models still struggle with multi-API coordination and complex multi-step reasoning, leading to errors in API selection and parameter passing. The training data, while large, may lack domain-specific depth, limiting performance in specialized fields. The static evaluation environment does not fully capture real-time, dynamic scenarios, such as live web data or user interaction feedback. Future work should focus on adaptive learning, environment modeling, and expanding API diversity to address these issues.

Future Work

Future directions include integrating reinforcement learning to optimize API call strategies, expanding API pools for broader coverage, and developing dynamic evaluation environments that simulate real-time data updates. Enhancing multi-API coordination and reasoning capabilities remains a priority, alongside user-centric feedback mechanisms for continuous improvement.

AI Executive Summary

In recent years, large language models (LLMs) such as GPT-3, Codex, ChatGPT, and GPT-4 have demonstrated remarkable capabilities in natural language understanding and generation. However, their reliance on static training data limits their ability to access up-to-date information and perform complex multi-step tasks. To address this, researchers have explored tool augmentation—enabling models to invoke external APIs and tools to extend their functionalities.

Despite promising developments, evaluating and improving models’ tool utilization remains challenging. Existing benchmarks are limited in scope, often focusing on narrow tasks or lacking real API integration. Recognizing this gap, the authors introduce API-Bank, a comprehensive benchmark designed to systematically assess and enhance the tool-using capabilities of LLMs. The benchmark includes 73 real-world APIs, covering diverse domains such as weather, database operations, and AI services, forming a realistic environment for evaluation.

To construct a robust evaluation system, the authors manually implemented the APIs and annotated 314 dialogues with 753 API calls, capturing models’ abilities in planning, retrieval, and calling. Simultaneously, they developed a large-scale training dataset of 1888 dialogues across 1000 domains using a novel multi-agent approach, which automates data generation and reduces annotation costs by 98%. This dataset was used to fine-tune Lynx, a model based on Alpaca-7B, significantly improving its tool utilization performance.

Experimental results demonstrate that GPT-3.5 achieves about 60% accuracy in API calls, while GPT-4 surpasses 70%, especially excelling in multi-API planning and coordination tasks. Lynx improves over Alpaca by 26 points, approaching GPT-3.5 performance, validating the effectiveness of the training approach. Error analysis reveals key bottlenecks in API selection, parameter passing, and multi-API orchestration, guiding future research.

This work establishes a new standard for evaluating tool-augmented LLMs, with broad implications for deploying AI in real-world applications such as intelligent assistants, automated customer service, and dynamic information retrieval. The authors highlight ongoing challenges, including handling complex multi-step workflows and dynamic environments, and propose future directions involving reinforcement learning, environment modeling, and API pool expansion. Overall, API-Bank marks a significant step toward more capable, adaptable, and practical AI systems.

Deep Analysis

Background

Recent advances in LLMs like GPT-3, Codex, and GPT-4 have revolutionized NLP, enabling tasks from conversation to code generation. Despite these breakthroughs, models are limited by static training data, which quickly becomes outdated. External tools, such as search engines and APIs, have been integrated to supplement knowledge, exemplified by systems like WebGPT and ReAct. However, existing evaluation frameworks lack comprehensive, real-world scenarios that test models' ability to plan, retrieve, and call diverse APIs across domains. This gap hampers progress in tool-augmented AI, restricting deployment in dynamic, multi-task environments.

Core Problem

The core challenge is the absence of a unified, realistic benchmark to evaluate models' tool utilization capabilities systematically. Current models show inconsistent performance in API calling, often failing in multi-step, multi-API tasks due to poor planning, retrieval errors, and coordination issues. This limits their practical application in complex workflows like automated customer support, personalized assistants, and real-time data retrieval. Developing a benchmark that reflects real-world complexities and provides actionable insights is crucial for advancing the field.

Innovation

This paper introduces several innovations: 1) A comprehensive, executable evaluation system with 73 APIs covering multiple domains, enabling real-time assessment of API call, retrieval, and planning abilities. 2) A multi-agent data generation framework that automates the creation of high-quality training data, reducing annotation costs by 98%. 3) Training of Lynx, a model based on Alpaca-7B, with improved tool utilization capabilities. 4) A detailed analysis of model performance across different abilities and scenarios, highlighting bottlenecks and guiding future research. These innovations collectively push the frontier of tool-augmented LLM research, offering scalable evaluation and training solutions.

Methodology

  • �� Constructed a real API system with 73 APIs, covering weather, database, AI services, etc. • Manually implemented APIs, establishing databases and static information for reproducibility. • Annotated 314 dialogues with 753 API calls, covering call, retrieval, and planning tasks. • Developed a multi-agent system: • Agent 1 generates domains (health, finance, etc.). • Agent 2 creates APIs based on domain info. • Agent 3 selects APIs and abilities, generating user queries. • Agent 4 simulates API calls and responses, ensuring correctness. • Agent 5 tests data quality, discarding invalid samples. • Fine-tuned Lynx on 1888 dialogues, evaluated on a separate test set. • Compared models like GPT-3, GPT-3.5, GPT-4, and Lynx across various tasks, measuring accuracy and response quality.

Experiments

The evaluation involved testing GPT-3, GPT-3.5, GPT-4, ChatGLM-6B, Alpaca-7B, and Lynx on the API-Bank benchmark. Metrics included API call accuracy, retrieval success, and response ROUGE-L scores. Experiments covered three task types: single API call, multiple API calls, and combined planning-retrieval-calling. Hyperparameters: batch size 256, learning rate 2e-5, trained Lynx for three epochs. Results showed GPT-3.5 and GPT-4 outperform smaller models, with GPT-4 achieving over 70% in multi-API tasks. Ablation studies confirmed the importance of training data quality and multi-agent generation. Error analysis identified bottlenecks in API selection, parameter passing, and multi-API orchestration, guiding future improvements.

Results

GPT-3.5's API call accuracy reached 60%, a substantial improvement over GPT-3's near-zero performance. Lynx, trained on the new dataset, improved by 26 points over Alpaca-7B, approaching GPT-3.5 levels. GPT-4 achieved over 70% accuracy in multi-API tasks, demonstrating strong planning and coordination. Error analysis revealed that models struggle with API selection, especially in large API pools, and with multi-step reasoning. These results validate the effectiveness of the benchmark and training approach, highlighting key areas for future research to close remaining gaps.

Applications

The benchmark enables systematic evaluation of models for real-world applications like intelligent virtual assistants, automated customer service, and dynamic data retrieval systems. Models trained with API-Bank can better handle complex multi-step workflows, improving user experience and operational efficiency. The framework also supports continuous improvement through iterative training and feedback, fostering AI systems that adapt to evolving needs and environments.

Limitations & Outlook

Models still face challenges in multi-API coordination, especially in complex, multi-step tasks requiring precise parameter passing. The training data, although large, may lack sufficient coverage of niche domains, limiting performance in specialized fields. The static evaluation environment does not fully simulate real-time, dynamic scenarios such as live web data or user interactions. Future work should focus on adaptive learning, environment modeling, and expanding API diversity to address these issues.

Plain Language Accessible to non-experts

想象你在厨房做饭,你需要用各种调料(API)来完成一道菜。有些调料很常用(少量API),只需要用一次(单次调用);有些菜需要多次调料(多API调用),比如先放盐再放酱油。你得知道哪些调料(检索)以及怎么用(调用),还要安排好顺序(规划)。如果调料很多(大API池),你就得先找到合适的调料(检索),然后一步步用(调用)。模型就像这个厨师,学习怎么找到调料、用对方法,才能做出好菜。API-Bank就像厨房指南,帮厨师练习,告诉他怎么找到调料、用得正确,让他变成厨房高手!

ELI14 Explained like you're 14

想象你在厨房里做饭,你需要用各种调料和工具。有时候,只用一种调料就能搞定(API调用),比如加点盐。有时候一道菜需要多种调料,比如先放胡椒,再放酱油(多API调用)。你得先知道需要哪些调料(检索),然后按顺序用(调用),还要确保每一步都正确。模型就像个厨师,要学会找调料、用对方法,才能做出美味的菜。API-Bank就像厨房指南,帮你练习怎么找到调料、用得正确,让你变成厨房高手!

Glossary

API (Application Programming Interface)

一种软件接口,允许不同程序之间通信。

模型调用外部工具时使用的接口。

工具增强 (Tool-Augmentation)

通过外部工具提升模型能力的方法。

本文中的核心概念,用于改善模型的实际应用表现。

多智能体 (Multi-agent)

多个AI协作生成数据或完成任务的系统。

用于自动生成训练数据,降低标注成本。

API调用准确率 (API Call Accuracy)

模型正确调用API的比例。

评估模型工具利用能力的重要指标。

ROUGE-L

衡量文本生成质量的指标,关注最长公共子序列。

用于评估模型生成响应的质量。

Open Questions Unanswered questions from this research

  • 1 如何进一步提升模型在极端复杂任务中的API协调能力仍未解决。
  • 2 动态环境中实时信息更新和API调用的鲁棒性不足。
  • 3 大规模API池下的检索效率和准确性仍需优化。

Applications

Immediate Applications

智能助手

基于API-Bank训练的模型能更准确地调用工具,提升智能客服和个人助理的效率。

Long-term Vision

自动化系统

未来模型能自主规划多步骤任务,广泛应用于自动驾驶、工业自动化等领域,推动智能化升级。

Abstract

Recent research has demonstrated that Large Language Models (LLMs) can enhance their capabilities by utilizing external tools. However, three pivotal questions remain unanswered: (1) How effective are current LLMs in utilizing tools? (2) How can we enhance LLMs' ability to utilize tools? (3) What obstacles need to be overcome to leverage tools? To address these questions, we introduce API-Bank, a groundbreaking benchmark, specifically designed for tool-augmented LLMs. For the first question, we develop a runnable evaluation system consisting of 73 API tools. We annotate 314 tool-use dialogues with 753 API calls to assess the existing LLMs' capabilities in planning, retrieving, and calling APIs. For the second question, we construct a comprehensive training set containing 1,888 tool-use dialogues from 2,138 APIs spanning 1,000 distinct domains. Using this dataset, we train Lynx, a tool-augmented LLM initialized from Alpaca. Experimental results demonstrate that GPT-3.5 exhibits improved tool utilization compared to GPT-3, while GPT-4 excels in planning. However, there is still significant potential for further improvement. Moreover, Lynx surpasses Alpaca's tool utilization performance by more than 26 pts and approaches the effectiveness of GPT-3.5. Through error analysis, we highlight the key challenges for future research in this field to answer the third question.

cs.CL cs.AI