SearcharxivSearch

arXiv · 2608.13681

Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT

Abstract

Translating C code into safe, idiomatic Rust is a longstanding software-engineering goal because it can eliminate entire classes of memory-safety vulnerabilities while preserving the functional behavior of legacy systems. Large language models (LLMs) have shown promise for this task but typically underperform when applied off-the-shelf, since general-purpose pretraining rarely emphasizes idiomatic Rust generation, cross-language semantic equivalence, or the ability to reason about and repair compiler/runtime feedback. In this report we describe a three-stage fine-tuning curriculum applied to Qwen3-27B that is designed to progressively specialize the model for the C-to-Rust (C2Rust) translation task: (1) continued pretraining on Rust-centric corpora to strengthen the model's prior over idiomatic Rust syntax and standard-library usage; (2) supervised fine-tuning (SFT) on the microsoft/Verus_Training_Data dataset to instill debugging and self-repair behavior over Rust code; and (3) task-specific SFT on paired C/Rust solutions derived from LeetCode problems to teach direct semantic translation. We evaluate the resulting model using the agentic, static-analysis-guided verification framework of SACTOR, which performs structure-aware, two-phase (unidiomatic to idiomatic) translation with foreign-function-interface (FFI)-based end-to-end (E2E) testing. We report success rate, idiomaticity (Clippy lint counts, unsafe-code fraction), and failure-mode analyses, and compare our fine-tuned model against baseline Qwen3-27B and other LLMs evaluated under the same framework.

Explore related subjects

Keep this discovery

BibTeXRIS

Pu Zhao, Changdi Yang, Yixiao Chen, Yi Gao, Yifan Cao, Haochen Zeng, Yanzhi Wang. 2026-08-13. Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT. https://arxiv.org/abs/2608.13681

Cite the original work for its findings. Save a collection to share your selection of sources.

Discover connections

Connections use source metadata and explicit phrase matches, not verified experimental comparisons.

KEEP EXPLORING

Related discoveries

Augmenting software engineering with AI - The ai4se taxonomy and its use

Although model-driven software engineering (MDSE) has proven effective in managing complex systems, its industrial adoption remains limited by the substantial maintenance overhead required for models and the specialised skills demanded of developers. Meanwhile, advances in artificial intelligence (AI), particularly generative and agentic AI, have shown great promise in automating code-related tasks such as comprehension, generation, and defect detection. These capabilities are largely powered by 'big code': vast repositories of open-source software that now form the basis of data-driven, empirical SE and automated quality assurance. This paper aims to synthesise these two domains by exploring the integration of AI into model-driven practices. It provides a comprehensive overview of the current state of AI-augmented software engineering and introduces a novel taxonomy 'ai4se' to classify and connect diverse AI applications within the field. On this basis, the paper proposes a vision for 'big models' in software engineering (SE), an approach designed to leverage the structural advantages of MDSE alongside the scalability of AI. Finally, the paper discusses the pair modelling paradigm as a collaborative framework for the MDSE industry, designed to enhance software quality through human-AI partnership.

cs.SE

Emergent Behavior and Uncertainty in IoT-Enhanced Business Processes: Challenges and Future Directions

IoT-enhanced business processes are characterized by high complexity due to heterogeneous actors, varying levels of autonomy among participating systems, continuously evolving execution contexts spanning the digital and physical worlds, and continuous event streams. In such settings, process behavior partially emerges only at runtime through complex interactions involving humans, IoT devices, physical objects, software systems, agents, and services. This complexity introduces partial observability, uncertainty, and runtime dynamics that are difficult to anticipate and that challenge traditional business process management (BPM) assumptions and systems. We discuss these challenges from three perspectives, addressing 1) uncertainty representation, 2) operationalization of IoT-enhanced processes, and 3) runtime management of emergent behavior. Based on a motivating scenario and an analysis of the state of the art, we identify open research gaps and outline short-, medium-, and long-term recommendations to shape a research agenda on emergent behavior in IoT-enhanced business processes.

cs.ET

Simulation-Based Evaluation of Energy-Constrained Quantum-Classical Competition

This paper develops a simulation-based framework for evaluating the energy implications of quantum and classical computing firms competing in a market with limited energy resources. We model providers as differentiated Cournot competitors whose feasible service capacity is induced by technology-specific energy scaling laws: polylogarithmic for quantum algorithms that achieve an equivalent computational target and polynomial for classical emulation. For symmetric groups of quantum and classical firms, the equilibrium reduces to a tractable two-equation system that supports large scenario sweeps over market size, technology mix, and hardware coefficients. We characterize the capacity-constrained Nash equilibrium, prove the existence of a demand scale beyond which quantum service becomes more energy efficient, and report numerical experiments calibrated to trapped-ion and Rydberg platforms. The results identify when quantum energy advantage is only asymptotic and when it becomes operationally relevant.

quant-ph