Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languages

Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei Chang
5/23/2022
cs.CLcs.PL

Official code: wasiahmad/SumGenToBT (10 stars, Python, MIT, last commit 2022-10-06).

Abstract

Back-translation is widely known for its effectiveness in neural machine translation when there is little to no parallel data. In this approach, a source-to-target model is coupled with a target-to-source model trained in parallel.

Show full abstract

The target-to-source model generates noisy sources, while the source-to-target model is trained to reconstruct the targets and vice versa. Recent developments of multilingual pre-trained sequence-to-sequence models for programming languages have been very effective for a broad spectrum of downstream software engineering tasks. Hence, training them to build programming language translation systems via back-translation is compelling. However, these models cannot be further trained via back-translation since they learn to output sequences in the same language as the inputs during pre-training. As an alternative, we propose performing back-translation via code summarization and generation. In code summarization, a model learns to generate natural language (NL) summaries given code snippets. In code generation, the model learns to do the opposite. Therefore, target-to-source generation in back-translation can be viewed as a target-to-NL-to-source generation. We show that our proposed approach performs competitively with state-of-the-art methods. We have made the code publicly available.

View on arXivView PDF

Code Implementations(1)

MIT

Official code of our work, Summarize and Generate to Back-Translate: Unsupervised Translation of Programming Languages [arXiv].

102Python, ShellNov 11, 20214 years agoMIT

Similar Papers

Cite this paper

@article{ahmad2022summarize,
  title  = {Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languages},
  author = {Wasi Uddin Ahmad and Saikat Chakraborty and Baishakhi Ray and Kai-Wei Chang},
  year   = {2022},
  eprint = {2205.11116},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.11116}
}

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/2205.11116.svg)](https://codeofpaper.com/paper/2205.11116)

Discussion