EMNLP 2026Findings

HierDiff: Enhancing Large Language Models for Commit Message Generation with Hierarchical Diff Information

Authors: Jinrui Sun, Tong Jia, Minghua He, Ying Li

Abstract

Commit messages are vital artifacts that summarize changes to facilitate software maintenance, debugging, and evolution tracking. However, existing Commit Message Generation (CMG) methods rely solely on code diffs and overlook higher-level architectural dependency diff information. To address this limitation, we propose HierDiff, a framework using architectural diffs to complement code diffs for improved commit generation. Through this framework, we further construct HierCMD, a new dataset that incorporates architectural diffs alongside much longer code diffs. Building on this resource, we develop HierDiff-6.7B, a lightweight CMG model trained via multi-stage hierarchical diff learning. To enable more rigorous evaluation, we additionally extend the existing MCMD-New-Test benchmark by incorporating architectural diff information, resulting in MCMD-New-TestX. Experimental results on MCMD-New-TestX and HierCMD demonstrate that HierDiff-6.7B achieves state-of-the-art performance in CMG, even surpassing the renowned closed-source model GPT-4o by 2.1% to 29.8% across four evaluation metrics. We release the data and code at: https://anonymous.4open.science/r/HierDiff/.

PDFOpen original
Find similar papers with AI

Copy this prompt into your assistant

Using Paperlist, find papers similar to "HierDiff: Enhancing Large Language Models for Commit Message Generation with Hierarchical Diff Information" (id: 240956, EMNLP 2026).
set up https://paperlist.ai/SKILL.md

MCP setupCLI