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

Zilu Tang, Mayank Agarwal, Alex Shypula, Bailin Wang, Derry Wijaya +2 more
11/13/2023
cs.CL

No official code found. Best implementation: PootieT/explain-then-translate (29 stars, last commit 2023-12-05).

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.

View on arXivView PDF

Code Implementations(1)

Official repo for EMNLP 2023 paper "Explain-then-Translate: An Analysis on Improving Program Translation with Self-generated Explanations"

291C, C++Oct 22, 20232 years ago

Similar Papers

Cite this paper

@article{tang2023explainthentranslate,
  title  = {Explain-then-Translate: An Analysis on Improving Program Translation with Self-generated Explanations},
  author = {Zilu Tang and Mayank Agarwal and Alex Shypula and Bailin Wang and Derry Wijaya and Jie Chen and Yoon Kim},
  year   = {2023},
  eprint = {2311.07070},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.07070v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.07070.svg)](https://codeofpaper.com/paper/2311.07070)

Discussion