KADEL: Knowledge-Aware Denoising Learning for Commit Message Generation

Wei Tao, Yucheng Zhou, Yanlin Wang, Hongyu Zhang, Haofen Wang, Wenqiang Zhang · DOI

Abstract

Automated commit message generation is often hampered by the prevalence of low-quality, unstructured training data. This paper introduces KADEL (Knowledge-Aware DEnoising Learning), a framework designed to improve message quality by leveraging a small fraction of high-quality, rule-following commits. By using a specialized Knowledge Model to pseudo-label messy datasets and a dynamic denoising training strategy, KADEL achieves state-of-the-art results across five major programming languages, outperforming both specialized baselines and general-purpose models like ChatGPT.

The Problem: Garbage In, Garbage Out

Writing clear commit messages is essential for software maintenance, yet many developers neglect this task. This results in training datasets filled with vague or context-free messages. While some commits follow strict guidelines like the AngularJS rule—requiring a Type (e.g., fix), a Scope (component), and a Subject (summary)—these "gold standard" samples are rare. The challenge is to effectively utilize this small sliver of structured data to train models on the vast majority of unstructured data.

The MCMD Dataset

The researchers evaluated KADEL using the Multi-language Commit Message Dataset (MCMD), which contains 450,000 commit pairs for JavaScript, C#, Python, C++, and Java. As shown in the data distribution below, the proportion of commits that naturally match the AngularJS rule is extremely low for most languages, often falling below 1%.

Distribution of rule-matching commits across languages in the MCMD dataset.

Methodology: KADEL

KADEL employs a three-stage approach to bridge the gap between structured and unstructured data:

  1. Commit Knowledge Modeling: A CodeT5-based model is trained exclusively on rule-matched commits to learn the relationship between code changes and their metadata (Type and Scope).
  2. Large-Scale Data Labeling: This model "pseudo-labels" the remaining millions of low-quality commits, providing estimated Type and Scope tags.
  3. Dynamic Denoising Training: To handle errors in pseudo-labels, KADEL uses an Expectation-Maximization (EM) algorithm to model training loss. It dynamically down-weights samples likely to have incorrect labels, focusing the model on cleaner data.

Teaching the Model to Fish

A key architectural insight of KADEL is that injecting knowledge into the decoder is significantly more effective than the encoder. By requiring the model to generate the Type and Scope before the Subject, it is forced to internalize the logic of the code change rather than just being "given" the answer in the input.

Ablation study showing the impact of including Type and Scope in the decoder output on model performance.

As seen in the ablation study above, including all three components (Type, Scope, and Subject) in the decoder output leads to the highest performance across all metrics, validating the "teaching to fish" approach.

Key Results and Insights

KADEL established a new state-of-the-art (SOTA) performance across multiple dimensions:

  • Quantitative Performance: KADEL improved BLEU-Norm by 20.07%, METEOR by 12.92%, and ROUGE-L by 24.66% over previous best-in-class models.
  • Human Evaluation: In blind tests, expert developers rated KADEL's messages significantly higher in content adequacy (+121%), conciseness (+59%), and expressiveness (+58%) compared to baselines.
  • Efficiency: Despite being a smaller, specialized model (CodeT5, ~220M parameters), KADEL outperformed general-purpose giants like GPT-3.5 in domain-specific accuracy, particularly in identifying technical intent.

Conclusion

KADEL demonstrates that smart training strategies and domain-specific knowledge injection can outweigh the benefits of sheer model scale. By focusing on high-quality data subsets and denoising the remainder, KADEL provides a robust framework for automating one of the most neglected aspects of software development. Future work will explore applying this denoising framework to other software engineering tasks like bug reporting and automated commenting.

Summary updated

BibTeX
@article{tao2024kadel,
  author = {Wei Tao and Yucheng Zhou and Yanlin Wang and Hongyu Zhang and Haofen Wang and Wenqiang Zhang},
  title = {{KADEL: Knowledge-Aware Denoising Learning for Commit Message Generation}},
  journal = {ACM Trans. Softw. Eng. Methodol.},
  year = {2024},
  doi = {10.1145/3643675},
}
Figure