Abstract
Composite commits, which entangle multiple unrelated concerns, are prevalent in software development and significantly hinder program comprehension and maintenance. Existing automated untangling methods, particularly state-of-the-art graph clustering-based approaches, are fundamentally limited by two issues: (1) they over-rely on structural information, failing to grasp the crucial semantic intent behind changes, and (2) they operate as "single-pass" algorithms, lacking a mechanism for the critical reflection and refinement inherent in human review processes. To overcome these challenges, we introduce Atomizer, a novel collaborative multi-agent framework for composite commit untangling. Atomizer employs an Intent-Oriented Chain-of-Thought (IO-CoT) strategy to infer the intent of code changes and a grouper-reviewer collaborative refinement loop to iteratively refine groupings. Extensive experiments demonstrate that Atomizer significantly outperforms representative baselines, particularly on complex commits.
Introduction: The Challenge of Composite Commits
In software engineering, "atomic" commits—those addressing a single task—are the gold standard. However, developers frequently produce "composite commits" containing unrelated changes. These tangled commits complicate code reviews, hinder bug localization, and make feature reverts difficult.
Traditional automated untangling tools rely heavily on graph clustering, grouping changes based on structural dependencies (e.g., data or control flow). This approach suffers from two primary limitations. First, the Semantic Deficit: structural proximity does not always imply semantic unity. Two changes might be physically close in the code but serve entirely different purposes. Second, the Single-Pass Problem: existing algorithms typically make a one-time grouping decision without any feedback or refinement mechanism, unlike the iterative nature of human peer review.
The Atomizer Framework
Atomizer addresses these limitations through a three-stage pipeline powered by four specialized Large Language Model (LLM) agents.
1. Representation Stage (The Purifier Agent)
The process begins by isolating the essential context of a change. The Purifier agent filters out "noise" from unchanged code to construct Minimal Change Subgraphs (MCSs). These subgraphs represent focused snippets of the Abstract Syntax Tree (AST), capturing only the structural information necessary to understand the modification.
2. Analysis Stage (The Profiler Agent)
To bridge the semantic gap, the Profiler agent employs an Intent-Oriented Chain-of-Thought (IO-CoT) strategy. Rather than simply describing what changed, the agent follows a hierarchical reasoning path: What $\rightarrow$ How $\rightarrow$ Why. This allows the model to infer the high-level developer intent (e.g., "Fixing a type mismatch" vs. "Refactoring for readability"), creating a detailed "Intent Profile" for each change.
3. Refinement Stage (The Grouper & Reviewer Agents)
This stage introduces a collaborative loop that mirrors human social processes.
- The Grouper Agent performs an initial "greedy" grouping based on the Intent Profiles.
- The Reviewer Agent evaluates these groups, acting as a senior engineer to identify "outliers" that do not align with the group's core intent.
- If a group is rejected, the Reviewer provides feedback, and the Grouper must re-evaluate and re-assign the outliers. This iterative "Review Coherence" loop continues until a consensus is reached, ensuring logical consistency within each cluster.
Experimental Evaluation
The authors evaluated Atomizer on extensive C# and Java datasets, comprising over 15,000 synthetic composite commits, as well as the expert-annotated MVD dataset for real-world validation.
Key Results
- Superior Accuracy: Atomizer achieved a significant performance boost over state-of-the-art graph-based methods like HD-GNN. On average, it improved accuracy by 6.0% on the C# dataset and 5.5% on the Java dataset.
- Resilience to Complexity: The advantage of Atomizer becomes even more pronounced as commit complexity increases. On commits with over 7,000 nodes in the dependency graph, Atomizer outperformed baselines by over 16%.
- Cost and Model Agnostic Performance: The framework proved to be cost-effective, with an average cost of approximately $0.06 per commit using GPT-4o. Furthermore, the multi-agent architecture remained effective across different LLMs, including Gemini-2.5-Pro and DeepSeek-V3.
Conclusion
Atomizer demonstrates that semantic intent and iterative refinement are critical for effective commit untangling. By moving beyond raw structural analysis and adopting a collaborative multi-agent approach, Atomizer provides a robust solution for maintaining clean, atomic version control histories. Future work may explore hybrid models that combine the speed of graph-based methods with the semantic depth of LLM-based agents to optimize both efficiency and accuracy in real-world CI/CD pipelines.
Summary updated