arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2310.11476cs.SEcs.LG
收藏

通过代码蒸馏进行程序翻译

Program Translation via Code Distillation

Microsoft Cloud and AI(微软云计算与人工智能部门);School of Artificial Intelligence, Jilin University(吉林大学人工智能学院);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学)

Yufan Huang, Mengnan Qi, Yongqiang Yao, Maoquan Wang, Bin Gu, Colin Clement, Neel Sundaresan

AI总结:

提出CoDist模型,通过语言无关的中间表示捕获代码语义与结构等价性,生成可扩展的平行语料库,在CodeXGLUE和TransCoder GeeksForGeeks基准上实现最先进的程序翻译性能。

摘要:

软件版本迁移和程序翻译是大型代码库生命周期中重要且昂贵的部分。传统的机器翻译依赖平行语料库进行监督翻译,但由于缺乏对齐数据,这对于程序翻译是不可行的。最近的无监督神经机器翻译技术通过引入反向翻译和底层编译器中间表示(IR)等技术克服了数据限制。由于代码片段对齐中的噪声和IR的多样性,这些方法面临重大挑战。在本文中,我们提出了一种名为Code Distillation(CoDist)的新模型,通过该模型我们在语言无关的中间表示中捕获代码的语义和结构等价性。蒸馏代码作为任何编程语言的翻译枢纽,通过构建生成平行语料库,只需应用蒸馏编译器即可扩展到所有可用源代码。我们证明,我们的方法在CodeXGLUE和TransCoder GeeksForGeeks翻译基准上实现了最先进的性能,与TransCoder-ST相比,在TransCoder GeeksforGeeks翻译基准上平均绝对提升12.7%。

英文摘要:

Software version migration and program translation are an important and costly part of the lifecycle of large codebases. Traditional machine translation relies on parallel corpora for supervised translation, which is not feasible for program translation due to a dearth of aligned data. Recent unsupervised neural machine translation techniques have overcome data limitations by included techniques such as back translation and low level compiler intermediate representations (IR). These methods face significant challenges due to the noise in code snippet alignment and the diversity of IRs respectively. In this paper we propose a novel model called Code Distillation (CoDist) whereby we capture the semantic and structural equivalence of code in a language agnostic intermediate representation. Distilled code serves as a translation pivot for any programming language, leading by construction to parallel corpora which scale to all available source code by simply applying the distillation compiler. We demonstrate that our approach achieves state-of-the-art performance on CodeXGLUE and TransCoder GeeksForGeeks translation benchmarks, with an average absolute increase of 12.7% on the TransCoder GeeksforGeeks translation benchmark compare to TransCoder-ST.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑