Planning is a crucial task for agents in task oriented dialogs (TODs). Human agents typically resolve user issues by following predefined workflows, decomposing workflow steps into actionable items, and performing actions by executing APIs in order; all of which require reasoning and planning. With the recent advances in LLMs, there have been increasing attempts to use them for task planning and API usage. However, the faithfulness of the plans to predefined workflows and API dependencies, is not guaranteed with LLMs. Moreover, workflows in real life are often custom-defined and prone to changes; hence, adaptation is desirable. To study this, we propose the problem of faithful planning in TODs that needs to resolve user intents by following predefined flows and preserving API dependencies. To solve this problem, we propose FLAP, a Flow-Adhering Planning algorithm based on constrained decoding with lookahead heuristic for LLMs. Our algorithm alleviates the need for finetuning LLMs using domain specific (plan/dependency) data, enables quick adaptation to predefined flows, and outperforms other decoding and prompting-based baselines. Further, our algorithm empowers smaller LLMs (7B) to perform at par larger LLMs (30B-40B).
翻译:规划是面向任务对话系统中智能体的关键任务。人类智能体通常通过遵循预定义工作流、将工作流步骤分解为可执行操作项、并按顺序调用API执行操作来解决用户问题——这些过程均涉及推理与规划。随着大语言模型的最新进展,越来越多研究尝试将其用于任务规划与API调用。然而,大语言模型生成的规划方案无法保证对预定义工作流和API依赖关系的忠实遵循。此外,现实场景中的工作流常为定制化设计且易发生变更,因此需要具备快速适配能力。针对这一问题,我们提出面向任务对话系统中的忠实规划任务,该任务要求通过遵循预定义流程并保持API依赖关系来解析用户意图。为解决该问题,我们提出FLAP算法——一种基于前瞻启发式约束解码的流程遵循规划算法。该算法无需使用领域特定(规划/依赖关系)数据对大语言模型进行微调,可快速适配预定义工作流,并在多个基线方法(包括其他解码策略与提示学习方法)中取得更优表现。进一步地,我们的算法使小型大语言模型(7B参数)能够达到与大型大语言模型(30B-40B参数)相当的性能水平。