Recent advances in self-supervised learning have dramatically improved the state of the art on a wide variety of tasks. However, research in language model pre-training has mostly focused on natural languages, and it is unclear whether models like BERT and its variants provide the best pre-training when applied to other modalities, such as source code. In this paper, we introduce a new pre-training objective, DOBF, that leverages the structural aspect of programming languages and pre-trains a model to recover the original version of obfuscated source code. We show that models pre-trained with DOBF significantly outperform existing approaches on multiple downstream tasks, providing relative improvements of up to 13% in unsupervised code translation, and 24% in natural language code search. Incidentally, we found that our pre-trained model is able to de-obfuscate fully obfuscated source files, and to suggest descriptive variable names.
翻译:自我监督学习的最新进展极大地改善了多种任务的最新水平。 但是,语言模式预培训前研究大多侧重于自然语言,不清楚像BERT及其变体这样的模型在应用到源代码等其他模式时是否提供了最佳的预培训。 在本文中,我们引入了新的培训前目标,即DOBF, 利用编程语言的结构方面和编程前的模型来恢复原始版本的模糊源代码。 我们显示,在DOBF培训的模型大大优于现有多下游任务的方法,提供了高达13%的未经监督的代码翻译的相对改进,以及24%的自然语言代码搜索。 顺便提一下,我们发现,我们经过培训的模型能够去除完全模糊的源文档,并提出描述性变量。