arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2606.15874cs.AIcs.SE
收藏

LLM即代码:面向Agent框架的编程范式

LLM-as-Code: Agentic Programming for Agent Harness

City University of Hong Kong(香港城市大学);Tencent Jarvis Lab(腾讯贾维斯实验室)

Junjia Qi, Zichuan Fu, Jingtong Gao, Wenlin Zhang, Hanyu Yan, Xian Wu, Xiangyu Zhao

AI总结:

针对LLM作为编排器导致控制流幻觉和不可靠执行的问题,提出Agentic Programming范式,由程序控制所有流程,LLM仅作为代码组件在需要推理或生成时被调用,显著提升长序列操作的稳定性。

摘要:

每个主要的LLM Agent框架都赋予LLM编排者的角色;模型决定下一步做什么、何时调用工具以及何时停止。我们认为,令牌爆炸、控制流幻觉和不可靠完成并非实现缺陷,而是将循环、分支和排序等确定性工作分配给概率系统的架构后果。更好的提示或更强的模型无法保证LLM Agent的可靠性。因此,我们提出Agentic Programming,其中程序控制所有流程,而LLM本身是其中的一部分,一个称为LLM-as-Code的自适应组件,仅在任务需要推理或生成时调用。在每个调用中,模型保持完全灵活性,但不能改变程序的执行路径。由于控制权在程序中,LLM的上下文由执行历史的调用树构建,形成有向无环图(DAG)。每个调用的上下文长度由其调用深度决定,而非随步骤累积。计算机使用Agent的案例研究表明,该设计不仅是理论立场,而且是实用的,显著提高了长视觉操作序列的稳定性。

英文摘要:

Every major LLM agent framework gives the LLM the role of orchestrator; the model decides what to do next, when to call tools, and when to stop. We argue that token explosion, control-flow hallucination, and unreliable completion are not implementation bugs but architectural consequences of assigning the deterministic work of looping, branching, and sequencing to a probabilistic system. A better prompt or a stronger model cannot guarantee the reliability of the LLM agent. We therefore propose Agentic Programming, in which the program governs all control flow, and the LLM is itself part of it, an adaptive component we call LLM-as-Code and invoke only where a task calls for reasoning or generation. Within each call the model keeps full flexibility, but it cannot alter the program's execution path. With control in the program, the LLM's context is built from the execution history's call tree and forms a directed acyclic graph (DAG). Each call's context length is then determined by its call depth rather than by accumulation over steps. A case study of computer-use agents shows that the design is practical, not just a theoretical stance, substantially improving the stability of long visual operation sequences.Code is available at https://github.com/FuzzyKuji/OpenProgram.

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

↑