Research map / Large language models / Agents, code and math
Explain-then-translate: an analysis on improving program translation with self-generated explanations
Zilu Tang, Mayank Agarwal, Alex Shypula, Bailin Wang, Derry Wijaya, Jie Chen, Yoon Kim
MIT-IBM Watson AI Lab · Monash University · Boston University
Read the paperPlace an idea next to itCheck your own paper ↗
15measured effects
5improved
4no clear effect
6hurt
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add self-generated NL explanation before translating (zero-shot) | GPT-3.5 · MultiPL-C2C Python-to-X (18 targets, 0-shot) | pass@1: +11.5% relative on average; 6.2% high-resource, 14.5% extremely-low-resource | Improved |
| add explanations in four-shot setting | GPT-3.5 · MultiPL-C2C Python-to-X (4-shot) | pass@1: average improvement 1.1% (up to 10.1% for some pairs) | No clear effect |
| use few-shot-style explanations (exp) vs zero-shot | GPT-3.5 · MultiPL-C2C Python-to-X | pass@1 | Hurt |
| explain ExtLow source programs then translate to high-resource | GPT-3.5 · ExtLow-to-High | pass@1 | No clear effect |
| explanation selection with logprob heuristic for exp | GPT-3.5 · MultiPL-C2C Python-to-X | pass@1: +2.54% over random (p=0.055); +1.7% avg (p<0.001) over 18 directions | Improved |
| explanation selection with frag heuristic for exp-lbl-d | GPT-3.5 · MultiPL-C2C Python-to-X | pass@1: +2.2% over random (p=0.033); 0.48% avg (p=0.022) | Improved |
| use GPT-3.5-generated explanations for smaller model | CodeGen2-1B · MultiPL-C2C Python-to-X | pass@1: outperforms self-explanations in 12 of 18 directions | Improved |
| explain only hard problems (selective explanation via direct pass@1 oracle) | exp · MultiPL-C2C all directions | pass@1: better than direct and exp in 35/36 directions | Improved |
| shuffle sentences in explanation (swap-s) (ablation) | exp · Python-to-Java / PHP | pass@1 improvement: jv 6.9 -> 5.1; php 8.6 -> 7.9 | No clear effect |
| delete 50% of words in explanation (del-w-0.5) (ablation) | exp · Python-to-PHP | pass@1 improvement: 8.6 -> 3.3 | Hurt |
| replace explanation with empty string (no-exp) (ablation) | exp · Python-to-PHP | pass@1 improvement: 8.6 -> -54.1 | Hurt |
| replace explanation with random other program's explanation (rand-exp) (ablation) | exp · Python-to-PHP | pass@1 improvement: 8.6 -> 6.1 | Hurt |
Closest papers by meaning
- Natural Language to Code Translation with Execution (EMNLP 2022 · similarity 0.87)
- AutoCodeBench: Large Language Models are Automatic Code Benchmark Generators (ICLR 2026 · similarity 0.87)
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translation (EMNLP 2023 · similarity 0.87)
- Teaching Large Language Models to Self-Debug (ICLR 2024 · similarity 0.87)
- Automatically Testing Functional Properties of Code Translation Models (AAAI 2024 · similarity 0.86)
- Synthetic Programming Elicitation for Text-to-Code in Very Low-Resource Programming and Formal Languages (NeurIPS 2024 · similarity 0.85)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
