ChatPaper.aiChatPaper

TPTU-v2: Улучшение планирования задач и использования инструментов в агентах на основе больших языковых моделей для реальных систем

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

November 19, 2023
Авторы: 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

Аннотация

Крупные языковые модели (LLM) продемонстрировали способность решать задачи, требующие сочетания планирования задач и использования внешних инструментов, таких как API. Однако реальные сложные системы представляют три основные проблемы, связанные с планированием задач и использованием инструментов: (1) Реальная система обычно имеет огромное количество API, поэтому невозможно передать описания всех API в подсказку LLM из-за ограниченной длины токенов; (2) реальная система предназначена для выполнения сложных задач, и базовые LLM с трудом могут спланировать правильный порядок подзадач и вызовов API для таких задач; (3) Схожие семантика и функциональность API в реальных системах создают трудности как для LLM, так и даже для людей в их различении. В ответ на это данная статья представляет комплексную структуру, направленную на улучшение способностей LLM-агентов к планированию задач и использованию инструментов (TPTU) в реальных системах. Наша структура включает три ключевых компонента, предназначенных для решения этих проблем: (1) API Retriever выбирает наиболее подходящие API для задачи пользователя из обширного массива доступных; (2) LLM Finetuner настраивает базовую LLM, чтобы настроенная модель могла лучше справляться с планированием задач и вызовом API; (3) Demo Selector адаптивно извлекает различные демонстрации, связанные с трудноразличимыми API, которые далее используются для обучения в контексте с целью повышения итоговой производительности. Мы проверяем наши методы на реальной коммерческой системе, а также на открытом академическом наборе данных, и результаты явно демонстрируют эффективность каждого отдельного компонента, а также интегрированной структуры в целом.
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