Function-to-Style Guidance of LLMs for Code Translation
원문 초록
Large language models (LLMs) have made significant strides in code translation tasks. However, ensuring both the correctness and readability of translated code remains a challenge, limiting their effective adoption in real-world software development. In this work, we propose F2STrans, a function-to-style guiding paradigm designed to progressively improve the performance of LLMs in code translation. Our approach comprises two key stages: (1) Functional learning, which optimizes translation correctness using high-quality source-target code pairs mined from online programming platforms, and (2) Style learning, which improves translation readability by incorporating both positive and negative style examples. Additionally, we introduce a novel code translation benchmark that includes up-to-date source code, extensive test cases, and manually annotated ground-truth translations, enabling comprehensive functional and stylistic evaluations. Experiments on both our new benchmark and existing datasets demonstrate that our approach significantly improves code translation performance. Notably, our approach enables Qwen-1.5B to outperform prompt-enhanced Qwen-32B and GPT-4 on average across 20 diverse code translation scenarios.
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
Mutual-Supervised Learning for Sequential-to-Parallel Code Translation
Guaranteed Guess: A Language Modeling Approach for CISC-to-RISC Transpilation with Testing Guarantees
LEGO-Compiler: Enhancing Neural Compilation Through Translation Composability
On-Policy Optimization with Group Equivalent Preference for Multi-Programming Language Understanding
LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Study
Collaboration is all you need: LLM Assisted Safe Code Translation
토론
이 논문과 연결된 포럼 글이 아직 없습니다.