paper-with-me

홈 › Papers

Code Translation with Compiler Representations

2022-06-30 · Marc Szafraniec, Baptiste Roziere, Hugh Leather, Francois Charton, Patrick Labatut, Gabriel Synnaeve

In this paper, we leverage low-level compiler intermediate representations (IR) to improve code translation. Traditional transpilers rely on syntactic information and handcrafted rules, which limits their applicability and produces unnatural-looking code. Applying neural machine translation (NMT) approaches to code has successfully broadened the set of programs on which one can get a natural-looking translation. However, they treat the code as sequences of text tokens, and still do not differentiate well enough between similar pieces of code which have different semantics in different languages. The consequence is low quality translation, reducing the practicality of NMT, and stressing the need for an approach significantly increasing its accuracy. Here we propose to augment code translation with IRs, specifically LLVM IR, with results on the C++, Java, Rust, and Go languages. Our method improves upon the state of the art for unsupervised code translation, increasing the number of correct translations by 11% on average, and up to 79% for the Java -> Rust pair with greedy decoding. We extend previous test sets for code translation, by adding hundreds of Go and Rust functions. Additionally, we train models with high performance on the problem of IR decompilation, generating programming source code from IR, and study using IRs as intermediary pivot for translation.

📄 PDF Abstract BibTeX arXiv:2207.03578

Code (1)

facebookresearch/CodeGen

Tasks

Code TranslationMachine TranslationNMTTranslation

Methods 이 논문이 사용한 방법론

Test 설명 없음

Similar Papers 제목 키워드 기반

Program Translation via Code Distillation

2023-10-17 · Yufan Huang, MengNan Qi, Yongqiang Yao, Maoquan Wang 외

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…

DiversityMachine TranslationTranslation

Beyond BLEU: A Semantic Evaluation Method for Code Translation

2026-05-06 · Julius Näumann, Sven Keidel, Amir Molzam Sharifloo, Mira Mezini arxiv

Code translation is one of the core capabilities of LLMs. However, evaluating the correctness of translations remains difficult, as commonly used metrics such as BLEU measure only syntactic similarity, disregarding progr…

Code Translation

LEGO-Compiler: Enhancing Neural Compilation Through Translation Composability

2025-05-26 · Shuoming Zhang, Jiacheng Zhao, Chunwei Xia, Zheng Wang 외

Large language models (LLMs) have the potential to revolutionize how we design and implement compilers and code translation tools. However, existing LLMs struggle to handle long and complex programs. We introduce LEGO-Co…

Code TranslationTranslation

LLM Translation of Compiler Intermediate Representation

2026-05-07 · Andrea Valenzuela Ramirez, Cristian Gutierrez-Gomez, Marta Barroso, Dario Garcia-Gasulla 외 arxiv

GCC and LLVM underpin much of modern software infrastructure, relying on distinct Intermediate Representations (IRs) to drive optimizations and code generation. However, the semantic and structural differences between th…

Code Generation

Boosting Neural Networks to Decompile Optimized Binaries

2023-01-03 · Ying Cao, Ruigang Liang, Kai Chen, Peiwei Hu

Decompilation aims to transform a low-level program language (LPL) (eg., binary file) into its functionally-equivalent high-level program language (HPL) (e.g., C/C++). It is a core technology in software security, especi…

Graph Neural NetworkMachine TranslationMalware AnalysisNMT+1