An Empirical Study of C to Rust Translation using Local Large-Language Models
Open Access
- 12 April 2026
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 151-158
Abstract
Memory corruption vulnerabilities are prevalent in C/C++ codebases. As a result, recent research has explored automated translation of C/C++ to Rust in order to benefit from Rust’s compiler enforced memory safety guarantees. However, much of the related work for translation using large-language models (LLMs) focuses on techniques that run on proprietary, cloud based LLMs with a high number of parameters. We present Oxidation, a translation pipeline that targets resource constrained LLMs on local machines. To cope with the limited context window of local LLMs, Oxidation proposes a compile and repair approach that leverages a live code environment (REPL) to incrementally validate partial translations, and an arbitration pipeline to generate complete summaries of C functions. Our results over the Transcoder-IR dataset suggest that at the function level, arbitrated translation results in a 3 × increase in translation success for lightweight, non-thinking models. In the case of thinking models, we observed a 31% drop in translation success, but a 5 × performance gain in terms of translation runtime.Keywords
Funding Information
- Engineering and Physical Sciences Research Council (EPSRC) (EP/S021817/1)
- Engineering and Physical Sciences Research Council (EPSRC) (EP/Y036417/1)
This publication has 18 references indexed in Scilit:
- C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic TechniquesarXiv, 2025
- SmartC2Rust: Iterative, Feedback-Driven C-to-Rust Translation via Large Language Models for Safety and EquivalencearXiv, 2025
- Scalable, Validated Code Translation of Entire Projects using Large Language ModelsProceedings of the ACM on Programming Languages, 2025
- Syzygy: Dual Code-Test C to (safe) Rust Translation using LLMs and Dynamic AnalysisarXiv, 2024
- To Tag, or Not to Tag: Translating C's Unions to Rust's Tagged Unions2024
- VERT: Verified Equivalent Rust Transpilation with Large Language Models as Few-Shot LearnersarXiv, 2024
- Fixing Rust Compilation Errors using LLMsarXiv, 2023
- Ownership Guided C to Rust Translation2023
- Code Translation with Compiler RepresentationsarXiv, 2023
- Cognitive complexity2018