PairCoder++: Pair Programming as a Universal Paradigm for Verified Code-Driven Multimodal and Structured-Artifact Generation

📄 arXiv: 2607.01883 📥 PDF

作者: Junhao Chen, Xiang Li, Mingjin Chen, Boran Zhang, Henghaofan Zhang, Yibin Xu, Yuehan Cui, Fangsheng Weng, Fei Ma, Qi Tian, Ruqi Huang, Hao Zhao

分类: cs.CL

发布日期: 2026-07-05


💡 一句话要点

提出PairCoder以解决代码驱动生成的验证问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码生成 双代理对编程 验证机制 结构化工件 工具链

📋 核心要点

  1. 现有方法在生成结构化工件时,单次推理的脆弱性导致生成结果的可靠性不足。
  2. 论文提出PairCoder,通过双代理对编程的方式,结合工具链进行验证,提高生成工件的准确性。
  3. 在17个基准测试中,PairCoder显著提升了可验证工件的执行率,表现出2.9到9.2倍的成本效益。

📝 摘要(中文)

代码是大型语言模型生成结构化工件的媒介:图表、科学图形、矢量图形、CAD模型、3D场景和硬件设计均通过编写程序生成。在这种情况下,单次推理的脆弱性在于编译器、渲染器或模拟器对模型的不可见性。我们提出了PairCoder,通过双代理对编程的方式实现工具链的验证:一个Driver代理编写程序,另一个Navigator代理根据验证证据(诊断、执行结果和当前工件的渲染与目标对比)进行审查,并在错误持续时交换角色。在17个公共基准和来自三家供应商的七个模型上,PairCoder在几乎所有可验证工件的基准上都有显著提升,执行率从0.20提高到0.78,TikZ编译率在每个模型上提高了10到30个百分点,整体成本约为单模型的2.9到9.2倍。改进主要集中在工具链提供信息性预言的地方,而基线留有提升空间;在预言较弱的情况下,方法表现持平或轻微下降。我们将对编程框架视为可靠的验证代码驱动生成的方案。

🔬 方法详解

问题定义:论文要解决的问题是如何提高代码驱动生成的结构化工件的可靠性。现有方法在生成过程中缺乏对编译器和渲染器的有效验证,导致生成结果的脆弱性和不确定性。

核心思路:论文的核心思路是通过双代理对编程的方式,利用Driver代理编写程序,Navigator代理进行审查和验证,从而实现对生成过程的有效控制和反馈。这样的设计使得生成过程更具交互性和可靠性。

技术框架:整体架构包括两个主要模块:Driver代理负责代码编写,Navigator代理负责代码审查和验证。两者在发现错误时可以互换角色,形成闭环反馈机制。

关键创新:最重要的技术创新点在于将对编程视为一种有效的验证机制,通过双代理的协作提高了生成工件的准确性和可靠性。这与现有方法的单一推理模式形成鲜明对比。

关键设计:在实现中,关键设计包括对代理角色的明确分工、验证证据的有效利用(如诊断信息和执行结果),以及在错误发生时的角色互换机制。这些设计确保了生成过程的高效性和准确性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,PairCoder在17个公共基准测试中显著提升了可验证工件的执行率,例如Blender场景的可执行性从0.20提高到0.78,TikZ编译率在每个模型上提高了10到30个百分点,整体成本效益提升至2.9到9.2倍。

🎯 应用场景

该研究的潜在应用领域包括软件开发、自动化设计、科学计算等多个领域。通过提高代码驱动生成的可靠性,PairCoder能够在实际应用中减少错误,提高生产效率,具有广泛的实际价值和未来影响。

📄 摘要(原文)

Code is the medium through which large language models generate structured artifacts: charts, scientific figures, vector graphics, CAD models, 3D scenes, and hardware designs are all produced by writing programs. In this regime single pass inference is brittle, because the compiler, renderer, or simulator that decides whether the artifact exists is invisible to the model. We present PairCoder, which grounds review in the toolchain and realizes it as two agent pair programming: a Driver agent writes the program, a Navigator agent reviews it against verification evidence (diagnostics, execution results, and renderings of the current artifact beside the target), and the two switch roles when errors persist. Across 17 public benchmarks and seven models from three vendors, PairCoder improves essentially every benchmark whose artifact is verifiable, on full official metric suites rather than execution alone (for example, Blender scene executability 0.20 to 0.78; TikZ compile rate up 10 to 30 points on every model), at 2.9 to 9.2 times single model cost (about 7 times overall). The improvements concentrate where the toolchain provides an informative oracle and the baseline leaves headroom, and the method ties or mildly regresses where the oracle is weak; we frame pair programming as a reliable recipe for verified code driven generation.