Program Translation via Code Distillation
Yufan Huang, Mengnan Qi, Yongqiang Yao, Maoquan Wang, Bin Gu, Colin B. Clement, Neel Sundaresan
Abstract
Software version migration and program translation are an important and costly part of the lifecycle of large codebases. Traditional machine translation relies on parallel corpora for supervised translation, which is not feasible for program translation due to a dearth of aligned data. Recent unsupervised neural machine translation techniques have overcome data limitations by included techniques such as back translation and low level compiler intermediate representations (IR). These methods face significant challenges due to the noise in code snippet alignment and the diversity of IRs respectively. In this paper we propose a novel model called Code Distillation (CoDist) whereby we capture the semantic and structural equivalence of code in a language agnostic intermediate representation. Distilled code serves as a translation pivot for any programming language, leading by construction to parallel corpora which scale to all available source code by simply applying the distillation compiler. We demonstrate that our approach achieves state-of-the-art performance on CodeXGLUE and TransCoder GeeksForGeeks translation benchmarks, with an average absolute increase of 12.7% on the TransCoder GeeksforGeeks translation benchmark compare to TransCoder-ST.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
8 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- AI Coders Are among Us: Rethinking Programming Language Grammar towards Efficient Code Generation cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data cites BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
- Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data cites Unsupervised Translation of Programming Languages
- Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data cites Training language models to follow instructions with human feedback
- Token Sugar: Making Source Code Sweeter for LLMs through Token-Efficient Shorthand cites AI Coders Are among Us: Rethinking Programming Language Grammar towards Efficient Code Generation
Cited by top-tier papers8
- Learning to Focus: Causal Attention Distillation via Gradient-Guided Token PruningYiju Guo, Wenkai Yang, Zexu Sun, Ning Ding et al.NeurIPS 2025 · 14 citations
- AI Coders Are among Us: Rethinking Programming Language Grammar towards Efficient Code GenerationZhensu Sun, Xiaoning Du, Zhou Yang, Li Li et al.ISSTA 2024 · 8 citations
- On-Policy Optimization with Group Equivalent Preference for Multi-Programming Language UnderstandingHaoyuan Wu, Rui Ming, Jilong Gao, Hangyu Zhao et al.NeurIPS 2025 · 2 citations
- Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code DataMing Zhu, Mohimenul Karim, Ismini Lourentzou, Daphne YaoASE 2024 · 2 citations
- Token Sugar: Making Source Code Sweeter for LLMs through Token-Efficient ShorthandZhensu Sun, Chengran Yang, Xiaoning Du, Zhou Yang et al.ASE 2025 · 2 citations
Builds on9
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and ComprehensionMike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad et al.ACL 2020 · 1,224 citations
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations
Related papers
- Code Translation with Compiler RepresentationsMarc Szafraniec, Baptiste Rozière, Hugh Leather, Patrick Labatut et al.ICLR 2023 · 18 citations
- Multilingual Code Snippets Training for Program TranslationMing Zhu, Karthik Suresh, Chandan K. ReddyAAAI 2022 · 72 citations
- AVATAR: A Parallel Corpus for Java-Python Program TranslationWasi Uddin Ahmad, Md Golam Rahman Tushar, Saikat Chakraborty, Kai-Wei ChangACL Findings 2023 · 46 citations
- Syntax and Domain Aware Model for Unsupervised Program TranslationFang Liu, Jia Li, Li ZhangICSE 2023 · 25 citations
- Leveraging Automated Unit Tests for Unsupervised Code TranslationBaptiste Rozière, Jie Zhang, François Charton, Mark Harman et al.ICLR 2022 · 161 citations
