arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.01641cs.SE
收藏

当智能体不停止:揭示LLM智能体中的无限循环

When Agents Do Not Stop: Uncovering Infinite Agentic Loops in LLM Agents

Huazhong University of Science and Technology(华中科技大学)

Xinyi Hou, Shenao Wang, Yanjie Zhao, Haoyu Wang

AI总结:

提出IAL-Scan静态分析工具,通过抽象智能体代码为Agent IR并构建循环依赖图,检测LLM智能体项目中因反馈路径未有效约束导致的无限循环故障,在6549个仓库中达到91.9%精度。

摘要:

LLM智能体越来越依赖迭代执行,通过规划、工具使用、状态更新和智能体协作来解决问题。虽然这种设计实现了灵活的自动化,但也引入了一类新的故障:当反馈路径未有效约束时,智能体可能重复执行模型调用、工具、工作流转换或智能体交接。我们将此问题称为无限智能体循环(IALs)。IALs不是普通的编程循环;它们源于智能体逻辑、框架语义、运行时观察和终止机制之间的交互。此类故障可将单个请求放大为长时间运行的模型和工具执行,导致成本耗尽、模型拒绝服务、上下文增长以及重复的外部副作用。我们提出IAL-Scan,一种用于检测真实LLM智能体项目中IAL故障的静态分析工具。IAL-Scan将异构智能体代码抽象为框架无关的Agent IR,构建智能体循环依赖图(ALDG)以恢复显式和框架引入的反馈路径,并检查这些路径是否能无有效约束地重复到达代价高昂或状态增长的操作。我们在6,549个LLM智能体仓库上评估IAL-Scan。它报告了74个潜在发现,其中人工审查确认了47个项目中的68个IAL故障,达到了91.9%的精确率。

英文摘要:

LLM agents increasingly rely on iterative execution to solve tasks through planning, tool use, state updates, and agent collaboration. While this design enables flexible automation, it also creates a new class of failures: an agent may repeatedly execute model calls, tools, workflow transitions, or agent handoffs when the feedback path is not effectively bounded. We call this problem Infinite Agentic Loops (IALs). IALs are not ordinary programming loops; they arise from the interaction between agent logic, framework semantics, runtime observations, and termination mechanisms. Such failures can amplify a single request into long running model and tool execution, causing cost exhaustion, model denial of service, context growth, and repeated external side effects. We propose IAL-Scan, a static analysis tool for detecting IAL failures in real-world LLM agent projects. IAL-Scan abstracts heterogeneous agent code into a framework independent Agent IR, builds an Agentic Loop Dependence Graph (ALDG) to recover explicit and framework induced feedback paths, and checks whether these paths can repeatedly reach costly or state growing operations without an effective bound. We evaluate IAL-Scan on 6,549 LLM agent repositories. It reports 74 potential findings, among which manual review confirms 68 IAL failures across 47 projects, achieving 91.9% precision.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑