Tree-to-tree Neural Networks for Program Translation
Xinyun Chen, Chang Liu, Dawn Song

TL;DR
This paper introduces a novel tree-to-tree neural network model with an attention mechanism for program translation, significantly outperforming existing neural approaches in translating code between programming languages.
Contribution
The paper presents the first neural network model specifically designed for program translation using a tree-to-tree architecture with attention, improving translation accuracy over prior methods.
Findings
Outperforms state-of-the-art neural translation models by up to 15 points.
Improves previous program translation approaches by 20 points on real-world projects.
Demonstrates the effectiveness of tree-based neural models for code translation.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Multimodal Machine Learning Applications
