{"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/patching-as-translation-the-data-and-the","title":"Patching as Translation: the Data and the Metaphor","arxiv_id":"2008.10707","date":"2020-08-24","proceeding":null,"authors":["Yangruibo Ding","Baishakhi Ray","Premkumar Devanbu","Vincent J. Hellendoorn"],"abstract":"Machine Learning models from other fields, like Computational Linguistics, have been transplanted to Software Engineering tasks, often quite successfully. Yet a transplanted model's initial success at a given task does not necessarily mean it is well-suited for the task. In this work, we examine a common example of this phenomenon: the conceit that \"software patching is like language translation\". We demonstrate empirically that there are subtle, but critical distinctions between sequence-to-sequence models and translation model: while program repair benefits greatly from the former, general modeling architecture, it actually suffers from design decisions built into the latter, both in terms of translation accuracy and diversity. Given these findings, we demonstrate how a more principled approach to model design, based on our empirical findings and general knowledge of software development, can lead to better solutions. Our findings also lend strong support to the recent trend towards synthesizing edits of code conditional on the buggy context, to repair bugs. We implement such models ourselves as \"proof-of-concept\" tools and empirically confirm that they behave in a fundamentally different, more effective way than the studied translation-based architectures. Overall, our results demonstrate the merit of studying the intricacies of machine learned models in software engineering: not only can this help elucidate potential issues that may be overshadowed by increases in accuracy; it can also help innovate on these models to raise the state-of-the-art further. We will publicly release our replication data and materials at https://github.com/ARiSE-Lab/Patch-as-translation.","url_abs":"https://arxiv.org/abs/2008.10707v2","url_pdf":"https://arxiv.org/pdf/2008.10707v2.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":"patching-as-translation-the-data-and-the","repo_url":"https://github.com/ARiSE-Lab/Patch-as-translation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"general-knowledge","task_name":"General Knowledge"},{"task_slug":"program-repair","task_name":"Program Repair"},{"task_slug":"translation","task_name":"Translation"}],"methods":[{"method_slug":"repair","method_name":"Repair"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2008.10707","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2008.10707"}},"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/ARiSE-Lab/Patch-as-translation","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"unverified":7},"by_repo_kind":{"official":{"samples":8,"ran":1,"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":"cf83a84f693a8da2","entry":"intersection","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Analysis/code/filter_consecutive_identical.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Analysis/code/filter_consecutive_identical.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cf83a84f693a8da2"}},{"code_sha256_prefix":"8ff84c3a3d60b0d0","entry":"calcNSim","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Analysis/code/real-fix-analysis.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Analysis/code/real-fix-analysis.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":"8ff84c3a3d60b0d0"}},{"code_sha256_prefix":"e0071ec52c871687","entry":"calculate_edit_distance","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Analysis/code/util.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Analysis/code/util.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":"e0071ec52c871687"}},{"code_sha256_prefix":"6b27265d93ca83ff","entry":"get_jaccard_sim","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Analysis/code/util.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Analysis/code/util.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":"6b27265d93ca83ff"}},{"code_sha256_prefix":"21d04e83d6baca2d","entry":"jaccard_ngram","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Analysis/code/util.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Analysis/code/util.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":"21d04e83d6baca2d"}},{"code_sha256_prefix":"5bb713ec36ef65f8","entry":"masked_ce_loss","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Model/train_model.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Model/train_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":"5bb713ec36ef65f8"}},{"code_sha256_prefix":"5027eaa2ad899e58","entry":"positional_encoding","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Model/transformer.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Model/transformer.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":"5027eaa2ad899e58"}},{"code_sha256_prefix":"d07266ae4f7879a4","entry":"processContextLine","repo":"ARiSE-Lab/Patch-as-translation","repo_kind":"official","path":"Analysis/code/real-fix-analysis.py","file_url":"https://github.com/ARiSE-Lab/Patch-as-translation/blob/HEAD/Analysis/code/real-fix-analysis.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":"d07266ae4f7879a4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}