{"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/explain-then-translate-an-analysis-on","title":"Explain-then-Translate: An Analysis on Improving Program Translation with Self-generated Explanations","arxiv_id":"2311.07070","date":"2023-11-13","proceeding":null,"authors":["Zilu Tang","Mayank Agarwal","Alex Shypula","Bailin Wang","Derry Wijaya","Jie Chen","Yoon Kim"],"abstract":"This work explores the use of self-generated natural language explanations as an intermediate step for code-to-code translation with language models. Across three types of explanations and 19 programming languages constructed from the MultiPL-E dataset, we find the explanations to be particularly effective in the zero-shot case, improving performance by 12% on average. Improvements with natural language explanations are particularly pronounced on difficult programs. We release our dataset, code, and canonical solutions in all 19 languages.","url_abs":"https://arxiv.org/abs/2311.07070v1","url_pdf":"https://arxiv.org/pdf/2311.07070v1.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":"explain-then-translate-an-analysis-on","repo_url":"https://github.com/pootiet/explain-then-translate","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"code-translation","task_name":"Code Translation"},{"task_slug":"translation","task_name":"Translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.07070","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.07070"}},"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/pootiet/explain-then-translate","reach":{"status":"ok"}}],"summary":{"ran":10,"unverified":2},"by_repo_kind":{"official":{"samples":12,"ran":10,"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":"23aff1b8ab7d99ca","entry":"assoc_to_dict_list","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/inference/openai_multimodel_multikey.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/inference/openai_multimodel_multikey.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":"23aff1b8ab7d99ca"}},{"code_sha256_prefix":"4322fa221ee62af1","entry":"completion_is_nearly_all_comments","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/single_experiment_error_types.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/single_experiment_error_types.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":"4322fa221ee62af1"}},{"code_sha256_prefix":"9f3bd1f5682c5042","entry":"estimator","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/single_experiment_pass_k.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/single_experiment_pass_k.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":"9f3bd1f5682c5042"}},{"code_sha256_prefix":"3011ffdc360d52b2","entry":"estimator","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/single_experiment_error_types.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/single_experiment_error_types.py","link_basis":"first_harvest_node","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":"3011ffdc360d52b2"}},{"code_sha256_prefix":"4a86d5bc60b72487","entry":"for_file","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/single_experiment_pass_k.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/single_experiment_pass_k.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":"4a86d5bc60b72487"}},{"code_sha256_prefix":"ac69a012e5b2b50f","entry":"gunzip_json","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/util.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/util.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":"ac69a012e5b2b50f"}},{"code_sha256_prefix":"a8a816153618c124","entry":"last_index","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"CodeGenMirror/codegen_sources/model/contex_embed.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/CodeGenMirror/codegen_sources/model/contex_embed.py","link_basis":"first_harvest_node","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":"a8a816153618c124"}},{"code_sha256_prefix":"929eacd69001d272","entry":"open_json","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/single_experiment_error_types.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/single_experiment_error_types.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":"929eacd69001d272"}},{"code_sha256_prefix":"5590c5c65aecd3ee","entry":"remove_all_after_last_elem","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"CodeGenMirror/codegen_sources/model/contex_embed.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/CodeGenMirror/codegen_sources/model/contex_embed.py","link_basis":"first_harvest_node","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":"5590c5c65aecd3ee"}},{"code_sha256_prefix":"a61f428c6d2822f2","entry":"sinkhorn","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"CodeGenMirror/codegen_sources/model/contex_embed.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/CodeGenMirror/codegen_sources/model/contex_embed.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":"a61f428c6d2822f2"}},{"code_sha256_prefix":"9ceaec66f3dd3f63","entry":"check_script","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/check_go.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/check_go.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":"9ceaec66f3dd3f63"}},{"code_sha256_prefix":"eb7bbd2a96647ce8","entry":"check_script","repo":"pootiet/explain-then-translate","repo_kind":"official","path":"MultiPL-C2C/src/check_swift.py","file_url":"https://github.com/pootiet/explain-then-translate/blob/HEAD/MultiPL-C2C/src/check_swift.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":"eb7bbd2a96647ce8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}