EMNLP Findings2023
Data Augmentation for Code Translation with Comparable Corpora and Multiple References
Yiqing Xie, Atharva Naik, Daniel Fried, Carolyn P. Rosé
Abstract
One major challenge of translating code between programming languages is that parallel training data is often limited.To overcome this challenge, we present two data augmentation techniques, one that builds comparable corpora (i.e., code pairs with similar functionality), and another that augments existing parallel data with multiple reference translations.Specifically, we build and analyze multiple types of comparable corpora, including programs generated from natural language documentation using a code generation model.Furthermore, to reduce overfitting to a single reference translation, we automatically generate additional translation references for available parallel data and filter the translations by unit tests, which increases variation in target translations.Experiments show that our data augmentation techniques significantly improve CodeT5 for translation between Java, Python, and C++ by an average of 7.5% Computational Accuracy (CA@1), which verifies the correctness of translations by execution.1 Input Source program (Java) Ground Truth Reference Translation (Python) Correct Candidate # 1 Correct Candidate # 2 Correct Candidate # 3 Correct Candidate # 4 Correct Candidate # 7 Correct Candidate # 5 Correct Candidate # 8 Correct Candidate # 6 Correct Candidate # 9
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.
5 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
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites Unsupervised Translation of Programming Languages
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites DOBF: A Deobfuscation Pre-Training Objective for Programming Languages
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment cites Unsupervised Translation of Programming Languages
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment cites DOBF: A Deobfuscation Pre-Training Objective for Programming Languages
- Agnostics: Learning to Synthesize Code in Any Programming Language with a Universal Reinforcement Learning Environment cites Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMs
- DOBF: A Deobfuscation Pre-Training Objective for Programming Languages cites Unsupervised Translation of Programming Languages
- Function-to-Style Guidance of LLMs for Code Translation cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- Function-to-Style Guidance of LLMs for Code Translation cites Unsupervised Translation of Programming Languages
Cited by top-tier papers5
- Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMsFederico Cassano, John Gouwar, Francesca Lucchetti, Claire Schlesinger et al.OOPSLA 2024 · 33 citations
- Data Mixture Inference Attack: BPE Tokenizers Reveal Training Data CompositionsJonathan Hayase, Alisa Liu, Yejin Choi, Sewoong Oh et al.NeurIPS 2024 · 16 citations
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution AlignmentZhiqiang Yuan, Weitong Chen, Hanlin Wang, Xin Peng et al.FSE 2026 · 4 citations
- Agnostics: Learning to Synthesize Code in Any Programming Language with a Universal Reinforcement Learning EnvironmentAleksander Boruch-Gruszecki, Yangtian Zi, Zixuan Wu, Tejas Oberoi et al.ICLR 2026
- Function-to-Style Guidance of LLMs for Code TranslationLonghui Zhang, Bin Wang, Jiahao Wang, Xiaofeng Zhao et al.ICML 2025
Builds on7
- 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
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 citations
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement LearningHung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese et al.NeurIPS 2022 · 571 citations
- DOBF: A Deobfuscation Pre-Training Objective for Programming LanguagesMarie-Anne Lachaux, Baptiste Rozière, Marc Szafraniec, Guillaume LampleNeurIPS 2021 · 174 citations
Related papers
- Leveraging Automated Unit Tests for Unsupervised Code TranslationBaptiste Rozière, Jie Zhang, François Charton, Mark Harman et al.ICLR 2022 · 161 citations
- Code Needs Comments: Enhancing Code LLMs with Comment AugmentationDemin Song, Honglin Guo, Yunhua Zhou, Shuhao Xing et al.ACL Findings 2024 · 9 citations
- Multilingual Code Co-evolution using Large Language ModelsJiyang Zhang, Pengyu Nie, Junyi Jessy Li, Milos GligoricFSE 2023 · 34 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
- PyMT5: multi-mode translation of natural language and Python code with transformersColin B. Clement, Dawn Drain, Jonathan Timcheck, Alexey Svyatkovskiy et al.EMNLP 2020 · 24 citations
