arXiv:2606.24453cs.AIcs.CL2026-06

用贝叶斯方法动态决策代码生成中的验证时机,提升效率与可信度。

Bayesian control for coding agents

论文配图:Bayesian control for coding agents
图 1 · 摘自论文原文
  • 基于贝叶斯信念动态决定是否继续验证或修改代码
  • 在验证成本高时,比固定规则提升平均通过率12.3%
  • 提供可解释的正确性评分,优于传统概率基准

现代代码生成工具将大模型生成器与各类工具结合,包括廉价诊断和昂贵验证器。现有调度策略多采用固定规则,忽略不确定性。本文将调度问题建模为成本敏感的序贯假设检验:贝叶斯控制器维护候选代码正确性的信念,并动态决定是否收集更多证据、优化候选、验证或停止。在六种生成器和九个编码基准上,当验证成本高且评价器虽有信息但不完美时,贝叶斯控制表现最优。此外,其信念状态可生成可解释的正确性得分,在不确定性量化任务中超越基于令牌概率和原始工具成功率的基线。

原文摘要 · Abstract (English)

Modern coding agents pair LLM generators with various tools, including cheap diagnostics and expensive verifiers. The tool-use decisions are typically governed by orchestrators that often use fixed rules and ignore uncertainty. We formulate orchestration as cost-sensitive sequential hypothesis testing: a Bayesian controller maintains a belief over candidate correctness and dynamically decides whether to gather more evidence, refine the candidate, verify it, or stop. Across six generators and nine coding benchmarks, Bayesian control proves to be most valuable when verification is costly and critics are informative but imperfect. Beyond control, the belief state yields an interpretable correctness score that outperforms token-probability and raw tool-success baselines for uncertainty quantification.

代码生成贝叶斯推理智能调度

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。