Leveraging Automated Unit Tests for Unsupervised Code Translation

10/13/2021
by   Baptiste Roziere, et al.
0

With little to no parallel data available for programming languages, unsupervised methods are well-suited to source code translation. However, the majority of unsupervised machine translation approaches rely on back-translation, a method developed in the context of natural language translation and one that inherently involves training on noisy inputs. Unfortunately, source code is highly sensitive to small changes; a single token can result in compilation failures or erroneous programs, unlike natural languages where small inaccuracies may not change the meaning of a sentence. To address this issue, we propose to leverage an automated unit-testing system to filter out invalid translations, thereby creating a fully tested parallel corpus. We found that fine-tuning an unsupervised model with this filtered data set significantly reduces the noise in the translations so-generated, comfortably outperforming the state-of-the-art for all language pairs studied. In particular, for Java → Python and Python → C++ we outperform the best previous methods by more than 16 rate by more than 35

READ FULL TEXT
research
06/05/2020

Unsupervised Translation of Programming Languages

A transcompiler, also known as source-to-source translator, is a system ...
research
10/11/2021

Using Document Similarity Methods to create Parallel Datasets for Code Translation

Translating source code from one programming language to another is a cr...
research
08/26/2021

AVATAR: A Parallel Corpus for Java-Python Program Translation

Program translation refers to migrating source code from one programming...
research
12/04/2020

Quality Estimation Interpretability for Code Translation

Recently, the automated translation of source code from one programming ...
research
08/06/2023

Understanding the Effectiveness of Large Language Models in Code Translation

Code translation aims to convert source code from one programming langua...
research
02/15/2022

Better Together? An Evaluation of AI-Supported Code Translation

Generative machine learning models have recently been applied to source ...
research
05/23/2018

Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflow

For tasks like code synthesis from natural language, code retrieval, and...

Please sign up or login with your details

Forgot password? Click here to reset