moxin-org/C2Rust
C2Rust is a 27 billion parameter BF16 fine-tune of Qwen/Qwen3.5-27B, developed by Pu Zhao et al. from Northeastern University, EmbodyX Inc, and Aibao LLC. This model is specifically designed for translating C programs into behaviorally equivalent Rust code. It achieves an 87.30% execution-verified C2Rust success rate, a 15 percentage-point gain over its base model, making it highly effective for C-to-Rust code translation tasks.
Loading preview...
Overview
C2Rust is a 27 billion parameter model, fine-tuned from Qwen/Qwen3.5-27B, dedicated to translating C programs into behaviorally equivalent Rust code. Developed by Pu Zhao et al., this model utilizes a unique three-stage training curriculum to enhance its translation capabilities. It has been evaluated using an execution-based SACTOR harness, which compiles and compares the behavior of generated Rust code against the source C program.
Key Capabilities and Performance
- C-to-Rust Translation: Achieves an 87.30% execution-verified C2Rust success rate, representing a 15.00 percentage-point improvement over the untuned Qwen3.5-27B base model.
- Competitive Performance: Outperforms larger models like Qwen3.5-Plus (397B), MiniMax-M2.5 (230B), and GLM-5 (744B) on the C2Rust benchmark.
- Specialized Training: Employs a three-stage curriculum including Rust continued pretraining, debugging-aware SFT, and C2Rust task-specific SFT, all conducted with full-parameter BF16 fine-tuning.
- General Coding: Retains strong general software-engineering performance, scoring 70.6 on SWE-bench Verified pass@1, a modest specialization cost compared to the base model's 72.4.
Intended Use and Limitations
C2Rust is primarily intended for research and experimentation in C-to-Rust translation. Users should treat generated programs as candidates, requiring compilation, testing, and review for correctness, safety, and maintainability. Limitations include that passing tests does not guarantee semantic equivalence or memory safety, and the default evaluation prioritizes behavior preservation over idiomatic Rust, potentially allowing unsafe code.