{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-syntax-guided-edit-decoder-for-neural","title":"A Syntax-Guided Edit Decoder for Neural Program Repair","arxiv_id":"2106.08253","date":"2021-06-15","proceeding":null,"authors":["Qihao Zhu","Zeyu Sun","Yuan-an Xiao","Wenjie Zhang","Kang Yuan","Yingfei Xiong","Lu Zhang"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2106.08253v6","url_pdf":"https://arxiv.org/pdf/2106.08253v6.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"a-syntax-guided-edit-decoder-for-neural","repo_url":"https://github.com/zysszy/TreeGen","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"code-completion","task_name":"Code Completion"},{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"program-repair","task_name":"Program Repair"}],"methods":[{"method_slug":"repair","method_name":"Repair"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.08253","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.08253"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zysszy/TreeGen","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran_violates":1,"unverified":10},"by_repo_kind":{"listed":{"samples":14,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"a2a49f015c3f5c67","entry":"J_findtheson_name","repo":"zysszy/TreeGen","repo_kind":"listed","path":"predict.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/predict.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a2a49f015c3f5c67"}},{"code_sha256_prefix":"8de998fbb776b7de","entry":"J_isend","repo":"zysszy/TreeGen","repo_kind":"listed","path":"predict.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/predict.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8de998fbb776b7de"}},{"code_sha256_prefix":"b72343ca8c77e92f","entry":"J_readlist","repo":"zysszy/TreeGen","repo_kind":"listed","path":"predict.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/predict.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b72343ca8c77e92f"}},{"code_sha256_prefix":"59002967d7c8c2a8","entry":"tokenize_for_bleu_eval","repo":"zysszy/TreeGen","repo_kind":"listed","path":"HS-B/eval/ast2code.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/HS-B/eval/ast2code.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"59002967d7c8c2a8"}},{"code_sha256_prefix":"7e84c28ab94718a8","entry":"adafactor_decay_rate_adam","repo":"zysszy/TreeGen","repo_kind":"listed","path":"code_generate_model.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/code_generate_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7e84c28ab94718a8"}},{"code_sha256_prefix":"7a6613b9d1c8e6c8","entry":"adafactor_decay_rate_pow","repo":"zysszy/TreeGen","repo_kind":"listed","path":"code_generate_model.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/code_generate_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7a6613b9d1c8e6c8"}},{"code_sha256_prefix":"24b755519861ca11","entry":"ast2code","repo":"zysszy/TreeGen","repo_kind":"listed","path":"HS-B/eval/ast2code.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/HS-B/eval/ast2code.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"24b755519861ca11"}},{"code_sha256_prefix":"994c6a4e3b0b1a8d","entry":"find_father","repo":"zysszy/TreeGen","repo_kind":"listed","path":"trans_train.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/trans_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"994c6a4e3b0b1a8d"}},{"code_sha256_prefix":"f328c6856bdf75bd","entry":"find_father_index","repo":"zysszy/TreeGen","repo_kind":"listed","path":"trans_train.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/trans_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f328c6856bdf75bd"}},{"code_sha256_prefix":"6e8a00ebcf2fefb6","entry":"findtheson","repo":"zysszy/TreeGen","repo_kind":"listed","path":"HS-B/eval/ast2code.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/HS-B/eval/ast2code.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6e8a00ebcf2fefb6"}},{"code_sha256_prefix":"300dc56067ea2eaa","entry":"get_deepth","repo":"zysszy/TreeGen","repo_kind":"listed","path":"trans_train.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/trans_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"300dc56067ea2eaa"}},{"code_sha256_prefix":"cb13989862d23ffd","entry":"line2vec","repo":"zysszy/TreeGen","repo_kind":"listed","path":"resolve_data.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/resolve_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cb13989862d23ffd"}},{"code_sha256_prefix":"a76095adda7142a8","entry":"tqdm","repo":"zysszy/TreeGen","repo_kind":"listed","path":"resolve_data.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/resolve_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a76095adda7142a8"}},{"code_sha256_prefix":"6c2f0ab41920ac28","entry":"word2vec","repo":"zysszy/TreeGen","repo_kind":"listed","path":"resolve_data.py","file_url":"https://github.com/zysszy/TreeGen/blob/HEAD/resolve_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c2f0ab41920ac28"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}