为生产大语言模型代理选择和组合运行时架构模式的方法
A Methodology for Selecting and Composing Runtime Architecture Patterns for Production LLM Agents
AI总结:
本文提出了一种方法,用于选择和组合运行时架构模式,以定义大语言模型代理的随机-确定性边界,并探讨其在不同代理类型中的应用及可靠性分解。
摘要:
生产大语言模型代理结合了随机模型输出与确定性软件系统,但两者之间的边界很少被视为首要的架构对象。本文将此边界称为随机-确定性边界(SDB):一种四部分合同,涉及提议者、验证者、提交步骤和拒绝信号,规定了LLM输出如何成为系统动作。我们主张SDB是生产代理运行时的承载基础。围绕此基础,我们将代理运行时设计分为三个关注点:协调、状态和控制。我们提出了六个运行时模式的目录,这些模式在对话、自主和长周期代理中以不同的方式组合SDB:分层委托、散射-收集加 saga、事件驱动序列、共享状态机、监督者加门控,以及人机交互。对于每个模式,我们追溯其分布式系统概念的根源,并确定当工作者为随机时的变化。本文贡献了五步选择运行时模式的方法,一个将生产故障映射到模式弱点的诊断程序,以及一种称为回放分歧的故障模式,在这种模式下,基于LLM的确定性事件日志消费者在模型版本或提示变化下会产生不同的下游输出。一种简化的可靠性分解将每次调用的模型方差与架构动量分开,促使主张随着模型方差的减少,模式选择和SDB强度成为长期可靠性的越来越重要的杠杆。我们应用该方法于五个工作负载,并提供了一个90天合同续约代理的可运行参考实现。
英文摘要:
Production LLM agents combine stochastic model outputs with deterministic software systems, yet the boundary between the two is rarely treated as a first-class architectural object. This paper names that boundary the stochastic-deterministic boundary (SDB): a four-part contract among a proposer, verifier, commit step, and reject signal that specifies how an LLM output becomes a system action. We argue that the SDB is the load-bearing primitive of production agent runtimes. Around this primitive, we organize agent runtime design into three concerns: Coordination, State, and Control. We present a catalog of six runtime patterns that compose the SDB differently across conversational, autonomous, and long-horizon agents: hierarchical delegation, scatter-gather plus saga, event-driven sequencing, shared state machine, supervisor plus gate, and human in the loop. For each pattern, we trace its lineage to distributed-systems concepts and identify what changes when the worker is stochastic. The paper contributes a five-step methodology for selecting runtime patterns, a diagnostic procedure that maps production failures to pattern weaknesses, and a failure mode called replay divergence, in which LLM-based consumers of a deterministic event log produce different downstream outputs under model-version or prompt changes. A stylized reliability decomposition separates per-call model variance from architectural momentum, motivating the claim that as model variance decreases, pattern choice and SDB strength become increasingly important levers for long-run reliability. We apply the methodology to five workloads and provide one runnable reference implementation for a 90-day contract-renewal agent.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。