Skip to main content
QUICK REVIEW

[Paper Review] TPTU-v2: Boosting Task Planning and Tool Usage of Large Language Model-based Agents in Real-world Systems

Yilun Kong, Jingqing Ruan|arXiv (Cornell University)|Nov 19, 2023
Topic ModelingComputer Science7 citations
TL;DR

The paper introduces a three-component framework (API Retriever, LLM Finetuner, Demo Selector) to improve task planning and API usage for LLM-based agents in real-world systems, validated on real commercial data and ToolBench.

ABSTRACT

Large Language Models (LLMs) have demonstrated proficiency in addressing tasks that necessitate a combination of task planning and the usage of external tools that require a blend of task planning and the utilization of external tools, such as APIs. However, real-world complex systems present three prevalent challenges concerning task planning and tool usage: (1) The real system usually has a vast array of APIs, so it is impossible to feed the descriptions of all APIs to the prompt of LLMs as the token length is limited; (2) the real system is designed for handling complex tasks, and the base LLMs can hardly plan a correct sub-task order and API-calling order for such tasks; (3) Similar semantics and functionalities among APIs in real systems create challenges for both LLMs and even humans in distinguishing between them. In response, this paper introduces a comprehensive framework aimed at enhancing the Task Planning and Tool Usage (TPTU) abilities of LLM-based agents operating within real-world systems. Our framework comprises three key components designed to address these challenges: (1) the API Retriever selects the most pertinent APIs for the user task among the extensive array available; (2) LLM Finetuner tunes a base LLM so that the finetuned LLM can be more capable for task planning and API calling; (3) the Demo Selector adaptively retrieves different demonstrations related to hard-to-distinguish APIs, which is further used for in-context learning to boost the final performance. We validate our methods using a real-world commercial system as well as an open-sourced academic dataset, and the outcomes clearly showcase the efficacy of each individual component as well as the integrated framework.

Motivation & Objective

  • Identify practical challenges for LLM-based agents in real-world systems (vast API sets, complex task/API sequencing, and API similarity).
  • Propose a three-component framework to address these challenges: API Retriever, LLM Finetuner, and Demo Selector.
  • Demonstrate the effectiveness of each component and the integrated framework in real-world and open-source datasets.

Proposed method

  • API Retriever selects the most relevant APIs from a large API collection using semantic embeddings and a dual-stream SBERT training with Multiple Negatives Ranking Loss.
  • LLM Finetuner performs supervised fine-tuning on carefully constructed datasets to enhance task planning and API calling in real-world contexts.
  • Demo Selector dynamically retrieves demonstrations (subtask-level or API-level) based on embedding similarity to improve in-context learning and differentiate similar APIs.
  • Training data for the API Retriever relies on instruction-API pairs and a hybrid human/LLM annotation process.
  • Fine-tuning datasets include Training Set v1 (real-world distribution), Training Set v2 (prompt functionality with feature lists), and Training Set v3 (diverse prompts and multi-step API interactions).
  • The Demo Selector uses embeddings from a Knowledge Database and API Collection to fetch top-k demonstrations or falls back to API-level demos when needed.

Experimental results

Research questions

  • RQ1How effectively can API retrieval improve API relevance for task planning in large API ecosystems?
  • RQ2Does fine-tuning an LLM on domain-specific data boost task planning and API calling accuracy?
  • RQ3Can adaptive demo retrieval help the model distinguish between semantically similar APIs and improve final task completion?

Key findings

  • API Retriever achieves Recall@5 of 84.64% and Recall@10 of 98.47% in the real-world scenario.
  • Execution accuracy with base LLM evolves from 38.89% (no demos) to 43.33% with API retriever, to 95.55% with the Demo Selector, and to 80% with finetuned LLM + API retriever, reaching 96.67% with all components.
  • In the open-source scenario, base LLM achieves 76.67% execution accuracy; API Retriever alone drops to 53.3% due to complexity, while finetuned LLM + API retriever reaches 86.7%.
  • The highest real-world performance (96.67%) results from combining finetuned LLM, API retriever, and Demo Selector, highlighting the value of integrated components.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.