Source-linked AI summary
TPTU: Large Language Model-based AI Agents for Task Planning and Tool Usage
Jingqing Ruan, Yihong Chen, Bin Zhang, Zhiwei Xu, Tianpeng Bao, Guoqing Du, Shiwei Shi, Hangyu Mao, Ziyue Li, Xingyu Zeng, Rui Zhao
TL;DR
Real-world tasks can require LLMs to plan and use external tools, beyond what generation alone may provide. The paper proposes a framework and two agent strategies to evaluate these abilities, finding substantial potential alongside recurring weaknesses in agent performance.
Problem
Real-world applications can require planning, tool manipulation, and user interaction beyond LLM task understanding alone.
Source: §1 · p. 2Method
The paper proposes a framework for evaluating LLM task planning and tool use, with one-step and sequential agents for inference.
Source: §1 · p. 2Results
The study reports significant potential for LLMs on complex tasks, alongside weaknesses in format compliance, grasping task requirements, tool selection, and summarization.
Source: §1 · p. 2Takeaways & Limitations
The authors conclude that LLM-based agents show potential for complex tasks while identifying areas that merit further investigation and improvement.
Source: §1 · p. 2, §5 · p. 16Agents may misinterpret task requirements, discompose subproblems incorrectly, or choose unsuitable tools.
Source: §3.4 · p. 14
Abstract
from arXiv · showhide
With recent advancements in natural language processing, Large Language Models (LLMs) have emerged as powerful tools for various real-world applications. Despite their prowess, the intrinsic generative abilities of LLMs may prove insufficient for handling complex tasks which necessitate a combination of task planning and the usage of external tools. In this paper, we first propose a structured framework tailored for LLM-based AI Agents and discuss the crucial capabilities necessary for tackling intricate problems. Within this framework, we design two distinct types of agents (i.e., one-step agent and sequential agent) to execute the inference process. Subsequently, we instantiate the framework using various LLMs and evaluate their Task Planning and Tool Usage (TPTU) abilities on typical tasks. By highlighting key findings and challenges, our goal is to provide a helpful resource for researchers and practitioners to leverage the power of LLMs in their AI applications. Our study emphasizes the substantial potential of these models, while also identifying areas that need more investigation and improvement.
1 Introduction
LLMs can handle varied and emerging tasks, but real-world applications requiring planning and external tools pose additional challenges. The paper proposes a framework and two agent designs to evaluate task planning and tool use, and reports both their potential and recurring weaknesses.
1 Introduction
- LLMs can perform tasks absent from their training data, an ability the paper calls “emerging,” including in few-shot and zero-shot settings.The cited introduction says these settings require minimal or no fine-tuning.Source: §1 · p. 2
- Real-world agent systems require more than task understanding: they may use tools and interact with users as central controllers or intermediaries.The introduction notes that tool instruction can help prevent hallucinations [5].Source: §1 · p. 2
- The paper proposes a structured framework for evaluating existing open-source LLMs’ task-planning and tool-usage abilities.It also discusses abilities needed by LLM-based agents.Source: §1 · p. 2
- The One-step Agent plans subtasks all at once, whereas the Sequential Agent produces them incrementally during inference.The paper presents these as two distinct strategies for conducting subtasks.Source: §1 · p. 2
- The study identifies four weaknesses in LLM-based agents: format failures, misunderstanding task requirements, overusing one tool, and poor summarization.The authors present these observations as areas needing further investigation and improvement.Source: §1 · p. 2
2 Method
The method frames LLM-based AI agents through a component-based architecture and a set of supporting abilities. It focuses on task planning and tool use through two inference strategies: planning all subtasks at once or generating them sequentially.
2 Method
- The paper notes that AI agents lack a standardized definition, and defines an AI Agent as a program using AI techniques for tasks typically requiring human-like intelligence.The broader definition also describes agents ranging from chatbots to autonomous systems that interact with environments and make decisions.Source: §2 · p. 3
2.1 Agent Framework
- The framework organizes an agent around task instructions, designed prompts, a tool set, an LLM, intermediate outputs, and a final answer.The tool set can include databases, APIs, specialized models, and non-AI resources.Source: §2.1 · p. 4
2.2 Agent Ability
- The described abilities cover perceiving instructions, planning subtasks, using or creating and executing tools, learning from feedback with memory, and summarizing results.The paper also mentions chain-of-thought and vector databases as techniques that can support these abilities.Source: §2.2 · pp. 4–5
2.3 Agent Design
- The One-step Agent plans all subtasks in one pass, while the Sequential Agent requests the next subtask after resolving the current one.The one-step approach may be less flexible for individual subtasks; the sequential approach supports incremental progress and feedback.Source: §2.3 · p. 5
3 Evaluation
The evaluation instantiates the framework’s two agent types with different LLMs and tests them on typical tasks. The supplied section passages describe the evaluation aim and scope, but do not report benchmark outcomes.
3 Evaluation
- The framework’s two agent types are instantiated with different LLMs and evaluated on typical tasks.Figure 3 describes their workflows as designed to assess task-planning and tool-usage abilities.Source: §3 · p. 5, Figure 3 · p. 6
- The paper states that combining the one-step and sequential strategies into a hierarchical agent is beyond its scope.Source: §3 · p. 5
- An illustrated task asks for the budget for five-year colleagues’ incentives, using an SQL generator followed by a Python generator.The SQL step identifies the colleague count; the Python step calculates 100 times that count.Source: §3 · p. 6
3.1 Preparations
The preparation section outlines the datasets, tools, and models used for evaluation, with the benchmark centered on SQL and Python tool use.
3.1.1 Datasets
- The extensible evaluation focuses on two repeatedly callable tools, SQL and Python, using 120 varied-complexity question-answer pairs to assess understanding, generation, and use.The authors chose this setup for simplicity and focus.Source: §3.1.1 · pp. 6–7
3.1.2 Tools
- The available-tool inventory contains 12 options, including SQL and Python generators.Source: §3.1.2 · p. 7
3.1.3 LLMs
- The evaluated set includes ChatGPT and Claude alongside Chinese-oriented models such as InternLM, Ziya, ChatGLM, and Chinese-Alpaca-Plus.Source: §3.1.3 · pp. 7–8
3.2 Evaluation on Task Planning Ability
The evaluation tests tool-order planning, adding subtask descriptions, pairing each tool with its subtask, and generating such pairs sequentially. It also examines whether agents avoid irrelevant tools.
3.2.1 TPTU-OA: Tool Order Planning
- Most agents could identify needed tools and task requirements, but Ziya and ChatGLM often misformatted lists while others sometimes misordered or omitted tools.The authors report that list-format parsing was generally not a major issue.Source: §3.2.1 · pp. 8–9, Table 3 · p. 8
3.2.2 TPTU-OA: Tool Order Planning and Subtask Description Generation
- Adding subtask descriptions to tool sequences significantly decreased accuracy for all evaluated LLMs.The authors hypothesize that whole-plan generation makes errors harder to debug, risks mismatching tools and subtasks, limits adjustments, and requires early global understanding.Source: §3.2.2 · p. 9, Table 4 · p. 9
3.2.3 TPTU-OA: The Planning of Tool-Subtask Pair
- 52.9% improvement was observed when tools and subtasks were generated as unified pairs rather than separately.The authors suggest close coupling between each tool and its subtask may explain the gain.Source: §3.2.3 · p. 10, Table 5 · p. 10
3.2.4 TPTU-OA: The Planning of Tool-Subtask Pair with Unrelated Tools
- With ten unrelated tools added, accuracy stayed unchanged or decreased only marginally, and agents consistently avoided selecting unrelated tools.The evaluation used an expanded prompt containing additional unrelated tools.Source: §3.2.4 · p. 10, Table 6 · p. 10
3.2.5 TPTU-SA: The Planning of Tool-Subtask Pair Generation
- TPTU-SA generally outperformed TPTU-OA, especially for high-performing LLMs.The authors suggest sequentiality, access to previous subtask outcomes, and opportunities to adjust plans may contribute to the pattern.Source: §3.2.5 · p. 11, Table 7 · p. 11
3.3 Evaluation on Tool Usage Ability
The section evaluates single-tool SQL and mathematical-code generation, then tests whether one-step and sequential agents can plan and use multiple tools end to end.
3.3.1 The effectiveness of Single Tool Usage
- The single-tool evaluation covers simple single-table SQL, complex nested SQL, and mathematical-code generation; the simple SQL results provide a basis for comparison.For nested SQL, the study compares direct-guidance and Chain-of-Thought prompts; for end-to-end tests, agents decompose complex questions and plan tools for subquestions.Source: §3.3.1 · pp. 11–12, §3.3 · p. 11
- Claude handled complex nested SQL robustly with direct and Chain-of-Thought prompts; ChatGLM favored Chain-of-Thought, while Ziya and InternLM performed worse with it.The evaluation contrasts direct guidance with step-by-step SQL generation using Chain-of-Thought.Source: §3.3.1 · p. 12, Table 9 · p. 12
- Mathematical-code results varied by model: ChatGPT, Claude, and InternLM performed strongly, while ChatGLM struggled and Alpaca showed proficiency despite poor SQL results.The paper concludes that model capabilities are task-dependent and recommends recognizing individual strengths and weaknesses when guiding models.Source: Table 10 · p. 13, §3.3.1 · p. 13
3.3.2 TPTU-OAand TPTU-SA: Tool Usage for Multiple Tools
- End-to-end multiple-tool testing was limited to four API-based models because the evaluation required automatic tool invocation through code.The tested models were ChatGPT, Ziya, Chinese-Alpaca, and InternLM.Source: §3.3.2 · p. 13
- 50% (ChatGPT), 15% (InternLM), and 0% (Ziya and Chinese-Alpaca) were the TPTU-OA performance rates; TPTU-SA reached 55% (ChatGPT), 20% (InternLM), and 0% (Ziya and Chinese-Alpaca-Plus).The authors describe the sequential-agent results as a slight overall improvement.Source: Table 11 · p. 13, §3.3.2 · pp. 13–14
3.4 Insightful Observations
The observations identify four recurring weaknesses in LLM-based agents: output-format errors, misunderstanding task requirements, overusing tools, and failing to synthesize subproblem results.
3.4 Insightful Observations
- LLMs can mismatch the number of tools and subtasks, causing formatting problems that hinder correct task execution.Figure 4 illustrates this inconsistency.Source: §3.4 · p. 14, Figure 4 · p. 14
- Agents may misdecompose a problem or choose an unsuitable tool, such as using SQL for a purely mathematical task.Figure 5 illustrates this issue.Source: §3.4 · p. 14, Figure 5 · p. 15
- Agents may overuse a tool and repeatedly solve the same subtask, producing extended and nonsensical plans.Figure 6 illustrates unnecessary repetition of subtasks.Source: §3.4 · p. 14, Figure 6 · p. 15
- Agents may ignore subproblem responses when composing the final answer, leaving part of the original query unanswered.Figure 7 depicts answering through common sense instead of generating code.Source: §3.4 · p. 14, Figure 7 · p. 15
4 Related Work
The related work reviews LLM-based tool use across physical and software environments, alongside efforts to have models create tools.
4.1 Tool Usage
- Earlier deep-learning tool methods were limited in understanding tool functions, user intent, and common-sense reasoning [27], while LLM capabilities and fine-tuning or in-context learning have supported more complex tool use [28] [29] [30] [31] [32] [33] [35] [37] [38] [39] [40] [41].The review also notes that tools can provide current information, mathematical computation, and potential hallucination mitigation [41].Source: §4.1 · pp. 15–16
- Embodied applications use LLMs to plan robot actions or generate executable code, while software-tool work spans APIs, search, navigation, and table analysis [45–87].Examples include Palm-E [50], Code as Policies, Toolformer [5], and TableGPT [71].Source: §4.1 · p. 16
5 Conclusion
The conclusion presents a structured framework and two agent designs for evaluating LLM-based agents’ task-planning and tool-usage abilities, and identifies both potential and areas for further work.
5 Conclusion
- The framework and two inference-agent designs support evaluation of current open-source LLMs’ task-planning and tool-usage capabilities.The paper describes the evaluation as yielding insights into their effectiveness.Source: §5 · p. 16
- The authors see substantial potential for LLMs in complex tasks but call for continued research and improvement.They frame real-world applications as a future prospect.Source: §5 · p. 17
A.1 Detailed Dataset Description
The dataset description distinguishes simple single-table SQL queries, complex nested SQL queries, and complex nested queries using multiple tools; the last type is selected to verify agents’ planning ability.
A.2 Detailed Dataset Description
- Simple SQL queries cover basic retrieval, filtering, grouping, and sorting operations on a single table.The described schemas are for Person and School.Source: §A.1 · p. 22, Table 12 · p. 23, Table 13
- Complex nested SQL queries use subqueries in clauses including SELECT, FROM, WHERE, and HAVING to perform operations or calculations across multiple tables.The described schemas are for GoldenMelodyAwards, AwardNominees, Singers, and RecordCompanies.Source: §A.1 · p. 22, Table 14 · p. 23, Table 15 · p. 23
- Complex nested queries involving SQL, Python code generation, and user-defined functions are selected to verify LLM-based agents’ planning ability.The described schemas are for the Journal and CoverPersonality tables.Source: §A.1 · p. 22, Table 18 · p. 23, Table 19 · p. 23
- A schema fragment lists id, name, info_985, and info_211 as TEXT fields.The fragment does not identify a table.Source: §A.1 · p. 23
A.2 Prompts Design
The prompts cover tool-order and tool-subtask planning, SQL and mathematical question evaluation, and the system prompts for one-step and sequential agents.
A.2 Prompts Design
- Figures 8–12 provide prompts for tool-order planning, tool-order and subtask-description planning, one-step tool-subtask pair planning, unrelated-tool variants, and TPTU-SA pair generation.The figures are evaluation prompts except Figure 12, which is for pair generation with TPTU-SA.Source: Figure 8 · p. 24, Figure 9 · p. 25, Figure 10 · p. 26
- Figures 13–16 provide evaluation prompts for simple SQL questions, complex nested SQL questions, CoT-based complex nested SQL questions, and mathematical questions.Source: Figure 13 · p. 29, Figure 14 · p. 30, Figure 15 · p. 31
- Figures 17 and 18 show the system prompts for the one-step agent and sequential agent, respectively.Source: Figure 17 · p. 33, Figure 18 · p. 34