arXiv:2607.01883cs.CL2026-07中稿 · ACL被引 1

用双智能体协作编程提升代码生成质量,让输出结果可验证。

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

论文配图:PairCoder++: Pair Programming as a Universal Paradigm for Verified Code-Driven Multimodal and Structured-Artifact Generation
图 1 · 摘自论文原文
  • 双智能体模仿结对编程:一个写代码,一个根据工具链反馈审查。
  • 在17个基准上显著提升可验证产出率,如Blender场景执行率从0.20升至0.78。
  • 适合需要高可靠性代码生成的场景,如图形、3D建模和硬件设计。

代码是大模型生成结构化成果(如图表、科学图像、矢量图、CAD模型、3D场景和硬件设计)的核心媒介。传统单次推理易出错,因模型无法感知编译器、渲染器或模拟器的反馈。本文提出PairCoder,通过双智能体结对编程实现验证驱动:驱动者编写代码,导航者依据诊断信息、执行结果与当前产物与目标的对比进行审查,若错误持续则角色互换。在17个公开基准及三个厂商的七款模型上,只要产物可验证,PairCoder均显著提升性能,且在完整官方指标体系下表现优异(如Blender场景可执行性从0.20升至0.78;TikZ编译率普遍提升10至30个百分点),代价为单模型的2.9至9.2倍(平均约7倍)。改进集中在工具链提供有效反馈且基线有提升空间时,而当反馈弱时表现持平或轻微下降。该方法证明结对编程是可靠验证代码生成的有效范式。

原文摘要 · Abstract (English)

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.

代码生成结对编程验证多模态

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