Formal-LLM: Integrating Formal Language and Natural Language for Controllable LLM-based Agents

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Li, Zelong, Hua, Wenyue, Wang, Hao, Zhu, He, Zhang, Yongfeng
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866914910014799872
author Li, Zelong
Hua, Wenyue
Wang, Hao
Zhu, He
Zhang, Yongfeng
author_facet Li, Zelong
Hua, Wenyue
Wang, Hao
Zhu, He
Zhang, Yongfeng
contents Recent advancements on Large Language Models (LLMs) enable AI Agents to automatically generate and execute multi-step plans to solve complex tasks. However, since LLM's content generation process is hardly controllable, current LLM-based agents frequently generate invalid or non-executable plans, which jeopardizes the performance of the generated plans and corrupts users' trust in LLM-based agents. In response, this paper proposes a novel "Formal-LLM" framework for LLM-based agents by integrating the expressiveness of natural language and the precision of formal language. Specifically, the framework allows agent developers to express their requirements or constraints for the planning process as an automaton. A stack-based LLM plan generation process is then conducted under the supervision of the automaton to ensure that the generated plan satisfies the constraints, making the planning process controllable. We conduct experiments on both benchmark tasks and practical real-life tasks, and our framework achieves over 50% overall performance increase, which validates the feasibility and effectiveness of employing Formal-LLM to guide the plan generation of agents, preventing the agents from generating invalid and unsuccessful plans. Further, more controllable LLM-based agents can facilitate the broader utilization of LLM in application scenarios where high validity of planning is essential. The source code of this work is available at https://github.com/agiresearch/Formal-LLM.
format Preprint
id arxiv_https___arxiv_org_abs_2402_00798
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Formal-LLM: Integrating Formal Language and Natural Language for Controllable LLM-based Agents
Li, Zelong
Hua, Wenyue
Wang, Hao
Zhu, He
Zhang, Yongfeng
Machine Learning
Artificial Intelligence
Computation and Language
Formal Languages and Automata Theory
Recent advancements on Large Language Models (LLMs) enable AI Agents to automatically generate and execute multi-step plans to solve complex tasks. However, since LLM's content generation process is hardly controllable, current LLM-based agents frequently generate invalid or non-executable plans, which jeopardizes the performance of the generated plans and corrupts users' trust in LLM-based agents. In response, this paper proposes a novel "Formal-LLM" framework for LLM-based agents by integrating the expressiveness of natural language and the precision of formal language. Specifically, the framework allows agent developers to express their requirements or constraints for the planning process as an automaton. A stack-based LLM plan generation process is then conducted under the supervision of the automaton to ensure that the generated plan satisfies the constraints, making the planning process controllable. We conduct experiments on both benchmark tasks and practical real-life tasks, and our framework achieves over 50% overall performance increase, which validates the feasibility and effectiveness of employing Formal-LLM to guide the plan generation of agents, preventing the agents from generating invalid and unsuccessful plans. Further, more controllable LLM-based agents can facilitate the broader utilization of LLM in application scenarios where high validity of planning is essential. The source code of this work is available at https://github.com/agiresearch/Formal-LLM.
title Formal-LLM: Integrating Formal Language and Natural Language for Controllable LLM-based Agents
topic Machine Learning
Artificial Intelligence
Computation and Language
Formal Languages and Automata Theory
url https://arxiv.org/abs/2402.00798