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.
Auxiliary CycleGAN-guidance for Task-Aware Domain Translation from Duplex to Monoplex IHC Images
AstraZeneca Computational Pathology, Oncology Research and Development(阿斯利康肿瘤研发部计算病理学);AstraZeneca Translational Pathology, Oncology Research and Development(阿斯利康肿瘤研发部转化病理学)
Multi-Channel Attention Selection GAN with Cascaded Semantic Guidance for Cross-View Image Translation
University of Trento(特伦托大学);Texas State University(德克萨斯州立大学);University of Oxford(牛津大学);Huawei Technologies Ireland(华为技术爱尔兰公司);Northeastern University(东北大学);University of Michigan(密歇根大学)
Leveraging Unit Language Guidance to Advance Speech Modeling in Textless Speech-to-Speech Translation
Northeastern University(东北大学);The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳));Kunming University of Science and Technology(昆明理工大学);NiuTrans Research(牛翻译研究院)