arXiv:2608.13681v1 cs.SE

C-to-Rust 코드 번역을 위한 Qwen3-27B 미세조정: 사전학습, 디버깅 인식 SFT, 작업별 SFT의 3단계 커리큘럼

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

Pu Zhao, Changdi Yang, Yixiao Chen, Yi Gao, Yifan Cao, Haochen Zeng, Yanzhi Wang

제출 2026-08-13

한국어 초록

C 코드를 안전하고 관용적인 Rust로 번역하는 것은 레거시 시스템의 기능적 동작을 유지하면서 메모리 안전 취약점 전 클래스를 제거할 수 있기 때문에 오랜 소프트웨어 공학 목표이다. 대규모 언어 모델(LLM)은 이 작업에 가능성을 보여 왔지만, 범용 사전학습(pre-training)이 관용적 Rust 생성, 언어 간 의미적 동등성, 또는 컴파일러/런타임 피드백을 추론하고 수정하는 능력을 거의 강조하지 않기 때문에 상용 그대로 적용하면 일반적으로 성능이 낮다. 본 보고서에서는 C-to-Rust(C2Rust) 번역 작업에 점진적으로 특화되도록 설계된 Qwen3-27B에 적용한 3단계 미세조정 커리큘럼을 설명한다: (1) 관용적 Rust 문법 및 표준 라이브러리 사용에 대한 모델의 사전(prior)을 강화하기 위한 Rust 중심 말뭉치에 대한 지속적 사전학습; (2) Rust 코드에 대한 디버깅 및 자기 수리(self-repair) 행동을 주입하기 위한 microsoft/Verus_Training_Data 데이터셋에 대한 지도 미세조정(SFT); (3) 직접적인 의미적 번역을 가르치기 위한 LeetCode 문제에서 파생된 C/Rust 페어 솔루션에 대한 작업별 SFT. SACTOR의 에이전틱(agentic), 정적 분석 안내 검증 프레임워크를 사용하여 결과 모델을 평가하는데, 이는 구조 인식(structure-aware), 2단계(비관용적에서 관용적) 번역과 외부 함수 인터페이스(FFI) 기반 종단 간(E2E) 테스트를 수행한다. 성공률, 관용성(Clippy lint 개수, unsafe 코드 비율), 실패 모드 분석을 보고하고, 동일 프레임워크에서 평가한 기준선 Qwen3-27B 및 기타 LLM과 미세조정 모델을 비교한다.

원문 초록

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.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2608.13681v1제출 시각 미확인

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.