Developer Tools

TRAVEL boosts C-to-Rust translation accuracy by 26% with RL and rule-guided reasoning

New framework TRAVEL uses MCTS and RL to produce safer, compilable Rust from legacy C code.

Deep Dive

The paper introduces TRAVEL (Translation fRAmework Via rule-guided reasoning and rEinforcement Learning), addressing two key challenges in LLM-based C-to-Rust translation: poor adherence to Rust-specific syntax rules and failure to preserve complex program semantics. The first module uses Monte Carlo Tree Search guided by a set of Rust-specific rules to steer the reasoning path toward syntactically valid translations. The second module applies reinforcement learning that jointly optimizes execution feedback (does the generated code compile and run correctly?) and reasoning-quality signals, encouraging the model to build reasoning chains that accurately capture the original C program's behavior. The approach is evaluated across three datasets: xCodeEval (a public benchmark), OS-Bench (functions from the Linux kernel), and HW-Bench (an industrial dataset from Huawei).

On xCodeEval, TRAVEL outperforms all baselines across three backbone LLMs, notably improving computational accuracy (CA) by 26.22% and compilation success rate (CSR) by 18.77% compared to the strongest prompting baseline IRENE. On the industrial HW-Bench and open-source OS-Bench, TRAVEL further increases CSR by 18.28% and 16.51%, respectively, while reducing unsafe–rate (UR) – a metric for unsafe Rust usage – by 13.06% and 13.08%. The framework is accepted to the Industry Showcase of ASE 2026 and represents a significant step toward reliable, large-scale migration of legacy C codebases to memory-safe Rust without manual rewriting.

Key Points
  • TRAVEL improves C-to-Rust compilation success by 18.77% on public benchmarks and computational accuracy by 26.22%
  • The framework uses MCTS guided by Rust-specific rules for syntax adherence, plus RL with execution feedback for semantic preservation
  • Tested on Linux kernel and Huawei datasets, it reduces unsafe Rust usage by 13.06%–13.08%, improving memory safety

Why It Matters

Enables safer, faster migration of billions of lines of C code to memory-safe Rust without manual rewriting.

📬 Get the top 10 AI stories daily