LLM-Driven Collaborative Model for Untangling Commits via Explicit and Implicit Dependency Reasoning

Bo Hou, Xin Tan, Kai Zheng, Fang Liu, Yinghao Zhu, Li ZhangarXiv 2025 · DOI · arXiv

Abstract

Tangled commits—git commits containing multiple unrelated changes—hinder code review, bug localization, and project history clarity. This paper introduces ColaUntangle, a collaborative multi-agent framework that utilizes Large Language Models (LLMs) to untangle commits. By distinguishing between explicit structural dependencies and implicit semantic relationships, ColaUntangle employs specialized agents to reach a consensus on change grouping. Experimental results on large-scale C# and Java benchmarks demonstrate that ColaUntangle outperforms current state-of-the-art tools by 44% to 82%, establishing a new baseline for automated commit decomposition.

1. Introduction

In modern software development, "atomic commits" are the gold standard. However, developers frequently produce "tangled commits" by mixing feature additions, bug fixes, and refactoring into a single submission. These commits increase the cognitive load on maintainers and degrade the performance of automated tools.

Examples of tangled commits (A, B, C) where unrelated functional and non-functional changes are mixed into single commits.

Previous automated untangling approaches primarily relied on static analysis of data and control flows. While effective for explicit dependencies, these methods struggle with implicit dependencies—changes that are semantically related but lack direct code-level links, such as updating a variable name alongside its corresponding documentation or comments.

2. The ColaUntangle Framework

ColaUntangle addresses the limitations of prior work by treating commit untangling as a collaborative reasoning task between specialized LLM agents.

The complete ColaUntangle workflow, illustrating context extraction and the iterative multi-agent consultation process.

2.1 Context Extraction

The framework begins by constructing a Commit-Level Merged Graph. From this, it derives two distinct views to feed the agents:

  • Explicit Context ($G_{Explicit}$): A highly compressed representation of direct data and control flow dependencies between changed statements.
  • Implicit Context ($G_{Implicit}$): A semantic view including the changed code and its immediate "one-hop" neighbors to provide necessary context for semantic reasoning.

2.2 Multi-Agent Collaboration

The core of the system is a trio of specialized agents:

  1. Explicit Worker Agent (EA): An expert in identifying "hard" structural links like data dependencies.
  2. Implicit Worker Agent (IA): Analyzes "soft" semantic links, similarity, and "cosmetic" edits like formatting.
  3. Reviewer Agent (RA): Acts as a manager that synthesizes the two perspectives, resolving conflicts through an iterative consultation process until consensus is reached.

3. Experimental Evaluation

The model was evaluated using two extensive benchmarks: a C# dataset containing 1,612 tangled commits and a Java dataset featuring over 14,000 commits. These datasets provide a ground truth by using artificially tangled atomic commits.

3.1 Key Results

ColaUntangle achieved a significant performance leap over the previous state-of-the-art baseline (HD-GNN):

  • Accuracy Improvement: It outperformed the baseline by 44% on the C# dataset and 82% on the Java dataset in terms of statement labeling accuracy ($Accuracy^c$).
  • Efficiency: Despite the multi-agent overhead, the system reached a consensus in an average of just 1.39 rounds.
  • Model Robustness: While performing best with DeepSeek-V3, the framework showed strong results with GPT-4o and Claude-3.5-Sonnet, proving the architectural approach is model-agnostic.

4. Discussion and Conclusion

The success of ColaUntangle highlights the importance of semantic reasoning in code analysis. By isolating "cosmetic" noise and providing natural language rationales for its groupings, the framework offers superior explainability compared to "black-box" neural models. Future work will focus on reducing inference latency (currently ~71 seconds per commit) and integrating "human-in-the-loop" features to allow developers to refine LLM-proposed splits in real-time.

Summary updated

Abstract

Atomic commits, which address a single development concern, are a best practice in software development. In practice, however, developers often produce tangled commits that mix unrelated changes, complicating code review and maintenance. Prior untangling approaches (rule-based, feature-based, or graph-based) have made progress but typically rely on shallow signals and struggle to distinguish explicit dependencies (e.g., control/data flow) from implicit ones (e.g., semantic or conceptual relationships). In this paper, we propose ColaUntangle, a new collaborative consultation framework for commit untangling that models both explicit and implicit dependencies among code changes. ColaUntangle integrates Large Language Model (LLM)-driven agents in a multi-agent architecture: one agent specializes in explicit dependencies, another in implicit ones, and a reviewer agent synthesizes their perspectives through iterative consultation. To capture structural and contextual information, we construct Explicit and Implicit Contexts, enabling agents to reason over code relationships with both symbolic and semantic depth. We evaluate ColaUntangle on two widely-used datasets (1,612 C# and 14k Java tangled commits). Experimental results show that ColaUntangle outperforms the best-performing baseline, achieving an improvement of 44% on the C# dataset and 82% on the Java dataset. These findings highlight the potential of LLM-based collaborative frameworks for advancing automated commit untangling tasks.
BibTeX
@misc{hou2025llm,
  author = {Bo Hou and Xin Tan and Kai Zheng and Fang Liu and Yinghao Zhu and Li Zhang},
  title = {{LLM-Driven Collaborative Model for Untangling Commits via Explicit and Implicit Dependency Reasoning}},
  year = {2025},
  eprint = {2507.16395},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.16395},
}
Figure