ChatPaper.aiChatPaper

TPTU-v2: Aprimorando o Planejamento de Tarefas e o Uso de Ferramentas em Agentes Baseados em Modelos de Linguagem de Grande Escala em Sistemas do Mundo Real

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

November 19, 2023
Autores: Yilun Kong, Jingqing Ruan, Yihong Chen, Bin Zhang, Tianpeng Bao, Shiwei Shi, Guoqing Du, Xiaoru Hu, Hangyu Mao, Ziyue Li, Xingyu Zeng, Rui Zhao
cs.AI

Resumo

Modelos de Linguagem de Grande Escala (LLMs) demonstraram proficiência na resolução de tarefas que exigem uma combinação de planejamento de tarefas e o uso de ferramentas externas, como APIs. No entanto, sistemas complexos do mundo real apresentam três desafios prevalentes em relação ao planejamento de tarefas e ao uso de ferramentas: (1) O sistema real geralmente possui uma vasta gama de APIs, tornando impossível fornecer as descrições de todas as APIs no prompt dos LLMs, já que o comprimento dos tokens é limitado; (2) o sistema real é projetado para lidar com tarefas complexas, e os LLMs básicos dificilmente conseguem planejar uma ordem correta de subtarefas e chamadas de API para tais tarefas; (3) Semânticas e funcionalidades semelhantes entre as APIs em sistemas reais criam desafios tanto para os LLMs quanto até mesmo para humanos em distingui-las. Em resposta, este artigo introduz um framework abrangente voltado para aprimorar as habilidades de Planejamento de Tarefas e Uso de Ferramentas (TPTU) de agentes baseados em LLMs que operam em sistemas do mundo real. Nosso framework compreende três componentes principais projetados para abordar esses desafios: (1) o API Retriever seleciona as APIs mais pertinentes para a tarefa do usuário entre a extensa gama disponível; (2) o LLM Finetuner ajusta um LLM básico para que o LLM ajustado seja mais capaz de planejar tarefas e chamar APIs; (3) o Demo Selector recupera adaptativamente diferentes demonstrações relacionadas a APIs difíceis de distinguir, que são posteriormente usadas para aprendizado em contexto para impulsionar o desempenho final. Validamos nossos métodos utilizando um sistema comercial do mundo real, bem como um conjunto de dados acadêmico de código aberto, e os resultados demonstram claramente a eficácia de cada componente individual, bem como do framework integrado.
English
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.
PDF82December 15, 2024