arXiv:2605.25890cs.LG2026-05

用大模型自动解决代码合并冲突,效果接近顶尖商业模型。

Merge-Bench: Resolve Merge Conflicts with Large Language Models

  • 构建了7938个真实代码冲突数据集,无需人工标注可扩展。
  • 训练140亿参数模型LLMergeJ,Java代码冲突解决准确率超3款商用大模型。
  • 跨11种语言测试,顶级模型仍仅正确解决不足60%的冲突。

本文将机器学习应用于版本控制合并这一重要且困难的任务。(1) 构建了包含7938个来自1439个GitHub仓库的真实代码合并冲突片段的数据集Merge-Bench,其真实答案为开发者提交的最终合并结果。该数据集构建方法无需人工标注,具备任意规模扩展能力。(2) 训练了一个名为LLMergeJ的模型来解决Java程序中的合并冲突。该方法采用组相对策略优化(GRPO)这一在线强化学习方法训练大型语言模型(LLM)。(3) 对大模型在合并冲突解决上的表现进行了两项评估。在Java程序上,具有140亿参数的LLMergeJ优于3款商用大模型,仅略逊于Gemini 2.5 Pro。在11种编程语言上的跨语言测试显示,商用大模型性能基本稳定,但最佳模型仍仅能正确解决不足60%的合并冲突。

原文摘要 · Abstract (English)

This paper applies machine learning to the difficult and important task of version control merging. (1) We constructed a dataset, Merge-Bench, of 7938 real-world merge conflict hunks from 1439 GitHub repositories. The ground truth is the merge resolution that developers committed to the repository. Our dataset construction methodology is scalable to arbitrary amounts of data since no manual labeling is required. (2) We trained a model, LLMergeJ, to resolve merge conflicts in Java programs. Our approach uses Group Relative Policy Optimization (GRPO), an online reinforcement learning method, to train a Large Language Model (LLM). (3) We performed two evaluations of the performance of LLMs on resolving merge conflicts. On Java programs, LLMergeJ with 14B parameters outperforms 3 commercial LLMs, trailing only Gemini 2.5 Pro. Across 11 programming languages, commercial LLM performance is largely stable from language to language. The best models correctly resolve less than 60% of merge conflicts.

代码合并大模型强化学习软件工程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。