Unified Pre-training for Program Understanding and Generation

Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei Chang
3/10/2021
1,001 citations
cs.CLcs.PL

Official code: wasiahmad/PLBART (186 stars, Python, MIT, last commit 2022-03-01).

Abstract

Code summarization and generation empower conversion between programming language (PL) and natural language (NL), while code translation avails the migration of legacy code from one PL to another. This paper introduces PLBART, a sequence-to-sequence model capable of performing a broad spectrum of program and language understanding and generation tasks.

Show full abstract

PLBART is pre-trained on an extensive collection of Java and Python functions and associated NL text via denoising autoencoding. Experiments on code summarization in the English language, code generation, and code translation in seven programming languages show that PLBART outperforms or rivals state-of-the-art models. Moreover, experiments on discriminative tasks, e.g., program repair, clone detection, and vulnerable code detection, demonstrate PLBART's effectiveness in program understanding. Furthermore, analysis reveals that PLBART learns program syntax, style (e.g., identifier naming convention), logical flow (e.g., if block inside an else block is equivalent to else if block) that are crucial to program semantics and thus excels even with limited annotations.

View on arXivView PDF

Code Implementations(1)

wasiahmad/PLBARTOfficial100%
MIT

Official code of our work, Unified Pre-training for Program Understanding and Generation [NAACL 2021].

18635Python, ShellMar 10, 20214 years agoMIT
code-intelligencelanguage-modelnlpprogramming-languagerepresentation-learning

Similar Papers

Cite this paper

@article{ahmad2021unified,
  title  = {Unified Pre-training for Program Understanding and Generation},
  author = {Wasi Uddin Ahmad and Saikat Chakraborty and Baishakhi Ray and Kai-Wei Chang},
  year   = {2021},
  eprint = {2103.06333},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.06333}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.06333.svg)](https://codeofpaper.com/paper/2103.06333)

Discussion