CoreGen: Contextualized Code Representation Learning for Commit Message Generation

Lun Yiu Nie, Cuiyun Gao, Zhicong Zhong, Wai Lam, Yang Liu +1 more
7/14/2020
cs.CLcs.LGcs.SE

Official code: Flitternie/CoreGen (6 stars, Python, MIT, last commit 2021-07-31).

Abstract

Automatic generation of high-quality commit messages for code commits can substantially facilitate software developers' works and coordination. However, the semantic gap between source code and natural language poses a major challenge for the task.

Show full abstract

Several studies have been proposed to alleviate the challenge but none explicitly involves code contextual information during commit message generation. Specifically, existing research adopts static embedding for code tokens, which maps a token to the same vector regardless of its context. In this paper, we propose a novel Contextualized code representation learning strategy for commit message Generation (CoreGen). CoreGen first learns contextualized code representations which exploit the contextual information behind code commit sequences. The learned representations of code commits built upon Transformer are then fine-tuned for downstream commit message generation. Experiments on the benchmark dataset demonstrate the superior effectiveness of our model over the baseline models with at least 28.18% improvement in terms of BLEU-4 score. Furthermore, we also highlight the future opportunities in training contextualized code representations on larger code corpus as a solution to low-resource tasks and adapting the contextualized code representation framework to other code-to-text generation tasks.

View on arXivView PDF

Code Implementations(1)

Flitternie/CoreGenOfficial100%
MIT

CoreGen: Contextualized Code Representation Learning for Commit Message Generation

61Python, PerlMay 25, 20205 years agoMIT

Similar Papers

Cite this paper

@article{nie2020coregen,
  title  = {CoreGen: Contextualized Code Representation Learning for Commit Message Generation},
  author = {Lun Yiu Nie and Cuiyun Gao and Zhicong Zhong and Wai Lam and Yang Liu and Zenglin Xu},
  year   = {2020},
  eprint = {2007.06934},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2007.06934}
}

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/2007.06934.svg)](https://codeofpaper.com/paper/2007.06934)

Discussion