MENTOR:面向使用工具的大语言模型智能体的程序式防护
MENTOR: Procedural Shielding of Tool-Using LLM Agents
AI总结:
MENTOR是一种新型程序式防护框架,通过多步骤自动形式化流程生成依赖历史的运行时防护,可提升使用工具的LLM智能体的合规性,使轻量级开源LLM的合规性超过未防护的专有模型,还能降低重复工作流的部署成本。
摘要:
使用工具的大语言模型(LLM)智能体正越来越多地被用于自动化受程序手册约束的工作流,例如公司预订差旅或采购硬件的规则。这些手册是为人类编写的自然语言文本,描述了这类复杂工作流的通用要求。确保LLM智能体遵守这些手册的要求颇具难度,现有技术要么使用LLM评判器,要么使用手动编写的规则,在运行时局部禁止有问题的工具调用。但这并不足够,原因有二:其一,仅阻止工具调用会让智能体不知道如何朝着完成任务的正确方向推进;其二,可能导致智能体行为过于保守,因为工具调用仅在特定情境下存在问题。为克服这些挑战,我们提出了MENTOR,它额外为智能体提供指导,使其能在任务中推进符合程序要求的进展,且确保这种合规性具有情境感知能力。我们通过多步骤自动形式化流程从程序手册中生成一种新型的依赖历史的运行时防护,以此实现上述目标。MENTOR的核心采用基于博弈的技术,确保智能体在面对运行时不确定性时的鲁棒性,同时不过度限制其行为。这形成了一种用于LLM智能体程序式防护的形式化辅助框架,其合规性远超现有方法。具体而言,MENTOR使受防护的轻量级开源LLM的合规性超过了未受防护的专有模型。由于防护器针对每份手册仅合成一次,之后可服务于所有任务,因此受MENTOR防护的智能体成为重复执行工作流的可行选择,当离线构建成本分摊到重复任务中时,有望降低部署成本。
英文摘要:
Tool-using LLM agents are increasingly used to automate workflows governed by procedural manuals, such as company rules for booking travel or procuring hardware. These manuals are written in natural language for humans and describe general requirements over such complex workflows. Ensuring compliance of LLM agents with these manuals is difficult, and state-of-the-art techniques use either LLM judges or manually written rules to forbid problematic tool-calls locally at runtime. This is insufficient because (i) only blocking tool calls keeps the agent clueless about how to make correct progress towards fulfilling its task, and (ii) can lead to overly conservative behavior of the agent, as tool calls might only be problematic in certain contexts. To overcome these challenges, we introduce MENTOR, which (i) additionally provides guidance for the agent to make procedural-compliant progress on the task, and (ii) ensures that this compliance is context-aware. We achieve these goals by building a novel history-dependent runtime shield that is obtained from the procedural manual via a multi-step autoformalization pipeline. At its core, MENTOR utilizes a game-based technique to ensure robustness against runtime uncertainty without over-resticting agents' behavior. This yields a formally assisted framework for procedural shielding of LLM agents that improves compliance well beyond existing methods. In particular, MENTOR lifts the compliance of shielded light-weight open-source LLMs above that of non-shielded proprietary models. Since a shield is synthesized once per manual and then serves every task, a MENTOR-shielded agent becomes a viable choice for repeatedly executed workflows, potentially reducing deployment costs when the offline construction cost is amortized over repeated tasks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。