arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.04056cs.SEcs.MAcs.PL
收藏

Token Budgets: 63个LLM-Agent预算超支事件的实证目录,以及一个仿射类型化Rust缓解案例研究

Token Budgets: An Empirical Catalog of 63 LLM-Agent Budget-Overrun Incidents, with an Affine-Typed Rust Mitigation as a Case Study

University of the West of England(西英格兰大学)

Sajjad Khan

AI总结:

通过分析21个编排框架中的63个生产事故,提出一个八类故障分类法,并构建一个基于仿射类型的Rust库(token-budgets)来在编译时防止预算超支,实验证明其不可绕过性。

摘要:

LLM-agent预算超支是一个已记录的生产故障类别:单个重试循环可能在操作员注意到之前花费数千美元,而防止这种情况发生的进程内完整性属性(无别名、无双重支出、无委托后使用成本承载值)即使有,也是由临时包装器而非类型系统强制执行的。我们的核心贡献是实证性的:一个包含来自21个编排框架(2023-2026年)的63个已确认生产事故的目录,每个事故都有引用的GitHub问题,并在有报告时附上美元损失,组织成一个八类故障分类法(评估者间Cohen's kappa = 0.837,N = 113),外加47个补充结构条目。作为针对该分类法评估的一种缓解措施,我们构建了token-budgets,一个1,180行的Rust crate(无unsafe),它操作化仿射所有权,使得克隆、双重支出或在委托后使用预算成为编译错误,而不是操作员必须记住避免的运行时风险。美元上限是估计器假设下的运行时算术;仿射层使该算术不可绕过。在单代理工作负载上,一个4行Python计数器与crate在0/30超调上匹配,因此区别价值在于多代理委托中操作员错误下的不可绕过性:在11个事故中记录的委托扇出竞争在编译时被借用检查器拒绝,而相同的模式在asyncio下超调30/30,三种严格替代方案超调0/30。在五个运行时、三个提供商和一个温度分层的实时API测试(N = 160)中,该方法报告零上限违规和零错误拒绝,与并发工作操作持平。静态过度预留为4-6倍(自适应2.11倍)。运行二进制文件上的二进制级上限健全性留待解决。

英文摘要:

LLM-agent budget overruns are a documented production failure class: a single retry loop can spend thousands of dollars before an operator notices, and the in-process integrity properties that would prevent it (no aliasing, no double-spend, no use-after-delegation of a cost-bearing value) are enforced, if at all, by ad-hoc wrappers rather than by the type system. Our central contribution is empirical: a catalog of 63 confirmed production incidents from 21 orchestration frameworks (2023-2026), each backed by a quoted GitHub issue and, where reported, a dollar loss, organized into an eight-cluster failure taxonomy (inter-rater Cohen's kappa = 0.837, N = 113), plus 47 supplementary structural entries. As one mitigation evaluated against this taxonomy, we build token-budgets, an 1,180-line Rust crate (no unsafe) that operationalizes affine ownership so that cloning, double-spending, or using a budget after delegating it are compile errors rather than runtime hazards an operator must remember to avoid. The dollar cap is runtime arithmetic under an estimator assumption; the affine layer makes that arithmetic non-bypassable. On single-agent workloads a 4-line Python counter matches the crate at 0/30 overshoot, so the distinguishing value is non-bypassability under operator error in multi-agent delegation: the delegation-fanout race documented in 11 incidents is rejected by the borrow checker at compile time, while the same pattern under asyncio overshoots 30/30 and three disciplined alternatives overshoot 0/30. Across five runtimes, three providers, and a temperature-stratified live-API test (N = 160), the approach reports zero cap violations and zero false refusals, at operational parity with concurrent work. Static over-reservation is 4-6x (2.11x adaptive). Binary-level cap-soundness on the running binary is left open.

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

↑