NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Evaluating Generated Commit Messages with Large Language Models

Qunhong Zeng, Yuxia Zhang, Zexiong Ma, Bo Jiang, Ningyuan Sun, Klaas-Jan Stol, Xingyu Mou, Hui LiuarXiv 2025 · DOI

Abstract

Evaluating the quality of automatically generated commit messages has long been a bottleneck in software engineering, relying on either "dumb" string-matching metrics or expensive human review. This paper demonstrates that Large Language Models (LLMs), specifically GPT-4 using Chain-of-Thought and few-shot prompting, can evaluate commit messages with near-human proficiency, offering a scalable and cost-effective alternative to manual assessment.

The Evaluation Bottleneck

In version control, a high-quality commit message explains both the "What" (the technical change) and the "Why" (the rationale). While AI-driven generation of these messages has improved significantly, automated evaluation remains a challenge.

Traditional metrics like BLEU or ROUGE-L measure lexical overlap—essentially counting shared words between an AI's message and a developer's reference. This approach suffers from the "One-to-Many Problem," where a single code change can be described accurately in many different ways, and "Semantic Blindness," where string-matching fails to understand the underlying logic of a bug fix. Consequently, researchers often resort to slow and expensive human expert grading.

A survey of evaluation methods in existing commit message generation literature.

Methodology

The authors investigated whether LLMs could act as "automated judges," testing four state-of-the-art models: GPT-4, Llama-3.3-70B, Qwen2.5-72B, and QwQ-32B. To optimize performance, they experimented with several prompting strategies, including Chain-of-Thought (CoT) reasoning and Few-Shot Learning. They also compared unified evaluation (scoring "What" and "Why" together) against separate prompts.

The study utilized a benchmark of 400 commits (Python and Java) sampled from CommitBench. These LLM-based scores were then compared against a "gold standard" of 750 evaluations provided by six experienced human developers.

Key Results and Insights

The study found that LLMs effectively bridge the gap between automated metrics and human judgment. The best-performing configuration—GPT-4 with CoT and Few-Shot prompting—achieved a correlation with humans nearly identical to the agreement between two human developers.

Comparison of correlation coefficients between traditional metrics and LLM-based evaluation against human judgment.

Superior Correlation

As shown in the results table, GPT-4 achieved Spearman correlation coefficients of 0.65 for the "What" dimension and 0.78 for the "Why" dimension. In contrast, traditional metrics like BLEU scored as low as 0.08 and 0.10. LLMs particularly shine in evaluating the rationale ("Why") because they can interpret the code diff rather than just matching text.

Efficiency and Cost

Human evaluation of the 800 messages took approximately six days. The LLM-based evaluator completed the same task in under an hour. Furthermore, using the GPT-4 API cost roughly $0.08 per example, representing a massive reduction in both time and financial investment compared to senior developer labor.

Discussion and Limitations

While LLMs offer a robust alternative to traditional metrics, the authors noted some limitations. Even at low temperatures (0 to 0.25), LLMs exhibit non-determinism, suggesting that averaging scores from multiple runs may be necessary for high-precision tasks. Additionally, while no significant "self-preference" bias was found, the study focused on relatively small code diffs; massive, multi-file commits may still challenge the context windows and reasoning capabilities of current models. Future work may explore "ensemble evaluators" to further increase reliability.

Summary updated

BibTeX
@misc{zeng2025evaluating,
  author = {Qunhong Zeng and Yuxia Zhang and Zexiong Ma and Bo Jiang and Ningyuan Sun and Klaas-Jan Stol and Xingyu Mou and Hui Liu},
  title = {{Evaluating Generated Commit Messages with Large Language Models}},
  year = {2025},
  eprint = {2507.10906},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.10906},
}
Figure