Towards Reliable C-to-Rust Translation with Rule-Guided Reasoning and Reinforcement Learning
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
The migration of legacy C programs to Rust has become an important direction for improving software memory safety while alleviating the high cost of manual rewriting. Leveraging large language models (LLMs) for automated C-to-Rust translation has emerged as a promising direction. However, existing LLM-based approaches remain limited. On the one hand, LLMs exhibit limited capability in identifying Rust-specific rules, and inadequate handling of Rust syntax often results in incorrect translations. On the other hand, existing LLMs often struggle to accurately capture the semantics of complex code, resulting in incorrect translations. To address these challenges, we propose a Translation fRAmework Via rule-guided reasoning and rEinforcement Learning, namely TRAVEL, consisting of two modules. The first module employs Monte Carlo Tree Search (MCTS)-based reasoning path construction guided by Rust-specific rules, steering the search toward translation steps that respect the syntactic rules that LLMs frequently violate. The second module introduces reinforcement learning that couples execution feedback with reasoning-quality signals, encouraging the model to construct reasoning paths that accurately capture program semantics, thereby ensuring that the generated Rust code preserves the intended behavior of the original C program. We evaluate TRAVEL on three datasets: xCodeEval (a public benchmark), OS-Bench (functions collected from the Linux kernel), and HW-Bench (an industrial dataset from Huawei). On xCodeEval, TRAVEL outperforms all baselines across three backbone LLMs. In particular, compared to the strongest prompting baseline IRENE, TRAVEL improves computational accuracy (CA) by 26.22% and compilation success rate (CSR) by 18.77%. On HW-Bench and OS-Bench, TRAVEL further improves CSR by 18.28% and 16.51%, respectively, while reducing unsafe rate (UR) by 13.06% and 13.08%, respectively.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 14 of its 56 references that are in the map. First posted on arXiv 22 Jul 2026.
Builds on
14 of 56 references.
Closest ancestors · 1
Same direction, newest first
- 2024Qwen2.5-Coder Technical Report18 Sep
Other references · 13
- 2023GPT-4 Technical Reportcited by 18,132
- 2025Qwen3 Technical Reportcited by 8,195
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 1,980
- 2024Generative Reward Modelscited by 148
- 2024CodeGemma: Open Code Models Based on Gemmacited by 145
- 2024FullStack Bench: Evaluating LLMs as Full Stack Coderscited by 56
- 2024Towards Translating Real-World Code with LLMs: A Study of Translating to Rustcited by 35
- 2024VERT: Verified Equivalent Rust Transpilation with Large Language Models as Few-Shot Learnerscited by 20
- 2025C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic Techniquescited by 18
- 2025Performance Prediction for Large Systems via Text-to-Text Regressioncited by 14
- 2025SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verificationcited by 9
- 2025SafeTrans: LLM-assisted Transpilation from C to Rustcited by 8
1 more
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT
- 2026ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilation
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translation
- 2024RustRepoTrans: Repository-level Code Translation Benchmark Targeting Rust
- 2026AdaTrans: Automated C to Rust Transformation via Error-Adaptive Repair ↗
- 2026From C to Idiomatic Rust: A Ship-of-Theseus Agentic Translation ↗
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migration
- 2026LLM4C2Rust: Large Language Models for Automated Memory-Safe Code Transpilation ↗