一句话:提出 SDA-Trans,融合语法结构与领域知识,在小规模语料上提升无监督程序翻译和跨语言迁移能力。
并行代码语料稀缺,人工收集双语数据成本高昂;现有无监督程序翻译系统仍依赖大规模单语源代码训练,且难以翻译预训练阶段未见过的语言。本文提出 SDA-Trans,一种语法与领域感知的模型,通过利用语法结构和领域知识增强跨语言迁移能力。该方法在规模较小的 Python 和 Java 单语程序语料上进行无监督训练。在 Python、Java、C++ 之间的函数翻译任务上,实验表明 SDA-Trans 优于许多大规模预训练模型,尤其在对未见语言的翻译上表现更好。
There is growing interest in software migration as the development of software and society. Manually migrating projects between languages is error-prone and expensive. In recent years, researchers have begun to explore automatic program translation using supervised deep learning techniques by learning from large-scale parallel code corpus. However, parallel resources are scarce in the programming language domain, and it is costly to collect bilingual data manually. To address this issue, several unsupervised programming translation systems are proposed. However, these systems still rely on huge monolingual source code to train, which is very expensive. Besides, these models cannot perform well for translating the languages that are not seen during the pre-training procedure. In this paper, we propose SDA-Trans, a syntax and domain-aware model for program translation, which leverages the syntax structure and domain knowledge to enhance the cross-lingual transfer ability. SDA-Trans adopts unsupervised training on a smaller-scale corpus, including Python and Java monolingual programs. The experimental results on function translation tasks between Python, Java, and C++ show that SDA-Trans outperforms many large-scale pre-trained models, especially for unseen language translation.