{"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/data-augmentation-for-code-translation-with","title":"Data Augmentation for Code Translation with Comparable Corpora and Multiple References","arxiv_id":"2311.00317","date":"2023-11-01","proceeding":null,"authors":["Yiqing Xie","Atharva Naik","Daniel Fried","Carolyn Rose"],"abstract":"One major challenge of translating code between programming languages is that parallel training data is often limited. To overcome this challenge, we present two data augmentation techniques, one that builds comparable corpora (i.e., code pairs with similar functionality), and another that augments existing parallel data with multiple reference translations. Specifically, we build and analyze multiple types of comparable corpora, including programs generated from natural language documentation using a code generation model. Furthermore, to reduce overfitting to a single reference translation, we automatically generate additional translation references for available parallel data and filter the translations by unit tests, which increases variation in target translations. Experiments show that our data augmentation techniques significantly improve CodeT5 for translation between Java, Python, and C++ by an average of 7.5% Computational Accuracy (CA@1), which verifies the correctness of translations by execution. The code is available at https://github.com/Veronicium/CMTrans.","url_abs":"https://arxiv.org/abs/2311.00317v2","url_pdf":"https://arxiv.org/pdf/2311.00317v2.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":"data-augmentation-for-code-translation-with","repo_url":"https://github.com/veronicium/cmtrans","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"code-translation","task_name":"Code Translation"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"translation","task_name":"Translation"}],"methods":[{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"codet5","method_name":"CodeT5"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2311.00317","atlas_url":"https://app.syntology.ai/?focus=2311.00317","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.00317"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/veronicium/cmtrans","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"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":12,"samples":[{"code_sha256_prefix":"2e3e72e1e860afb2","entry":"add_lang_by_task","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/_utils.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2e3e72e1e860afb2"}},{"code_sha256_prefix":"b507c1b1c65c9174","entry":"compare_answer","repo":"veronicium/cmtrans","repo_kind":"official","path":"candidate_filtering/filter_candidates.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/candidate_filtering/filter_candidates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b507c1b1c65c9174"}},{"code_sha256_prefix":"cc181d5e6e9504de","entry":"convert_clone_examples_to_features","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/_utils.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc181d5e6e9504de"}},{"code_sha256_prefix":"70674cae33ae9c61","entry":"convert_examples_to_features","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/_utils.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"70674cae33ae9c61"}},{"code_sha256_prefix":"8cfe38019e9d6a49","entry":"get_model_size","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/models.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/models.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8cfe38019e9d6a49"}},{"code_sha256_prefix":"b57e5f4b7c4d2011","entry":"load_codet5","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/models.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b57e5f4b7c4d2011"}},{"code_sha256_prefix":"37156125554b21d2","entry":"add_args","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/config.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/config.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"37156125554b21d2"}},{"code_sha256_prefix":"78e60a90cda4f3d6","entry":"build_or_load_gen_model","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/models.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"78e60a90cda4f3d6"}},{"code_sha256_prefix":"7151e260c673ae6c","entry":"eval_ppl_epoch","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/run_gen.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/run_gen.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7151e260c673ae6c"}},{"code_sha256_prefix":"4dfcf272e3b5535f","entry":"load_and_cache_clone_data","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/utils.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4dfcf272e3b5535f"}},{"code_sha256_prefix":"08e8e1fc7c5648f7","entry":"load_and_cache_gen_data","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/utils.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"08e8e1fc7c5648f7"}},{"code_sha256_prefix":"8638626b5e47ee34","entry":"load_and_cache_multi_gen_data","repo":"veronicium/cmtrans","repo_kind":"official","path":"codet5/utils.py","file_url":"https://github.com/veronicium/cmtrans/blob/HEAD/codet5/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8638626b5e47ee34"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}