{"type":"ScholarlyArticle","title":"Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization","authors":[{"name":"Yuhan Wu","slug":"yuhan-wu","given":"Yuhan","family":"Wu","affiliation":""},{"name":"Huan Zhang","slug":"huan-zhang","given":"Huan","family":"Zhang","affiliation":""},{"name":"Wei Cheng","slug":"wei-cheng","given":"Wei","family":"Cheng","affiliation":""},{"name":"Chen Shen","slug":"chen-shen","given":"Chen","family":"Shen","affiliation":""},{"name":"Jingyue Yang","slug":"jingyue-yang","given":"Jingyue","family":"Yang","affiliation":""},{"name":"Wei Hu","slug":"wei-hu","given":"Wei","family":"Hu","affiliation":""}],"abstract":"LLMs have shown immense potential for code translation, yet they often struggle to ensure both syntactic correctness and semantic consistency. While preference-based learning offers a promising alignment strategy, it is hindered by unreliable semantic rewards derived from sparse test cases or restrictive reference translations. We argue that a robust semantic reward for code translation must be derived directly from the source code. In this paper, we propose CTO to improve code translation with syntax-guided and semantic-aware preference optimization. \r\nThrough contrastive learning, we train a cross-lingual semantic model to directly assess functional equivalence between source and translated code. By formulating code translation as a multi-objective optimization problem, this robust semantic signal is seamlessly unified with compiler-based syntactic feedback within the direct preference optimization framework. Extensive experiments on C++, Java, and Python translations demonstrate that CTO significantly outperforms existing baselines and alternative preference optimization strategies.","doi":"10.24963/ijcai.2026/665","url":"https://ijcai.org/proceedings/2026/665","pdf":"https://ijcai.org/proceedings/2026/0665.pdf","markdown":"https://ijcai.org/proceedings/2026/665.md","bibtex":"https://ijcai.org/proceedings/2026/bibtex/665","volume":{"slug":"2026","title":"Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence","short_title":"IJCAI 2026","url":"https://ijcai.org/proceedings/2026/","year":2026,"location":"Bremen, Germany","dates":"15-21 August 2026","editors":"Diego Calvanese","isbn":"978-1-956792-09-6","publisher":"International Joint Conferences on Artificial Intelligence Organization","doi_prefix":"10.24963/ijcai.2026"},"section":"Natural Language Processing","track":"Main Track","number":665,"pages":{"first":5973,"last":5981},"keywords":["Natural Language Processing: Machine translation and multilinguality","Natural Language Processing: Applications"],"videos":[],"references":[],"license_note":"Copyright International Joint Conferences on Artificial Intelligence."}