Papers › A Syntax-Guided Edit Decoder for Neural Program Repair

A Syntax-Guided Edit Decoder for Neural Program Repair

15 Jun 2021arXiv:2106.08253archive 2025-07-28

Qihao Zhu, Zeyu Sun, Yuan-an Xiao, Wenjie Zhang, Kang Yuan, Yingfei Xiong, Lu Zhang

Automated Program Repair (APR) helps improve the efficiency of software development and maintenance. Recent APR techniques use deep learning, particularly the encoder-decoder architecture, to generate patches. Though existing DL-based APR approaches have proposed different encoder architectures, the decoder remains to be the standard one, which generates a sequence of tokens one by one to replace the faulty statement. This decoder has multiple limitations: 1) allowing to generate syntactically incorrect programs, 2) inefficiently representing small edits, and 3) not being able to generate project-specific identifiers. In this paper, we propose Recoder, a syntax-guided edit decoder with placeholder generation. Recoder is novel in multiple aspects: 1) Recoder generates edits rather than modified code, allowing efficient representation of small edits; 2) Recoder is syntax-guided, with the novel provider/decider architecture to ensure the syntactic correctness of the patched program and accurate generation; 3) Recoder generates placeholders that could be instantiated as project-specific identifiers later. We conduct experiments to evaluate Recoder on 395 bugs from Defects4J v1.2 and 420 additional bugs from Defects4J v2.0. Our results show that Recoder repairs 53 bugs on Defects4J v1.2, which achieves 21.4% improvement over the previous state-of-the-art approach for single-hunk bugs (TBar). Importantly, to our knowledge, Recoder is the first DL-based APR approach that has outperformed the traditional APR approaches on this dataset. Furthermore, Recoder also repairs 19 bugs on the additional bugs from Defects4J v2.0, which is 137.5% more than TBar (8 bugs) and 850% more than SimFix (2 bugs). This result suggests that Recoder has better generalizability than existing APR approaches.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2106.08253")

Code

Syntology Ran 4 of 14 code samples harvested from 1 repository linked to this paper; 10 have no recorded run. Of those that ran: 1 ran · violated contract; 3 ran · our draft was wrong.

By repository: community (archive-listed): 14 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

zysszy/TreeGen mentioned on GitHubtfMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested; 4 ran; 0 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
3ran · our draft was wrong
10unverified

Licence: 0 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from zysszy/TreeGen. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

J_findtheson_name zysszy/TreeGen/predict.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · a2a49f015c3f5c67 · report
J_isend zysszy/TreeGen/predict.py community (archive-listed) ran · violated contract fingerprinted MIT (permissive) · 8de998fbb776b7de · report
J_readlist zysszy/TreeGen/predict.py community (archive-listed) ran · our draft was wrong MIT (permissive) · b72343ca8c77e92f · report
tokenize_for_bleu_eval zysszy/TreeGen/HS-B/eval/ast2code.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 59002967d7c8c2a8 · report
adafactor_decay_rate_adam zysszy/TreeGen/code_generate_model.py community (archive-listed) unverified MIT (permissive) · 7e84c28ab94718a8 · report
adafactor_decay_rate_pow zysszy/TreeGen/code_generate_model.py community (archive-listed) unverified MIT (permissive) · 7a6613b9d1c8e6c8 · report
ast2code zysszy/TreeGen/HS-B/eval/ast2code.py community (archive-listed) unverified MIT (permissive) · 24b755519861ca11 · report
find_father zysszy/TreeGen/trans_train.py community (archive-listed) unverified MIT (permissive) · 994c6a4e3b0b1a8d · report
find_father_index zysszy/TreeGen/trans_train.py community (archive-listed) unverified MIT (permissive) · f328c6856bdf75bd · report
findtheson zysszy/TreeGen/HS-B/eval/ast2code.py community (archive-listed) unverified MIT (permissive) · 6e8a00ebcf2fefb6 · report
get_deepth zysszy/TreeGen/trans_train.py community (archive-listed) unverified MIT (permissive) · 300dc56067ea2eaa · report
line2vec zysszy/TreeGen/resolve_data.py community (archive-listed) unverified MIT (permissive) · cb13989862d23ffd · report
tqdm zysszy/TreeGen/resolve_data.py community (archive-listed) unverified MIT (permissive) · a76095adda7142a8 · report
word2vec zysszy/TreeGen/resolve_data.py community (archive-listed) unverified MIT (permissive) · 6c2f0ab41920ac28 · report

Tasks

Code CompletionCode GenerationDecoderProgram Repair

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Repair

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections