Skip to main content
QUICK REVIEW

[论文解读] CodeTrans: Towards Cracking the Language of Silicon's Code Through Self-Supervised Deep Learning and High Performance Computing

Ahmed Elnaggar, Wei Ding|arXiv (Cornell University)|Apr 6, 2021
Software Engineering ResearchComputer Science被引用 21
一句话总结

CodeTrans 提出了一种用于软件工程任务的自监督编码器-解码器 Transformer 模型,通过迁移学习和高性能计算,在六个任务和十三个子任务中均超越了当前最先进模型。其通过微调的多任务学习实现卓越性能,并发布了预训练模型以加速未来研究。

ABSTRACT

Currently, a growing number of mature natural language processing applications make people's life more convenient. Such applications are built by source code - the language in software engineering. However, the applications for understanding source code language to ease the software engineering process are under-researched. Simultaneously, the transformer model, especially its combination with transfer learning, has been proven to be a powerful technique for natural language processing tasks. These breakthroughs point out a promising direction for process source code and crack software engineering tasks. This paper describes CodeTrans - an encoder-decoder transformer model for tasks in the software engineering domain, that explores the effectiveness of encoder-decoder transformer models for six software engineering tasks, including thirteen sub-tasks. Moreover, we have investigated the effect of different training strategies, including single-task learning, transfer learning, multi-task learning, and multi-task learning with fine-tuning. CodeTrans outperforms the state-of-the-art models on all the tasks. To expedite future works in the software engineering domain, we have published our pre-trained models of CodeTrans. https://github.com/agemagician/CodeTrans

研究动机与目标

  • 解决软件工程中源代码理解这一研究不足的领域。
  • 探索编码器-解码器 Transformer 架构在多样化软件工程任务中的有效性。
  • 评估并比较多种训练策略,包括单任务学习、迁移学习、多任务学习以及微调的多任务学习。
  • 开发一种高性能、可泛化的模型,用于代码相关自然语言处理任务。
  • 发布预训练的 CodeTrans 模型,以加速未来在软件工程和代码理解领域的研究。

提出的方法

  • 该模型采用基于 Transformer 的编码器-解码器架构,在大规模代码语料上通过自监督学习进行预训练。
  • 在预训练过程中应用掩码语言建模和下一个词预测目标,以学习代码的语义和语法表示。
  • 该模型在六个主要软件工程任务上进行微调,包括代码摘要生成、代码翻译和缺陷检测。
  • 系统性地评估了多种训练策略——单任务学习、迁移学习、多任务学习以及微调的多任务学习。
  • 使用高性能计算基础设施对模型进行大规模训练和验证。
  • 公开发布预训练模型,以支持下游研究和模型适配。

实验结果

研究问题

  • RQ1编码器-解码器 Transformer 模型能否在多样化软件工程任务中实现有效泛化?
  • RQ2在代码理解任务中,与单任务学习和迁移学习相比,微调的多任务学习表现如何?
  • RQ3在大规模代码数据上进行自监督预训练,对下游软件工程任务性能的提升程度如何?
  • RQ4架构设计和训练策略对代码相关自然语言处理任务中模型性能的影响是什么?
  • RQ5统一的预训练模型能否在多个代码相关任务中实现最先进性能?

主要发现

  • CodeTrans 在所有六个主要软件工程任务及其十三个子任务中均超越了所有最先进模型。
  • 微调的多任务学习在所有评估任务中均取得最高性能。
  • 与先前方法相比,该模型在代码摘要生成、代码翻译和缺陷检测任务中实现了显著性能提升。
  • 在大规模代码数据上进行自监督预训练,使模型在多样化任务中具备强大的泛化能力。
  • 公开发布的预训练 CodeTrans 模型可加速下游软件工程应用的微调过程,提升效率。
  • 该模型表现出强大的迁移能力,在不同编程语言和任务类型中均展现出一致的性能增益。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。