paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Program merge conflict resolution via neural transformers

基于神经 transformer 的程序合并冲突消解
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 2/10 · 该论文属于机器学习与程序语言的交叉,但核心是合并冲突消解这一软件工程任务,不涉及静态分析、形式化验证、浮点程序分析或贝叶斯程序分析,也未使用 LLM/Agent 改进分析流程;与用户画像的核心方向较远。引用 33 inbox
Alexey Svyatkovskiy, Sarah Fakhoury, Negar Ghorbani, Todd Mytkowicz, Elizabeth Dinella, Christian Bird, Jinu Jang, Neel Sundaresan, Shuvendu K. Lahiri
crossref: 2026-09-12

AI 速览

一句话:提出 MergeBERT,将合并冲突消解重构为原始合并模式分类任务,准确率达 63–68%,远超已有工具。

协同开发中,多位开发者修改同一代码区域会产生合并冲突,导致 pull request 与持续集成流水线阻塞数小时乃至数天,严重损害开发效率。本文提出 MergeBERT:一个基于 token 级三方差分与 transformer 编码器的神经程序合并框架。作者利用合并冲突消解方案受限的特点,把生成消解序列的任务重新表述为对一组从真实合并提交数据中抽取的原始合并模式的分类任务。该模型在合并消解合成上达到 63–68% 的准确率,相比已有的半结构化方法提升近 3 倍,相比神经程序合并工具提升约 2 倍,并可跨 Java、JavaScript、TypeScript 与 C# 源码文件工作。为评估其实用性,作者对来自大型开源项目的 25 名开发者开展用户研究,覆盖他们遇到的 122 个真实冲突,结果表明实践中 MergeBERT 的消解建议的接受率高于自动精度与准确率指标所估计的水平,作者也据此总结了未来改进方向。

问题
并发修改同一代码区域造成的合并冲突会长时间阻塞 pull request 与 CI 流水线,现有半结构化与神经合并工具在自动生成消解方案上精度不足。
方法
在 token 级三方差分基础上使用 transformer 编码器,将消解序列生成重构为对从真实合并提交中抽取的原始合并模式的分类任务。
评估
在多种语言(Java、JavaScript、TypeScript、C#)上评测消解合成的准确率并与基线对比,同时对 25 名大型开源项目开发者的 122 个真实冲突进行用户研究。
原文摘要(Abstract)

Collaborative software development is an integral part of the modern software development life cycle, essential to the success of large-scale software projects. When multiple developers make concurrent changes around the same lines of code, a merge conflict may occur. Such conflicts stall pull requests and continuous integration pipelines for hours to several days, seriously hurting developer productivity. To address this problem, we introduce MergeBERT, a novel neural program merge framework based on token-level three-way differencing and a transformer encoder model. By exploiting the restricted nature of merge conflict resolutions, we reformulate the task of generating the resolution sequence as a classification task over a set of primitive merge patterns extracted from real-world merge commit data. Our model achieves 63–68% accuracy for merge resolution synthesis, yielding nearly a 3× performance improvement over existing semi-structured, and 2× improvement over neural program merge tools. Finally, we demonstrate that MergeBERT is sufficiently flexible to work with source code files in Java, JavaScript, TypeScript, and C# programming languages. To measure the practical use of MergeBERT, we conduct a user study to evaluate MergeBERT suggestions with 25 developers from large OSS projects on 122 real-world conflicts they encountered. Results suggest that in practice, MergeBERT resolutions would be accepted at a higher rate than estimated by automatic metrics for precision and accuracy. Additionally, we use participant feedback to identify future avenues for improvement of MergeBERT.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7059,
  title = {Program merge conflict resolution via neural transformers},
  author = {Alexey Svyatkovskiy and Sarah Fakhoury and Negar Ghorbani and Todd Mytkowicz and Elizabeth Dinella and Christian Bird and Jinu Jang and Neel Sundaresan and Shuvendu K. Lahiri},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3549163}
}