Brevity is the Soul of Wit: Condensing Code Changes to Improve Commit Message Generation Conference: 16th International Conference on Internetware; June 2025; Trondheim, Norway Conference: the 16th International Conference on Internetware; June 20–22, 2025; Trondheim, Norway the 16th International C
Hongyu Kuang, Ning Zhang, Hui Gao, Xin Zhou, Wesley K. G. Assunção, Xiaoxing Ma, Dong Shao, Guoping Rong, He Zhang · 2025
Read Brevity is the Soul of Wit: Condensing Code Changes to Improve Commit Message Generation Conference: 16th International Conference on Internetware; June 2025; Trondheim, Norway Conference: the 16th International Conference on Internetware; June 20–22, 2025; Trondheim, Norway the 16th International C by Hongyu Kuang, Ning Zhang, Hui Gao, Xin Zhou, Wesley K. G. Assunção, Xiaoxing Ma, Dong Shao, Guoping Rong, He Zhang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-15567.txt.
Introduction
Hongyu Kuang leads a team that writes better commit notes for code changes. A commit note tells why a change was made, and good notes ease upkeep. In practice, coders often skip or skimp on them. Past auto writers focus on fancy ways to encode the change. This team instead squeeze the change into a brief text form first.
Their form has three parts: a summary of the change, comments drawn out of it, and key code names stressed. A rule based tool builds the form, and a code language model is then tuned to turn forms into notes. The brevity helps the model use its pre-training well. Tests support the plan.
Catalog record
| CREATOR | Hongyu Kuang, Ning Zhang, Hui Gao, Xin Zhou, Wesley K. G. Assunção, Xiaoxing Ma, Dong Shao, Guoping Rong, He Zhang |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 56 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2509-15567
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Brevity is the Soul of Wit: Condensing Code Changes to Improve Commit Message Generation Conference: 16th International Conference on Internetware; June 2025; Trondheim, Norway Conference: the 16th International Conference on Internetware; June 20–22, 2025; Trondheim, Norway the 16th International Conference on Internetware (Internetware 2025), June 20–22, 2025, Trondheim, Norway DOI: 10.1145/3755930.3755977 ISBN: 979-8-4007-1926-4/25/06 CCS: Software and its engineering Software maintenance tools Hongyu Kuang, Ning Zhang, Hui Gao, Xin Zhou, Wesley K. G. Assunção, Xiaoxing Ma, Dong Shao, Guoping Rong, He Zhang Abstract . Commit messages are valuable resources for describing why code changes are committed to repositories in version control systems (e.g., Git). They effectively help developers understand code changes and better perform software maintenance tasks. Unfortunately, developers often neglect to write high-quality commit messages in practice. Therefore, a growing body of work is proposed to generate commit messages automatically. These works all demonstrated that how to organize and represent code changes is vital in generating good commit messages, including the use of fine-grained graphs or embeddings to better represent code changes. In this study, we choose an alternative way to condense code changes before generation, i.e., proposing brief yet concise text templates consisting of the following three parts: (1) summarized code changes, (2) elicited comments, and (3) emphasized code identifiers. Specifically, we first condense code changes by using our proposed templates with the help of a heuristic-based tool named ChangeScribe, and then fine-tune CodeLlama-7B on the pairs of our proposed templates and corresponding commit messages. Our proposed templates better utilize pre-trained language models, while being naturally brief and readable to complement generated commit messages for developers. Our evaluation based on a widely used dataset showed that our approach can outperform six baselines in terms of BLEU-Norm, METEOR, and ROUGE-L, with average improvements of 51.7%, 78.7%, and 62.5%, respectively. The ablation study and human evaluation also provide further insights into the effectiveness of our approach. 1. Introduction Online collaboration platforms, such as GitHub ( Git 2024 ) have become the vital infrastructure for modern software development. GitHub allows intense collaborative activities with multiple developers to achieve better efficiency and fewer errors ( Whitehead 2007 ) . When developers send code changes in the repository of their project, they are suggested to also upload a brief commit message to describe the purpose of the change. 1 1 1 See documentation: https://git-scm.com/docs/git-commit These messages help developers understand the rationale behind code modifications, significantly reducing code comprehension time ( Kajko-Mattsson 2005 ) and facilitating software maintenance tasks ( Buse and Weimer 2010 ) . For example, Figure 1 depicts a complete code change of updating a constructor method of class RequestParams , including related comments and annotations. The developer also provides a concise commit message succinctly explaining that the update aims to provide the convenience of variable arguments for the constructor. Without the commit message depicted in the figure, other developers would have to go through each modified code statement, along with its associated comments and annotations, to infer the purpose of the changes. Figure 1. Code diff example Despite the importance of commit messages, developers often neglect to provide high-quality descriptions due to time constraints ( Dyer et al. 2013 ) and the overwhelming workload beyond coding tasks ( Maalej and Happel 2010 ) . This issue is particularly prevalent in large-scale software projects ( Dyer et al. 2013 ) . To address the dilemma between the need for informative commit messages and developers’ burdens to manually write those, a growing body of work has been proposed to automatically generate commit messages. Early approaches relied on rule-based methods that summarize code changes through program analysis ( Buse and Weimer 2010 ; Cortes-Coy et al. 2014a ) . These methods generate human-readable reports detailing what changed and where, but often failing to capture the developer’s intent and being verbose when dealing with large code modifications. To address this issue, Jiang et al. ( Jiang et al. 2017a ) introduced neural machine translation (NMT) models to generate purpose-oriented commit messages by leveraging existing high-quality code commits that include both code changes and human-written messages. This work transformed commit message generation (CMG) into a sequence-to-sequence (Seq2Seq) task, leading to further proposed retrieval-based ( Liu et al. 2018b ) , enhanced translation-based ( Dong et al. 2022 ) , and hybrid approaches ( He et al. 2023a ) . According to these work, Seq2Seq models are effective in bridging the semantic gap between code changes and their corresponding human-written descriptions. Consequently, the representation of code changes becomes vital to their performance of generating commit messages. Particularly, Liu et al. ( Liu et al. 2018b ) emphasized the importance of carefully pre-processing code changes to improve generation quality. Follow-on approaches choose to employ fine-grained representations, such as code-change graphs ( Dong et al. 2022 ) and modification embeddings ( He et al. 2023a ) , to better capture and describe code modifications. Recently, large language models (LLMs) are also explored to directly generate commit messages from code changes ( Tao et al. 2024 ) , while Li et al. ( Li et al. 2024a ) introduced additional change contexts as enhancements. Despite the achieved progress, automated commit message generation still faces challenges for better performance. The widely used fine-grained representations, i.e., packing code changes as sequential text inputs for word embeddings ( Xu et al. 2019 ; Liu et al. 2019 ; Nie et al. 2021a ) or composing those with augmented abstract syntax trees (ASTs) to highlight edit operations ( Dong et al. 2022 ; He et al. 2023b ) , often contain substantial redundant information, resulting in excessively long input sequences. This situation significantly increases the complexity of the task for Seq2Seq models because they have to first “comprehend” the content of changes before converting them into the rationale for modifications, trying to cover the semantic gaps between code changes and commit messages. Moreover, the vital parts of code changes for comprehending the intents of code, such as comments and identifiers of methods and classes ( Ali et al. 2015 ) , are unfortunately not emphasized in the discussed fine-grained representations, thus also hindering the generation good commit messages. To cope with the discussed issues, we propose our approach for commit message generation called CONTENT ( C ondensing c O de cha N ges for commi T m E ssage ge N era T ion ). Our approach introduces a customized template as the model input, comprising three key components: (1) summarized code changes, (2) elicited comments, and (3) emphasized code identifiers. By transforming code changes into more comprehensible descriptions and supplementing them with explanatory comments and highlighted identifiers, our approach bridges the semantic gap between code modifications and commit messages by reducing the complexity of understanding code changes for Seq2Seq models, thereby enhancing the overall performance of commit message generation. Specifically, we adapt and enhance the output of ChangeScribe ( Cortes-Coy et al. 2014b ) to provide a concise summary of what changed and where the changes occurred, instead of using the original code Diffs (i.e., typically long sequences that begin with “-” or “+”). The summarized code changes in the template (introduced in Section 3.1.1 ) focus on changes in classes and methods,