{"title":"Using Large Language Models for multi-level commit message generation for large diffs","authors":"Abhishek Kumar , Sandhya Sankar , Partha Pratim Das , Partha Pratim Chakrabarti","doi":"10.1016/j.infsof.2025.107831","DOIUrl":null,"url":null,"abstract":"<div><div>Commit messages play a crucial role in version control systems, providing essential context and explanations for changes made to the codebase. Despite their importance, many commit messages are poorly written or entirely missing, leading to challenges in code comprehension, bug tracking, and project maintenance. This paper addresses two significant issues in existing automated commit message generation approaches: the limitations of using datasets with short token lengths and the reliance on a single commit message for multiple file changes. To overcome these challenges, we generate commit messages for diffs with larger token lengths, using the latest Large Language Models, including GPT-4o, Llama 3.1 70B & 8B, and Mistral Large. For evaluation, we conduct automatic assessments using metrics such as BLEU, ROUGE, METEOR, and CIDEr, as well as a human evaluation. Our findings indicate that GPT-4o and Llama 3.1 70B emerge as the best models for generating commit messages. Additionally, we propose a two-level approach that generates both an overall commit message and file-specific messages for each file change. To validate this approach, we surveyed developers to understand the problems they face with current commit messages and gather their feedback on our two-level approach. Our survey indicates that the two-level approach is effective and helps developers better understand complex and lengthy code diffs.</div></div>","PeriodicalId":54983,"journal":{"name":"Information and Software Technology","volume":"187 ","pages":"Article 107831"},"PeriodicalIF":3.8000,"publicationDate":"2025-07-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information and Software Technology","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0950584925001703","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0
Abstract
Commit messages play a crucial role in version control systems, providing essential context and explanations for changes made to the codebase. Despite their importance, many commit messages are poorly written or entirely missing, leading to challenges in code comprehension, bug tracking, and project maintenance. This paper addresses two significant issues in existing automated commit message generation approaches: the limitations of using datasets with short token lengths and the reliance on a single commit message for multiple file changes. To overcome these challenges, we generate commit messages for diffs with larger token lengths, using the latest Large Language Models, including GPT-4o, Llama 3.1 70B & 8B, and Mistral Large. For evaluation, we conduct automatic assessments using metrics such as BLEU, ROUGE, METEOR, and CIDEr, as well as a human evaluation. Our findings indicate that GPT-4o and Llama 3.1 70B emerge as the best models for generating commit messages. Additionally, we propose a two-level approach that generates both an overall commit message and file-specific messages for each file change. To validate this approach, we surveyed developers to understand the problems they face with current commit messages and gather their feedback on our two-level approach. Our survey indicates that the two-level approach is effective and helps developers better understand complex and lengthy code diffs.
期刊介绍:
Information and Software Technology is the international archival journal focusing on research and experience that contributes to the improvement of software development practices. The journal''s scope includes methods and techniques to better engineer software and manage its development. Articles submitted for review should have a clear component of software engineering or address ways to improve the engineering and management of software development. Areas covered by the journal include:
• Software management, quality and metrics,
• Software processes,
• Software architecture, modelling, specification, design and programming
• Functional and non-functional software requirements
• Software testing and verification & validation
• Empirical studies of all aspects of engineering and managing software development
Short Communications is a new section dedicated to short papers addressing new ideas, controversial opinions, "Negative" results and much more. Read the Guide for authors for more information.
The journal encourages and welcomes submissions of systematic literature studies (reviews and maps) within the scope of the journal. Information and Software Technology is the premiere outlet for systematic literature studies in software engineering.