EMNLP 2023long findings0 citations
Explain-then-translate: an analysis on improving program translation with self-generated explanations
Zilu Tang, Mayank Agarwal, Alexander G 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.
code generationmachine translationprogram translationlarge language modelpromptingchain-of-thought
BibTeX
@inproceedings{
tang2023explainthentranslate,
title={Explain-then-translate: an analysis on improving program translation with self-generated explanations},
author={Zilu Tang and Mayank Agarwal and Alexander G Shypula and Bailin Wang and Derry Wijaya and Jie Chen and Yoon Kim},
booktitle={The 2023 Conference on Empirical Methods in Natural Language Processing},
year={2023},
url={https://openreview.net/forum?id=uyUO80sbm0}
}