[论文解读] Identifying the Risks of LM Agents with an LM-Emulated Sandbox
该论文提出 ToolEmu,一种通过语言模型模拟的沙箱环境,可实现对语言模型智能体在多种工具和故障场景下的可扩展、自动化测试。通过使用语言模型模拟工具执行,并利用基于语言模型的评估器评估风险,该框架识别出68.8%的故障为现实世界中有效的故障,揭示即使是最安全的智能体在高风险条件下仍会失败23.9%的时间。
Recent advances in Language Model (LM) agents and tool use, exemplified by applications like ChatGPT Plugins, enable a rich set of capabilities but also amplify potential risks - such as leaking private data or causing financial losses. Identifying these risks is labor-intensive, necessitating implementing the tools, setting up the environment for each test scenario manually, and finding risky cases. As tools and agents become more complex, the high cost of testing these agents will make it increasingly difficult to find high-stakes, long-tailed risks. To address these challenges, we introduce ToolEmu: a framework that uses an LM to emulate tool execution and enables the testing of LM agents against a diverse range of tools and scenarios, without manual instantiation. Alongside the emulator, we develop an LM-based automatic safety evaluator that examines agent failures and quantifies associated risks. We test both the tool emulator and evaluator through human evaluation and find that 68.8% of failures identified with ToolEmu would be valid real-world agent failures. Using our curated initial benchmark consisting of 36 high-stakes tools and 144 test cases, we provide a quantitative risk analysis of current LM agents and identify numerous failures with potentially severe outcomes. Notably, even the safest LM agent exhibits such failures 23.9% of the time according to our evaluator, underscoring the need to develop safer LM agents for real-world deployment.
研究动机与目标
- 为解决手动测试语言模型智能体在现实世界风险时成本高昂且可扩展性有限的问题。
- 实现在无需完整工具实现或沙箱环境的情况下,检测语言模型智能体中长尾、高影响的故障。
- 开发一种自动化的、基于语言模型的安全评估器,量化在模拟场景中智能体故障带来的风险。
- 展示使用语言模型模拟复杂工具(例如终端、物联网、机器人)进行风险评估的可行性和有效性。
提出的方法
- 使用大型语言模型(例如 GPT-4)仅基于工具规范和输入来模拟工具执行,无需实际部署工具。
- 设计一个支持多样化工具(包括未来可集成的工具如物联网和机器人)的基于语言模型的沙箱环境,实现快速原型设计和故障注入。
- 实现一个对抗性模拟器,可自动生成高风险沙箱状态,以在红队测试场景中提升故障检测能力。
- 开发一个基于语言模型的安全评估器,分析智能体轨迹,识别故障,并使用经人工验证的标准量化相关风险。
- 通过人工评估验证检测到的故障的真实性,与现实世界中的智能体故障达成68.8%的一致性。
- 整理一个包含36个高风险工具包和144个测试用例的基准,以支持对当前语言模型智能体的定量风险分析。
实验结果
研究问题
- RQ1基于语言模型的模拟器是否能有效模拟多样化、高风险的工具(例如终端、金融、物联网)而无需实际实现这些工具?
- RQ2与真实世界执行相比,基于语言模型的沙箱在识别语言模型智能体中现实存在的、高影响的故障方面有多有效?
- RQ3基于语言模型的安全评估器在多大程度上能准确检测并量化长尾场景中智能体故障带来的风险?
- RQ4在现实、对抗性条件下测试时,当前语言模型智能体中严重故障的普遍程度如何?
- RQ5该框架能否检测到既罕见又高影响的故障,特别是在金融和机器人等安全关键领域?
主要发现
- 通过人工评估验证,ToolEmu 识别出的68.8%的故障为现实世界中有效的故障,表明其故障检测具有极强的真实性。
- 即使在本研究中评估的最安全的语言模型智能体,也在23.9%的测试用例中表现出故障,凸显了在真实环境中部署时持续存在的风险。
- 该框架在终端模拟器上检测到 ChatGPT-3.5 的7起严重故障,其中6起可在真实 bash 终端中复现,证明了其高度的仿真保真度。
- 对抗性模拟器成功生成了高风险场景,触发了智能体的故障,显著提升了边缘情况的检测能力。
- 基于语言模型的安全评估器效率极高——在15分钟内检测到复杂故障,而真实环境中手动设置需耗时8小时。
- 包含36个工具包和144个测试用例的基准揭示了在金融、邮件和机器人控制任务等多样化领域中系统性漏洞的存在。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。