[论文解读] Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis
该论文提出 SED,一种神经程序合成框架,通过整合合成、执行与迭代调试来提升程序正确性。通过利用执行轨迹和神经调试器对候选程序进行迭代修复,SED 显著降低了 Karel 基准上的错误率,优于基础合成器和标准束搜索解码方法。
The use of deep learning techniques has achieved significant progress for program synthesis from input-output examples. However, when the program semantics become more complex, it still remains a challenge to synthesize programs that are consistent with the specification. In this work, we propose SED, a neural program generation framework that incorporates synthesis, execution, and debugging stages. Instead of purely relying on the neural program synthesizer to generate the final program, SED first produces initial programs using the neural program synthesizer component, then utilizes a neural program debugger to iteratively repair the generated programs. The integration of the debugger component enables SED to modify the programs based on the execution results and specification, which resembles the coding process of human programmers. On Karel, a challenging input-output program synthesis benchmark, SED reduces the error rate of the neural program synthesizer itself by a considerable margin, and outperforms the standard beam search for decoding.
研究动机与目标
- 为解决当神经合成器因语义复杂性而失败时,从输入-输出示例中合成正确程序的挑战。
- 通过引入基于执行反馈纠正错误程序的调试阶段,提升程序合成性能。
- 将程序修复建模为一种类似于人类调试的迭代过程,以增强鲁棒性与泛化能力。
- 证明神经调试器可显著提升基础合成器的性能,即使合成器已使用束搜索或贪婪解码。
提出的方法
- SED 首先使用在输入-输出示例上训练的神经程序合成器生成候选程序。
- 每个候选程序都会被执行,以生成执行轨迹,为调试提供语义反馈。
- 神经调试器组件会选择最有希望的程序,并基于执行结果和规范约束应用编辑操作。
- 调试器在多步中迭代修改程序,同时利用语法结构和语义执行轨迹来引导修复。
- 该框架采用两阶段训练方案,以缓解调试器监督预训练期间的程序别名问题。
- 该方法在 Karel 基准上进行了评估,结果优于基础合成器和束搜索解码策略。
实验结果
研究问题
- RQ1由执行轨迹引导的迭代程序修复能否在直接合成之外进一步提升神经程序合成性能?
- RQ2将神经调试器集成到程序合成器中,对复杂输入-输出基准上的错误率有何影响?
- RQ3调试器利用语义执行轨迹的能力是否能带来优于纯语法或启发式方法的修复效果?
- RQ4当合成器已使用搜索或执行反馈时,SED 框架能否优于标准解码策略(如束搜索)?
- RQ5调试器在多大程度上能从与真实答案语法上相距较远的程序中恢复?
主要发现
- 在 Karel 基准上,SED 显著降低了基础神经程序合成器的错误率。
- 即使合成器使用贪婪解码(仅生成一个候选程序),SED 在最终正确性方面仍优于束搜索解码。
- 神经调试器的集成显著提升了性能,表明调试是合成的有力补充。
- 两阶段训练方案有效缓解了程序别名问题,使模型在分布偏移下仍具备强大泛化能力。
- 该框架在不同基础合成器模型选择下均提升了性能,表明其具有广泛适用性。
- 执行轨迹对调试器识别并修复语义错误至关重要,尤其在包含循环的程序中,部分执行结果具有歧义性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。