Tree-to-tree Neural Networks for Program Translation

By Xinyun Chen, Chang Liu, Dawn Song. 2018

332 citations recorded by the source corpus.

Program translation is an important tool to migrate legacy code in one language into an ecosystem built in a different language. In this work, we are the first to employ deep neural networks toward tackling this problem. We observe that program translation is a modular procedure, in which a sub-tree of the source tree is translated into the corresponding target sub-tree at each step. To capture this intuition, we design a tree-to-tree neural network to translate a source tree into a target one. Meanwhile, we develop an attention mechanism for the tree-to-tree model, so that when the decoder expands one non-terminal in the target tree, the attention mechanism locates the corresponding sub-tree in the source tree to guide the expansion of the decoder. We evaluate the program translation capability of our tree-to-tree model against several state-of-the-art approaches. Compared against other neural translation models, we observe that our approach is consistently better than the baselines with a margin of up to 15 points. Further, our approach can improve the previous state-of-the-art program translation approaches by a margin of 20 points on the translation of real-world projects.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Neural Architecture Search & AutoML, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Yoshua Bengio
  2. Mohit Bansal
  3. Graham Neubig
  4. Jianfeng Gao
  5. Percy Liang
  6. Quoc V. Le
  7. Luke S. Zettlemoyer
  8. Ruslan Salakhutdinov

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Dacheng Tao
  3. Trevor Darrell
  4. Xiaogang Wang
  5. Jitendra Malik
  6. Ming-Hsuan Yang
  7. Andrew Zisserman
  8. Alan L. Yuille

In Neural Architecture Search & AutoML

  1. Baptiste Rozière
  2. Guillaume Lample
  3. Eran Yahav
  4. Omer Levy
  5. Uri Alon
  6. Marie-Anne Lachaux
  7. Chris Quirk
  8. Vighnesh Leonardo Shiv

In Code Generation & Program Synthesis

  1. Charles Sutton
  2. Rishabh Singh
  3. Miltiadis Allamanis
  4. Vincent J. Hellendoorn
  5. Marc Brockschmidt
  6. Uri Alon
  7. Pushmeet Kohli
  8. Baptiste Rozière

Citations in the corpus