让智能体既守规矩又灵活应对意外问题
FlowAgent: Achieving Compliance and Flexibility for Workflow Agents
- 用自然语言与代码结合的流程描述语言,定义可执行的工作流
- 在三个数据集上同时实现流程合规与意外查询处理,效果优于传统方法
- 适合需要高可靠性与自适应能力的自动化系统开发
将工作流与大语言模型(LLM)结合,使基于LLM的智能体能执行预定义流程,提升现实应用中的自动化水平。传统基于规则的方法限制了LLM的灵活性,因预设执行路径会压缩模型的动作空间,尤其在遇到非预期的离域查询(OOW)时表现不佳。而基于提示的方法虽赋予LLM完全控制权,却可能导致流程合规性下降。为此,我们提出FlowAgent,一种兼顾合规与灵活性的新型智能体框架。我们设计了程序描述语言(PDL),融合自然语言的适应性与代码的精确性来表述工作流。基于PDL,构建了一个完整框架,使LLM能有效处理OOW查询,同时由一组控制器监督执行路径。此外,我们提出新的评估方法,严格测试智能体应对OOW场景的能力,超越现有基准仅关注常规流程合规性的局限。在三个数据集上的实验表明,FlowAgent不仅严格遵守工作流,还能有效处理离域查询,展现出在合规与灵活性上的双重优势。代码已开源:https://github.com/Lightblues/FlowAgent。
原文摘要 · Abstract (English)
The integration of workflows with large language models (LLMs) enables LLM-based agents to execute predefined procedures, enhancing automation in real-world applications. Traditional rule-based methods tend to limit the inherent flexibility of LLMs, as their predefined execution paths restrict the models' action space, particularly when the unexpected, out-of-workflow (OOW) queries are encountered. Conversely, prompt-based methods allow LLMs to fully control the flow, which can lead to diminished enforcement of procedural compliance. To address these challenges, we introduce FlowAgent, a novel agent framework designed to maintain both compliance and flexibility. We propose the Procedure Description Language (PDL), which combines the adaptability of natural language with the precision of code to formulate workflows. Building on PDL, we develop a comprehensive framework that empowers LLMs to manage OOW queries effectively, while keeping the execution path under the supervision of a set of controllers. Additionally, we present a new evaluation methodology to rigorously assess an LLM agent's ability to handle OOW scenarios, going beyond routine flow compliance tested in existing benchmarks. Experiments on three datasets demonstrate that FlowAgent not only adheres to workflows but also effectively manages OOW queries, highlighting its dual strengths in compliance and flexibility. The code is available at https://github.com/Lightblues/FlowAgent.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。