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

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearchpeer-review

7 Citations (Scopus)

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 (Cassano et al., 2022), 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.

Original languageEnglish
Title of host publicationEMNLP 2023 - The 2023 Conference on Empirical Methods in Natural Language Processing - Findings of the Association for Computational Linguistics: EMNLP 2023
EditorsHouda Bouamor, Juan Pino, Kalika Bali
Place of PublicationStroudsburg PA USA
PublisherAssociation for Computational Linguistics (ACL)
Pages1741-1788
Number of pages48
ISBN (Electronic)9798891760615
DOIs
Publication statusPublished - 2023
EventEmpirical Methods in Natural Language Processing 2023 - , Singapore
Duration: 6 Dec 202310 Dec 2023
https://2023.emnlp.org/
https://aclanthology.org/volumes/2023.findings-emnlp/ (Proceedings)
https://aclanthology.org/volumes/2023.emnlp-demo/ (Proceedings)

Conference

ConferenceEmpirical Methods in Natural Language Processing 2023
Abbreviated titleEMNLP 2023
Country/TerritorySingapore
Period6/12/2310/12/23
Internet address

Cite this