mlsanityData to 14 Oct 2026

CoRaCMG: Contextual Retrieval-Augmented Framework for Commit Message Generation

arXiv 2509.18337 ↗First posted 22 Sep 2025cs.SEcited by 0

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Commit messages play a key role in documenting the intent behind code changes. However, they are often low-quality, vague, or incomplete, limiting their usefulness. Commit Message Generation (CMG) aims to automatically generate descriptive commit messages from code diffs to reduce developers' effort and improve message quality. Although recent advances in LLMs have shown promise in automating CMG, their performance remains limited. This paper aims to enhance CMG performance by retrieving similar diff-message pairs to guide LLMs to generate commit messages that are more precise and informative. We proposed CoRaCMG, a Contextual Retrieval-augmented framework for Commit Message Generation, structured in three phases: (1) Retrieve: retrieving the similar diff-message pairs; (2) Augment: combining them with the query diff into a structured prompt; and (3) Generate: generating commit messages corresponding to the query diff via LLMs. CoRaCMG enables LLMs to learn project-specific terminologies and writing styles from the retrieved diff-message pairs. We evaluated CoRaCMG across multiple LLMs (e.g., GPT, DeepSeek, and Qwen) and compared its performance against SOTA baselines. Experimental results show that CoRaCMG significantly boosts LLM performance across four metrics (BLEU, Rouge-L, METEOR, and CIDEr). Specifically, DeepSeek-R1 achieves relative improvements of 76% in BLEU and 71% in CIDEr when augmented with a single retrieved example pair. After incorporating the single example pair, GPT-4o achieves the highest improvement rate, with BLEU increasing by 89%. Moreover, performance gains plateau after more than three examples are used, indicating diminishing returns. Further analysis shows that the improvements are attributed to the model's ability to capture the terminologies and writing styles of human-written commit messages from the retrieved example pairs.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 13 of its 36 references that are in the map. First posted on arXiv 22 Sep 2025.

Builds on

13 of 36 references.

Closest ancestors · 2

Same direction, newest first

  1. 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair12 Sep
  2. 2022RACE: Retrieval-Augmented Commit Message Generation5 Mar

Other references · 11

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  3. 2023In-Context Retrieval-Augmented Language Modelscited by 702
  4. 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
  5. 2020CC2Vec: Distributed Representations of Code Changescited by 39
  6. 2019ATOM: Commit Message Generation Based on Abstract Syntax Tree and Hybrid Rankingcited by 25
  7. 2017A Neural Architecture for Generating Natural Language Descriptions from Source Code Changescited by 23
  8. 2022What Makes a Good Commit Message?cited by 20
  9. 2020CoreGen: Contextualized Code Representation Learning for Commit Message Generationcited by 15
  10. 2024Using Large Language Models for Commit Message Generation: A Preliminary Studycited by 10
  11. 2025Contextual Code Retrieval for Commit Message Generation: A Preliminary Studycited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026CoRaCommit: A VS Code Extension for Commit Message Generation with Exemplar Retrieval ↗
  2. 2024RAG-Enhanced Commit Message Generation
  3. 2025Evaluating Generated Commit Messages with Large Language Models
  4. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches
  5. 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
  6. 2025CodeFuse-CommitEval: Towards Benchmarking LLM's Power on Commit Message and Code Change Inconsistency Detection
  7. 2026Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation
  8. 2026Conventional Commit Classification using Large Language Models and Prompt Engineering