Skip to main content
QUICK REVIEW

[Paper Review] Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis

Kavi Gupta, Peter Ebert Christensen|arXiv (Cornell University)|Jul 16, 2020
Software Testing and Debugging TechniquesComputer Science30 references12 citations
TL;DR

This paper proposes SED, a neural program synthesis framework that integrates synthesis, execution, and iterative debugging to improve program correctness. By leveraging execution traces and a neural debugger to iteratively repair candidate programs, SED reduces error rates significantly on the Karel benchmark, outperforming both the base synthesizer and standard beam search decoding.

ABSTRACT

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.

Motivation & Objective

  • To address the challenge of synthesizing correct programs from input-output examples when neural synthesizers fail due to semantic complexity.
  • To improve program synthesis performance by incorporating a debugging phase that corrects incorrect programs using execution feedback.
  • To model program repair as an iterative process resembling human debugging, enhancing robustness and generalization.
  • To demonstrate that a neural debugger can significantly boost the performance of a base synthesizer, even when the synthesizer uses beam search or greedy decoding.

Proposed method

  • SED first generates candidate programs using a neural program synthesizer trained on input-output examples.
  • Each candidate program is executed to produce execution traces, which provide semantic feedback for debugging.
  • A neural debugger component selects the most promising program and applies editing operations based on execution results and specification constraints.
  • The debugger iteratively modifies programs over multiple steps, using both syntactic structure and semantic execution traces to guide repairs.
  • The framework employs a two-stage training scheme to mitigate program aliasing issues during supervised pretraining of the debugger.
  • The method is evaluated on the Karel benchmark, where it improves over both the base synthesizer and beam search decoding strategies.

Experimental results

Research questions

  • RQ1Can iterative program repair guided by execution traces improve neural program synthesis performance beyond direct synthesis?
  • RQ2How does integrating a neural debugger affect the error rate of a program synthesizer on complex input-output benchmarks?
  • RQ3Does the debugger’s ability to leverage semantic execution traces lead to better repair outcomes than purely syntactic or heuristic methods?
  • RQ4Can the SED framework outperform standard decoding strategies like beam search when the synthesizer is already using search or execution feedback?
  • RQ5To what extent can the debugger recover from programs that are syntactically distant from the ground truth?

Key findings

  • SED reduces the error rate of the base neural program synthesizer by a considerable margin on the Karel benchmark.
  • Even when the synthesizer uses greedy decoding (producing only one candidate), SED outperforms beam search decoding in terms of final correctness.
  • The integration of the neural debugger significantly boosts performance, demonstrating that debugging is a valuable complement to synthesis.
  • The two-stage training scheme effectively mitigates the program aliasing problem, enabling strong generalization despite distributional shifts.
  • The framework improves performance across different choices of the underlying synthesizer model, indicating broad applicability.
  • Execution traces are crucial for the debugger to identify and fix semantic errors, especially in loop-containing programs where partial execution is ambiguous.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.