Code Needs Comments: Enhancing Code LLMs with Comment Augmentation

Demin Song, Honglin Guo, Yunhua Zhou, Shuhao Xing, Yudong Wang +6 more
2/20/2024
cs.CL

No confident code implementation found for this paper.

Abstract

The programming skill is one crucial ability for Large Language Models (LLMs), necessitating a deep understanding of programming languages (PLs) and their correlation with natural languages (NLs). We examine the impact of pre-training data on code-focused LLMs' performance by assessing the comment density as a measure of PL-NL alignment. Given the scarcity of code-comment aligned data in pre-training corpora, we introduce a novel data augmentation method that generates comments for existing code, coupled with a data filtering strategy that filters out code data poorly correlated with natural language. We conducted experiments on three code-focused LLMs and observed consistent improvements in performance on two widely-used programming skill benchmarks. Notably, the model trained on the augmented data outperformed both the model used for generating comments and the model further trained on the data without augmentation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{song2024code,
  title  = {Code Needs Comments: Enhancing Code LLMs with Comment Augmentation},
  author = {Demin Song and Honglin Guo and Yunhua Zhou and Shuhao Xing and Yudong Wang and Zifan Song and Wenwei Zhang and Qipeng Guo and Hang Yan and Xipeng Qiu and Dahua Lin},
  year   = {2024},
  eprint = {2402.13013},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.13013v1}
}

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

Discussion