October 26, 2026
Automatic Generation of Commit Messages via Local LLM: evaluation based on GitHub repositories
Miguel Amaral; Elaine Barbosa de Figueiredo
DOI: 10.22167/2675-6528-202601237
Article prepared by the ResumeAI tool, an artificial intelligence solution developed by the Pecege Institute focused on synthesis and writing.
Summary
The absence of standards for commit messages in software projects compromised the traceability of the change history and widened the learning curve, with the adoption of structured standards showing potential to mitigate this problem. This work evaluated the ability of compact language models (LLMs), executed locally via Ollama, to generate commit messages adhering to the Conventional Commits standard, based on real code changes. The approach was developed to be relevant on low-processing power home machines and in corporate environments with privacy restrictions, with the entire pipeline containerized with Docker to ensure reproducibility. 400 commits were extracted from four public GitHub repositories (Angular, ESLint, OpenJS, and ViteJS) that followed the standard. The extraction was submitted to three models (Alibaba, DeepSeek, and IBM), and the results were evaluated by lexical similarity (ROUGE-L), semantic (BERTScore) metrics, and a metric developed for this study (CC-Score), which measured syntactic adherence. The results showed up to 98% adherence to the Conventional Commits standard for the IBM and Alibaba models. It was concluded that compact, code-specialized LLMs were capable of generating structurally adherent commit messages when adequately instructed, with performance conditioned by the model architecture and prompt design.
Keywords: BERTScore; CC-Score; Docker; Ollama; ROUGE-L.
1. Introduction
Large Language Models (LLMs) represent artificial intelligence systems trained on vast volumes of text and code, with the ability to understand and generate natural language and programming languages with remarkable fluency (Wei et al., 2022). Technological evolution has enabled the development of compact versions of these models, which can be executed locally, consuming a fraction of the computational resources typically required by large general-purpose models. This characteristic opens doors for applications in environments with hardware or privacy constraints.
In the context of software development, especially in Git-based version control systems, a commit is the fundamental unit for recording changes to the source code. Each commit is accompanied by a descriptive message, known as a commit message, which serves as an essential audit trail. These messages are crucial for effective team communication, facilitate code reviews, enable automatic generation of change logs, and assist in onboarding new developers to a project (Tian et al., 2022).
Despite its importance, the quality of commit messages in open-source code repositories is often inadequate. Empirical studies indicate that approximately fourteen percent of these messages are completely empty, sixty-six percent contain few words or fail to describe the reason for the changes, hindering long-term software maintenance and sometimes serving as the sole source of information for developers (Li and Ahmed, 2023). To mitigate this problem, the Conventional Commits standard (2024) was developed, establishing a structured and readable syntax for commit messages, which defines the type and scope of the change, followed by a concise description. This standard aims to standardize communication and improve traceability.
The gap lies in evaluating the capability of compact LLMs, executed locally, to generate commit messages that adhere to this structured pattern, based on real source code changes. The feasibility of such models in environments with limited computational resources or data privacy requirements, where cloud execution is not an option, is of great practical interest. The research is justified by the need for tools that automate the creation of high-quality commit messages, reducing manual effort and improving the consistency of software projects. Furthermore, the introduction of a specific metric to evaluate syntactic adherence, the CC-Score, complements lexical similarity (ROUGE-L) and semantic (BERTScore) evaluations, filling a gap in the literature. Given this scenario and the relevance of optimizing communication and traceability in development projects, the present work aimed to evaluate whether compact large language models (LLMs), executed locally via Ollama, are capable of generating commit messages adhering to the Conventional Commits standard, based on source code changes extracted from public GitHub repositories.
2. Material and Methods
The present work was classified, regarding its objectives, as descriptive-explanatory, seeking to describe the performance of Large Language Models (LLMs) in generating commit messages and explain the factors associated with the quality of the outputs. The nature of the data was defined as quantitative, employing reproducible numerical metrics. Regarding the design, it was framed as experimental research with algorithm implementation, according to the methodological guidelines (Prodanov and Freitas, 2013). There was no involvement of human participants at any stage of the study.
The full reproducibility of the work was ensured by containerizing the execution environment, using Docker, an open-source platform that allows packaging applications and their dependencies into isolated containers, guaranteeing that the execution environment is identical on any machine (Merkel, 2014). All scripts, dependencies, and configurations were packaged into a single image based on python:3.11-slim, with the Ollama server embedded, an open-source platform that allows downloading and running LLMs locally (Ollama, 2025).
The work was conducted using the following hardware configuration: an AMD Ryzen 5 8600G processor with Radeon 760M Graphics (12 CPUs, 4.4 GHz), 16,384 MB of RAM, and a 64-bit Windows 11 Pro operating system. The central criterion for selecting LLMs was specialization in source code. In the tests performed, it was only possible to run models with up to three billion parameters (3b) on the reported hardware configuration.
The selected language models were “qwen2.5-coder:1.5b” (Alibaba), “deepseek-coder:1.3b-instruct” (DeepSeek), and “granite-code:3b” (IBM). The evaluation dataset was composed of commits extracted from public GitHub repositories, selected based on the formal adoption of the Conventional Commits standard, ensuring that the messages constituted a high-quality “ground truth” for evaluation.
The repositories selected for the corpus composition were Angular, ESLint, OpenJS, and ViteJS, which use languages such as TypeScript, JavaScript, C++, and Python, and have a significant commit history. 100 commits were extracted via the GitHub REST API from each of the four selected repositories, totaling 400 commits for the evaluation dataset. Each commit was linked to a commit message and its respective diff.
Merge commits, automatic revert, and bot-generated messages were excluded from the evaluation dataset, as they do not represent authentic human writing. The final corpus distribution resulted in 92 “docs” type commits, 89 “fix” type, 72 “feat” type, 53 “chore” type, 51 “refactor” type, and 43 “test” type.
For the evaluation, three quantitative metrics were applied. The Recall-Oriented Understudy for Gisting Evaluation – Longest Common Subsequence (ROUGE-L) metric measured the lexical similarity between the model-generated message and the reference message, being implemented using the “rouge-score” library in Python (Lin and Och, 2004). The Bidirectional Encoder Representations from Transformers Score (BERTScore) metric complemented ROUGE-L by measuring meaning equivalence, using the “DistilBERT” model to transform each message into contextual vectors, allowing synonyms and paraphrases to be recognized as equivalent. The algorithm was implemented using the “bert-score” library in Python, which in turn uses the PyTorch framework internally to execute the “DistilBERT” model (Zhang et al., 2020).
The Conventional Commits Score (CC-Score) metric was created specifically to measure the structural adherence of a message to the Conventional Commits standard. This metric was defined as the proportion of generated messages that, using regular expressions (regex), simultaneously satisfy four verified criteria: (1) valid and lowercase type; (2) presence of a colon separator after the type; (3) description starting with a lowercase letter; and (4) absence of a period at the end of the description. The CC-Score complemented the ROUGE-L and BERTScore evaluations by focusing on the structural conformity of the message.
The input instructions, called prompts, constituted the main control mechanism for LLM behavior. Two distinct prompts were used: prompt P1, called “zero-shot”, asked the models to generate a commit message in the Conventional Commits format, from the provided source code changes, without providing additional examples. Prompt P2, called “few-shot”, included five examples of messages adhering to the Conventional Commit standard, allowing for the evaluation of the impact of exemplification.
All models were configured with a temperature of 0.1 and a limit of 150 tokens in response generation. The models also received prompts in English, the predominant language in their training data. The execution architecture consisted of three sequential steps: (1) corpus collection via GitHub REST API, applying exclusion filters for merges and bots; (2) submission of source code changes to the models executed via Ollama; and (3) evaluation of ROUGE-L, BERTScore, and CC-Score metrics, consolidating the results in comma-separated files.
3. Results and Discussion
The research results revealed the capability of compact large language models (LLMs), executed locally, in generating commit messages that adhere to the Conventional Commits standard. Model performance evaluation was conducted using lexical similarity (ROUGE-L), semantic (BERTScore) metrics, and a syntactic adherence metric developed for this study, the CC-Score. The findings indicated that the model architecture and, primarily, the input prompt design were determining factors for the quality and compliance of the generated messages, directly addressing the central objective of the work.
The execution stage of the models showed notable variations in processing times. The collection of commits took approximately thirty minutes. In the phase of submitting code changes to the LLMs, Alibaba’s model, with 1.5 billion parameters, was the fastest, completing the task in 71.6 minutes with prompt P1 and 85.2 minutes with prompt P2. In contrast, DeepSeek’s model, with 1.3 billion parameters, took 313.2 minutes (P1) and 240.8 minutes (P2), while IBM’s model, with 3 billion parameters, registered 332.4 minutes (P1) and 314.7 minutes (P2). The evaluation of metrics, in turn, was agile, consuming less than two minutes per model.
The analysis of the ROUGE-L metric, which assesses lexical similarity between generated and reference messages, revealed values between 0.036 and 0.154 across all experiments. These results indicated that the models did not reproduce the exact vocabulary of the original messages with high fidelity. Such behavior was expected, considering the creative nature of the task of describing code changes, where different developers may use distinct terminologies for the same modification. The low lexical similarity, therefore, does not necessarily imply an incorrect message, but rather a natural variation of the domain, as observed by Zhang et al. (2024) in studies on automatic commit message generation.
Regarding semantic similarity, measured by BERTScore, the values consistently remained above 0.837 in all evaluated scenarios. This finding is significant, as it demonstrates that, despite lexical differences, the messages generated by the models were semantically equivalent to the reference messages written by humans. This corroborates the distinction between lexical and semantic quality, as discussed by Tian et al. (2022), who pointed out that effective commit messages do not require identical vocabulary reproduction to communicate the intention of the change. The equivalence of meaning was preserved regardless of the models’ lexical choices.
The CC-Score metric, developed specifically for this work, measured the structural adherence of messages to the Conventional Commits standard. The most expressive results were achieved by the IBM and Alibaba models, which reached up to 98% adherence with the use of prompt P2. The DeepSeek model, on the other hand, presented a distinct behavior; with prompt P1, its CC-Score was only 11.03%. This low initial adherence was attributed to excessive verbosity and the generation of multiple lines, which prevented it from fitting the expected format. However, with prompt P2, DeepSeek’s adherence percentage increased to 55.13%, highlighting the importance of the prompt in structuring the output.
Impact of prompt type (P1 and P2)
The detailed analysis of the results revealed that the input prompt design exerted a decisive impact on the structural adherence to the Conventional Commits standard, regardless of the language model used. The most illustrative case was that of Alibaba’s model, which demonstrated an increase of 11.6 percentage points in its CC-Score, going from 86.65% with prompt P1 to 98.25% with prompt P2. This gain was achieved solely by including five commit message examples in the prompt, without any alteration to the inference parameters or the model’s architecture.
The IBM model exhibited similar behavior, with its CC-Score rising from 91.58% to 98.49% when using prompt P2. Although the DeepSeek model registered the largest relative gain in adherence, going from 11.03% with P1 to 55.13% with P2, its absolute performance still lagged behind the other models. These findings emphasize that the elaboration of more sophisticated prompts, such as “few-shot” (P2), can compensate for the parametric capacity limitations of compact LLMs, optimizing output quality without the need for retraining or fine-tuning the models.
Performance by commit type
When analyzing performance by commit type, Alibaba’s model (qwen2.5-coder:1.5b) demonstrated high consistency. With prompt P2, it achieved 100% adherence in the “test” type and values above 97% in other commit types. The “feat” type (new functionalities) presented the lowest CC-Score with prompt P1, registering 79.17%. This suggests that commits of new functionalities, by involving semantically more open and complex changes, represented a greater challenge for the automatic generation of structured messages.
For Alibaba’s model, ROUGE-L values were lower for the “refactor” type, which can be explained by the nature of these changes. Refactorings often modify the internal structure of the code without altering its external behavior, making the description of the change more subjective and distant from the original vocabulary. However, BERTScore values remained stable between 0.837 and 0.877 for all commit types, indicating that the semantic equivalence of the messages was maintained, regardless of the specificity of the alteration.
The IBM model (granite-code:3b) also presented robust results, reaching 100% CC-Score in the “chore”, “docs”, and “test” types with prompt P2, and performance above 94% in all other commit types. Analogous to the Alibaba model, the “feat” type registered the lowest CC-Score with prompt P1, reaching 81.69%. ROUGE-L and BERTScore values followed a similar pattern, with the “refactor” type showing the lowest lexical similarity values, while semantic equivalence was consistently maintained across different commit types.
The DeepSeek model (deepseek-coder:1.3b-instruct) exhibited distinct behavior, especially with prompt P1, where CC-Score values fell below 20% across all commit types, with the “feat” type registering only 7.84%. This model, while understanding the task, failed to control the output format, generating commit-related content but with excessive verbosity and inadequate formatting. With the application of prompt P2, CC-Score values increased significantly across all types, notably for “test” (73.91%) and “chore” (64.52%).
Despite the improvement with the P2 prompt, DeepSeek still remained below 50% for the “fix” (49.09%) and “feat” (37.21%) types. The low percentage for the “feat” type can be attributed to the complexity of new feature diffs, which seem to have amplified the model’s tendency to generate longer and less structured outputs. However, BERTScore values for DeepSeek remained above 0.832 in all scenarios, indicating that, even with low structural compliance, the generated messages preserved semantic equivalence with the references. This reinforced the importance of the CC-Score as a complementary metric, as a model can generate semantically close messages that are structurally non-compliant with the Conventional Commits standard.
Limitations of the study
This work presented some limitations that should be considered when interpreting the results. The dataset used for the evaluation was restricted to four public GitHub repositories, which may not represent the full diversity of existing projects and programming languages in the vast software development ecosystem. The evaluation focused exclusively on the commit message summary line, not including the message body, which generally contains more in-depth details about the changes. Most real commits do not have a standardized body, and their content is free-form, which represents an additional complexity for automatic generation.
The experiments were conducted in a hardware environment with an integrated GPU, which resulted in relatively high runtimes for the language models. Environments with a dedicated GPU could significantly reduce these inference times, impacting the practical viability of the solution in high-demand scenarios. Despite these limitations, the approach proved applicable on home machines with low processing power and in corporate environments with privacy restrictions, where the local execution of compact LLMs is a strategic advantage.
In summary, the research demonstrated that compact LLMs, executed locally via Ollama, are capable of generating commit messages structurally adherent to the Conventional Commits standard, affirmatively responding to the study’s objective. The prompt design, especially the use of examples (few-shot), proved to be a crucial factor for high syntactic adherence, compensating for the parametric capacity limitations of the models. The ROUGE-L and BERTScore metrics indicated that, although lexical similarity was low, semantic equivalence was consistently maintained. The CC-Score metric, in turn, proved to be a valuable instrument for evaluating structural conformity, complementing similarity assessments and reinforcing the applicability of the solution in software development contexts.
4. Conclusion
This study evaluated the ability of compact language models (LLMs), run locally via Ollama, to generate commit messages adhering to the Conventional Commits standard from real source code changes. It was found that compact LLMs specialized in code were capable of producing structurally compliant messages when properly instructed. The results showed that, although the lexical similarity of the generated messages with the reference ones was low, semantic equivalence was consistently maintained, with BERTScore values above 0.837. The CC-Score metric, developed for this work, revealed a syntactic adherence of up to 98% for the IBM and Alibaba models, highlighting the importance of prompt design. The inclusion of examples (few-shot) in the prompt proved to be a determining factor, optimizing output quality and compensating for the parametric capacity limitations of the models. This approach offers a significant practical contribution by enabling the automation of standardized commit message generation in environments with limited computational resources or privacy restrictions, where local execution is essential.
However, the study presented limitations, such as the restriction of the dataset to four public GitHub repositories and the evaluation focused solely on the commit message summary line, without including the body. The experiments, conducted on hardware with integrated GPU, resulted in relatively high execution times, although the feasibility of local execution was confirmed. For future studies, it is suggested to extend the evaluation to the commit body, investigate the integration of the solution as an MCP server for direct use in code editors, and analyze performance on smaller-scale repositories and in programming languages other than those evaluated. The research reinforces the applicability of compact LLMs for enhancing traceability and communication in software development projects, consolidating the utility of the CC-Score metric as a tool to ensure structural compliance.
Bibliographic References
Conventional Commits. 2024. A specification for adding human and machine readable meaning to commit messages. Disponível em: https://www.conventionalcommits.org. Acesso em: 01 fev. 2026.
Li, J.; Ahmed, I. 2023. Commit message matters: investigating impact and evolution of commit message quality. In: IEEE/ACM International Conference on Software Engineering (ICSE), 45., 2023, Melbourne, Austrália. Proceedings… p. 806–817. https://doi.org/10.1109/ICSE48619.2023.00076
Lin, C.-Y.; Och, F.J. 2004. Automatic evaluation of machine translation quality using longest common subsequence and skip-bigram statistics. In: Annual Meeting of the Association for Computational Linguistics (ACL), 42., 2004, Barcelona, Espanha. Proceedings… p. 605–612. Disponível em: https://aclanthology.org/P04-1077. Acesso em: 01 fev. 2026.
Merkel, D. 2014. Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239): 2.
Ollama. 2025. Ollama model library. Disponível em: https://ollama.com/library. Acesso em: 01 fev. 2026.
Prodanov, C.C.; Freitas, E.C. 2013. Metodologia do trabalho científico: métodos e técnicas da pesquisa e do trabalho acadêmico. 2 ed. Editora Feevale, Novo Hamburgo, RS, Brasil.
Tian, Y.; Zhang, Y.; Stol, K.-J.; Jiang, L.; Liu, H. 2022. What makes a good commit message? In: ACM/IEEE International Conference on Software Engineering (ICSE), 44., 2022, Pittsburgh, EUA. Proceedings… p. 2389–2401. https://doi.org/10.1145/3510003.3510205
Wei, J. et al. 2022. Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35: 24824–24837.
Zhang, T.; Kishore, V.; Wu, F.; Weinberger, K.Q.; Artzi, Y. 2020. BERTScore: evaluating text generation with BERT. In: International Conference on Learning Representations (ICLR), 2020. Disponível em: https://arxiv.org/abs/1904.09675. Acesso em: 01 fev. 2026.
Zhang, Y.; Qiu, Z.; Stol, K.-J.; Zhu, W.; Zhu, J.; Tian, Y.; Liu, H. 2024. Automatic commit message generation: a critical review and directions for future work. IEEE Transactions on Software Engineering. https://doi.org/10.1109/TSE.2024.3364675.
Article originating from the Final Course Work of the Specialization in Software Engineering of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform