Papers › Explain-then-Translate: An Analysis on Improving Program Translation with...

Explain-then-Translate: An Analysis on Improving Program Translation with Self-generated Explanations

13 Nov 2023arXiv:2311.07070archive 2025-07-28

Zilu Tang, Mayank Agarwal, Alex Shypula, Bailin Wang, Derry Wijaya, Jie Chen, Yoon Kim

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.

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="2311.07070")

Code

Syntology Ran 10 of 12 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 10 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

pootiet/explain-then-translate officialmentioned in papermentioned on GitHubpytorch 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

12 samples harvested; 10 ran; 0 honoured the contract we drafted; 2 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.

10ran
2unverified

Licence: 12 of the 12 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 pootiet/explain-then-translate. “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.

assoc_to_dict_list pootiet/explain-then-translate/MultiPL-C2C/inference/openai_multimodel_multikey.py official repository ran no licence file found · pointer only · 23aff1b8ab7d99ca · report
completion_is_nearly_all_comments pootiet/explain-then-translate/MultiPL-C2C/src/single_experiment_error_types.py official repository ran no licence file found · pointer only · 4322fa221ee62af1 · report
estimator pootiet/explain-then-translate/MultiPL-C2C/src/single_experiment_pass_k.py official repository ran fingerprinted no licence file found · pointer only · 9f3bd1f5682c5042 · report
estimator pootiet/explain-then-translate/MultiPL-C2C/src/single_experiment_error_types.py official repository ran fingerprinted no licence file found · pointer only · 3011ffdc360d52b2 · report
for_file pootiet/explain-then-translate/MultiPL-C2C/src/single_experiment_pass_k.py official repository ran no licence file found · pointer only · 4a86d5bc60b72487 · report
gunzip_json pootiet/explain-then-translate/MultiPL-C2C/util.py official repository ran no licence file found · pointer only · ac69a012e5b2b50f · report
last_index pootiet/explain-then-translate/CodeGenMirror/codegen_sources/model/contex_embed.py official repository ran fingerprinted no licence file found · pointer only · a8a816153618c124 · report
open_json pootiet/explain-then-translate/MultiPL-C2C/src/single_experiment_error_types.py official repository ran no licence file found · pointer only · 929eacd69001d272 · report
remove_all_after_last_elem pootiet/explain-then-translate/CodeGenMirror/codegen_sources/model/contex_embed.py official repository ran fingerprinted no licence file found · pointer only · 5590c5c65aecd3ee · report
sinkhorn pootiet/explain-then-translate/CodeGenMirror/codegen_sources/model/contex_embed.py official repository ran no licence file found · pointer only · a61f428c6d2822f2 · report
check_script pootiet/explain-then-translate/MultiPL-C2C/src/check_go.py official repository unverified no licence file found · pointer only · 9ceaec66f3dd3f63 · report
check_script pootiet/explain-then-translate/MultiPL-C2C/src/check_swift.py official repository unverified no licence file found · pointer only · eb7bbd2a96647ce8 · report

Tasks

Code TranslationTranslation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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