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.
Funding Information
  • Engineering and Physical Sciences Research Council (EPSRC) (EP/S021817/1)
  • Engineering and Physical Sciences Research Council (EPSRC) (EP/Y036417/1)