Program merge conflict resolution via neural transformers
Open accessThe DOI matches its Crossref record; 44 of the 44 references it cites were found in a registry or an index.
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1423 · Cited by 54,325 · cited 3×
“MergeBERT is a textual program merge model based on the bidirectional transformer encoder (BERT) model [14].”
BackgroundMethodInfluentialCodeBERT: A Pre-Trained Model for Programming and Natural Languages
Feng, Z., Guo, D., Tang, D., Duan, N., Feng, X., Gong, M., Shou, L., Qin, B., Liu, T., Jiang, D., et al. (2020) · Findings of the Association for Computational Linguistics: EMNLP 2020 · doi:10.18653/v1/2020.findings-emnlp.139 · Cited by 2,824
BLEURT: Learning Robust Metrics for Text Generation
Sellam, T., Das, D., & Parikh, A. (2020) · Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2020.acl-main.704 · Cited by 1,005
BLEURT: Learning Robust Metrics for Text Generation
Sellam, T., Das, D., & Parikh, A. P. (2020) · arXiv · doi:10.48550/arxiv.2004.04696 · Cited by 1,005 · cited 1×
“Neural language models (LMs) have shown great performance in natural language generation [36, 38], and have been successfully applied to the domain of source code [17, 24, 48].”
BackgroundNeural Machine Translation of Rare Words with Subword Units
Sennrich, R., Haddow, B., & Birch, A. (2016) · Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/p16-1162 · Cited by 974 · cited 1×
“The vocabulary is constructed using byte-pair encoding [39] and the vocabulary size is 50000.”
MethodNeural Machine Translation of Rare Words with Subword Units
Sennrich, R., Haddow, B., & Birch, A. (2015) · arXiv · doi:10.48550/arxiv.1508.07909 · Cited by 950 · cited 1×
“The vocabulary is constructed using byte-pair encoding [39] and the vocabulary size is 50000.”
MethodFine-grained and accurate source code differencing
Falleri, J.-R., Morandat, F., Blanc, X., Martinez, M., & Monperrus, M. (2014) · Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering · doi:10.1145/2642937.2642982 · Cited by 549 · cited 2×
“In an effort to accurately and fairly identify semantically equivalent merges, we use GumTree [16], an AST differencing tool, to identify and ignore semantically equivalent differences between JD IME output and the user resolution, such as reordered method declarations.”
MethodOn the naturalness of software
Hindle, A., Barr, E. T., Su, Z., Gabel, M., & Dévanbu, P. (2012) · doi:10.5555/2337223.2337322 · Cited by 541
A state-of-the-art survey on software merging
Mens, T. (2002) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2002.1000449 · Cited by 532
IntelliCode compose: code generation using transformer
Svyatkovskiy, A., Deng, S. K., Fu, S., & Sundaresan, N. (2020) · Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering · doi:10.1145/3368089.3417058 · Cited by 474 · cited 1×
“Neural language models (LMs) have shown great performance in natural language generation [36, 38], and have been successfully applied to the domain of source code [17, 24, 48].”
BackgroundSelf-citationOn the naturalness of software
Hindle, A., Barr, E. T., Su, Z., Gabel, M., & Devanbu, P. (2012) · 2012 34th International Conference on Software Engineering (ICSE) · doi:10.1109/icse.2012.6227135 · Cited by 425 · cited 1×
“Neural language models (LMs) have shown great performance in natural language generation [36, 38], and have been successfully applied to the domain of source code [17, 24, 48].”
BackgroundWork practices and challenges in pull-based development: the contributor's perspective
Gousios, G., Storey, M.-A., & Bacchelli, A. (2016) · Proceedings of the 38th International Conference on Software Engineering · doi:10.1145/2884781.2884826 · Cited by 335
The impact of tangled code changes
Herzig, K., & Zeller, A. (2013) · 2013 10th Working Conference on Mining Software Repositories (MSR) · doi:10.1109/msr.2013.6624018 · Cited by 270 · cited 1×
“Tangled Code Changes in Oracle (10/122) Resolutions for 10 of the conflicts contained additional “tangled” changes [23, 29] that were unrelated to the resolution.”
BackgroundProactive detection of collaboration conflicts
Brun, Y., Holmes, R., Ernst, M. D., & Notkin, D. (2011) · Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering · doi:10.1145/2025113.2025139 · Cited by 201 · cited 1×
“Over the past decade, several approaches have been proposed to improve the detection and automatic resolution of merge conflicts [4, 9, 10, 28, 30, 32, 45, 53].”
BackgroundBig code != big vocabulary: open-vocabulary models for source code
Karampatsis, R.-M., Babii, H., Robbes, R., Sutton, C., & Janes, A. (2020) · Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering · doi:10.1145/3377811.3380342 · Cited by 182 · cited 1×
“We make use of Byte-Pair Encoding (BPE) unsupervised tokenization to avoid a blowup in the vocabulary size given the sparse nature of code identifiers [27].”
MethodPyMT5: multi-mode translation of natural language and Python code with transformers
Clement, C., Drain, D., Timcheck, J., Svyatkovskiy, A., & Sundaresan, N. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.728 · Cited by 120
Self-citationStructure-oriented merging of revisions of software documents
Westfechtel, B. (1991) · Software Configuration Management Workshop · doi:10.1145/111062.111071 · Cited by 117 · cited 2×
“Several syntactic program merge techniques have been proposed [5, 52] which are based on parse trees or ASTs and graphs.”
MethodAssessing the value of branches with what-if analysis
Bird, C., & Zimmermann, T. (2012) · Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering · doi:10.1145/2393596.2393648 · Cited by 114 · cited 1×
“Resolving merge conflicts is a time-consuming, complicated, and error-prone activity [6].”
BackgroundSelf-citationSemistructured merge: rethinking merge in revision control systems
Apel, S., Liebig, J., Brandl, B., Lengauer, C., & Kästner, C. (2011) · Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering · doi:10.1145/2025113.2025141 · Cited by 113 · cited 2×
“8.2.4 jsFSTMerge.”
MethodInfluentialStructured merge with auto-tuning: balancing precision and performance
Apel, S., Leßenich, O., & Lengauer, C. (2012) · Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering · doi:10.1145/2351676.2351694 · Cited by 94 · cited 2×
“This is in line with related work reporting that as much as 21% of files cannot be merged [2].”
MethodResultCassandra: Proactive conflict minimization through optimized task scheduling
Kasi, B. K., & Sarma, A. (2013) · 2013 35th International Conference on Software Engineering (ICSE) · doi:10.1109/icse.2013.6606619 · Cited by 81 · cited 1×
“Over the past decade, several approaches have been proposed to improve the detection and automatic resolution of merge conflicts [4, 9, 10, 28, 30, 32, 45, 53].”
BackgroundHey! are you committing tangled changes?
Kirinuki, H., Higo, Y., Hotta, K., & Kusumoto, S. (2014) · International Conference on Program Comprehension · doi:10.1145/2597008.2597798 · Cited by 74 · cited 1×
“Tangled Code Changes in Oracle (10/122) Resolutions for 10 of the conflicts contained additional “tangled” changes [23, 29] that were unrelated to the resolution.”
BackgroundEvaluating and improving semistructured merge
Cavalcanti, G., Borba, P., & Accioly, P. (2017) · Proceedings of the ACM on Programming Languages · doi:10.1145/3133883 · Cited by 67 · cited 2×
“Over the past decade, several approaches have been proposed to improve the detection and automatic resolution of merge conflicts [4, 9, 10, 28, 30, 32, 45, 53].”
BackgroundOn the Nature of Merge Conflicts: A Study of 2,731 Open Source Java Projects Hosted by GitHub
Ghiotto, G., Murta, L., Barros, M., & van der Hoek, A. (2020) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2018.2871083 · Cited by 67 · cited 1×
“Merge commits occur frequently, almost 12% of all commits are related to a merge [20], and up to 46% of those commits result in conflicts.”
BackgroundVerified three-way program merge
Sousa, M., Dillig, I., & Lahiri, S. K. (2018) · Proceedings of the ACM on Programming Languages · doi:10.1145/3276535 · Cited by 66 · cited 1×
“[46] explore the use of program verification to certify that a merge obeys a semantic correctness criteria, but does not help synthesize resolutions.”
BackgroundSelf-citationIntelliMerge: a refactoring-aware software merging technique
Shen, B., Zhang, W., Zhao, H., Liang, G., Jin, Z. G., & Wang, Q. (2019) · Proceedings of the ACM on Programming Languages · doi:10.1145/3360596 · Cited by 64 · cited 1×
“Researchers have also developed tools to help developers visualize and navigate the merge conflict resolution process [41, 43, 44], and identified key needs of the developer community for effective tool support [33].”
BackgroundImproving early detection of software merge conflicts
Guimarães, M. L., & Silva, A. R. (2012) · 2012 34th International Conference on Software Engineering (ICSE) · doi:10.1109/icse.2012.6227180 · Cited by 56 · cited 1×
“The ideal way to resolve a conflict is not always clear, and may require referring to project specification documentation or communicating with their peers about changes [6, 9, 13, 22, 33].”
BackgroundThe life-cycle of merge conflicts: processes, barriers, and strategies
Nelson, N., Brindescu, C., McKee, S., Sarma, A., & Dig, D. (2019) · Empirical Software Engineering · doi:10.1007/s10664-018-9674-x · Cited by 54 · cited 3×
“[33] interviewed developers and performed a follow-up survey with 162 developers to build a detailed understanding of developer perceptions regarding merge conflicts in general.”
BackgroundMethodSoftware Practitioner Perspectives on Merge Conflicts and Resolutions
McKee, S., Nelson, N., Sarma, A., & Dig, D. (2017) · 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME) · doi:10.1109/icsme.2017.53 · Cited by 53 · cited 1×
“McKee et al. [31] and Nelson et al. [33] interviewed developers and performed a follow-up survey with 162 developers to build a detailed understanding of developer perceptions regarding merge conflicts in general.”
MethodAn empirical investigation into merge conflicts and their effect on software quality
Brindescu, C., Ahmed, I., Jensen, C., & Sarma, A. (2019) · Empirical Software Engineering · doi:10.1007/s10664-019-09735-4 · Cited by 49 · cited 1×
“investigated the impact of merge conflicts and their resolutions on software quality [7, 8].”
BackgroundConflict resolution for structured merge via version space algebra
Zhu, F., & He, F. (2018) · Proceedings of the ACM on Programming Languages · doi:10.1145/3276536 · Cited by 43
Challenges of Resolving Merge Conflicts: A Mining and Survey Study
Vale, G., Hunsen, C., Figueiredo, E., & Apel, S. (2021) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2021.3130098 · Cited by 38 · cited 1×
“[51] performed an empirical study to understand what makes merge challenging for developers.”
BackgroundTIPMerge: recommending experts for integrating changes across branches
Costa, C. D. S., Figueiredo, J., Murta, L., & Sarma, A. (2016) · ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) · doi:10.1145/2950290.2950339 · Cited by 33 · cited 1×
“presented TIPMerge, an approach for identifying and recommending developers to participate in merge sessions when resolving conflicts [12].”
BackgroundSemistructured Merge in JavaScript Systems
Tavares, A. T., Borba, P. H. M., Cavalcanti, G., & Soares, S. (2019) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1109/ase.2019.00098 · Cited by 29 · cited 2×
“implemented jsFSTMerge by adapting an off-the-shelf grammar for JavaScript to address shortcomings of FSTMerge and also modifying the FSTMerge algorithm itself [49].”
MethodRecommending Participants for Collaborative Merge Sessions
Costa, C. D. S., Figueiredo, J., Pimentel, J. F., Sarma, A., & Murta, L. (2019) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2019.2917191 · Cited by 23 · cited 1×
“They evaluated it on 2,040 merges across 25 open source projects and found that TIPMerge can improve joint knowledge coverage by an average of 49% in merge scenarios [13].”
BackgroundLeveraging Structure in Software Merge: An Empirical Study
Seibt, G., Heck, F., Cavalcanti, G., Borba, P. H. M., & Apel, S. (2021) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2021.3123143 · Cited by 21 · cited 1×
“[37] explore and evaluate merge algorithms on a suite of ten software repositories, paying attention to the amount of resolutions produced, size of conflict, runtime cost, and correctness.”
BackgroundAutomatic Detection and Resolution of Software Merge Conflicts: Are We There Yet?Preprint
Shen, B., Xiao, C., Meng, N., & He, F. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2102.11307 · Cited by 7 · cited 1×
“We manually analyze the conflicts looking to identify patterns that may explain the incorrect merges, for example, affected language construct [34] and type of conflict [40], but do not identify any consistent patterns.”
MethodCan Program Synthesis be Used to Learn Merge Conflict Resolutions? An Empirical AnalysisPreprint
Pan, R., Le, V., Nagappan, N., et al. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2103.02004 · Cited by 4 · cited 1×
“conflicts looking to identify patterns that may explain the incorrect merges, for example, affected language construct [34] and type of conflict [40], but do not identify any consistent patterns.”
BackgroundData set for FSE 2022 Submission Program Merge Conflict Resolution via Neural Transformers
Anonymous, . (2022) · Zenodo (CERN European Organization for Nuclear Research) · doi:10.5281/zenodo.6366908 · Cited by 2
DeepMerge: Learning to Merge ProgramsPreprint
Dinella, E., Mytkowicz, T., Svyatkovskiy, A., et al. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2105.07569 · Cited by 2 · cited 13×
“(2) We evaluateMergeBERT against structured and semi-structured program merge tools like jsFSTMerge and JDime, as well as neural program merge models [15].”
BackgroundMethodInfluentialSelf-citationData set for FSE 2022 Submission Program Merge Conflict Resolution via Neural Transformers
Anonymous (2022) · Zenodo (CERN European Organization for Nuclear Research) · doi:10.5281/zenodo.6366907 · Cited by 2
Appendix to Program Merge Conflict Resolution via Neural Transformers
Anonymous (2022) · Zenodo (CERN European Organization for Nuclear Research) · doi:10.5281/zenodo.6366876 · Cited by 1
Сучасний підхід до проблеми виникнення університету як соціокультурного феномену
Aslan (2018) · Electronic Volyn National University Institutional Repository · doi:10.5281/zenodo
Research works printed but not linked: 8
- 10.1145/3212695 · DOI · Paper page
- Sven Apel Jörg Liebig Christian Lengauer Christian Kästner and William R Cook. 2010. Semistructured Merge in Revision Control Systems.. In VaMoS. 13–19. Sven Apel Jörg Liebig Christian Lengauer Christian Kästner and William R Cook. 2010. Semistructured Merge in Revision Control Systems.. In VaMoS. 13–19. · DOI · Paper page
- Caius Brindescu , Yenifer Ramirez , Anita Sarma , and Carlos Jensen . 2020 . Lifting the Curtain on Merge Conflict Resolution: A Sensemaking Perspective. In 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME). 534–545 . Caius Brindescu, Yenifer Ramirez, Anita Sarma, and Carlos Jensen. 2020. Lifting the Curtain on Merge Conflict Resolution: A Sensemaking Perspective. In 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME). 534–545.
- Aditya Kanade , Petros Maniatis , Gogul Balakrishnan , and Kensen Shi . 2020 . Learning and evaluating contextual embedding of source code . In International Conference on Machine Learning. 5110–5121 . Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. 2020. Learning and evaluating contextual embedding of source code. In International Conference on Machine Learning. 5110–5121.
- Rangeet Pan , Vu Le , Nachiappan Nagappan , Sumit Gulwani , Shuvendu Lahiri , and Mike Kaufman . 2021 . Can Program Synthesis be Used to Learn Merge Conflict Resolutions? An Empirical Analysis. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). 785–796 . Rangeet Pan, Vu Le, Nachiappan Nagappan, Sumit Gulwani, Shuvendu Lahiri, and Mike Kaufman. 2021. Can Program Synthesis be Used to Learn Merge Conflict Resolutions? An Empirical Analysis. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). 785–796.
- M. Sousa , I. Dillig , and S. K. Lahiri . 2018. Verified Three-way Program Merge . Proc. ACM Program. Lang. , 2 ( 2018 ), 165:1–165:29. M. Sousa, I. Dillig, and S. K. Lahiri. 2018. Verified Three-way Program Merge. Proc. ACM Program. Lang., 2 (2018), 165:1–165:29.
- 10.1145/3368089.3417058 · DOI · Paper page
- 10.1109/ASE.2019.00098 · DOI
Cited by
TOGA: a neural method for test oracle generation
Dinella, E., Ryan, G., Mytkowicz, T., & Lahiri, S. K. (2022) · Proceedings of the 44th International Conference on Software Engineering · doi:10.1145/3510003.3510141 · Cited by 118
Self-citationChatGPT: A Study on its Utility for Ubiquitous Software Engineering Tasks
Sridhara, G., G., R. H., & Mazumdar, S. (2023) · arXiv · doi:10.48550/arxiv.2305.16837 · Cited by 68
“Resolving conflicts manually is a tedious and error prone activity [Svyatkovskiy et al.(2022)].”
Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper)
Zhang, J., Mytkowicz, T., Kaufman, M., Piskac, R., & Lahiri, S. K. (2022) · Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis · doi:10.1145/3533767.3534396 · Cited by 39
Self-citationMultilingual code refactoring detection based on deep learning
Li, T., & Zhang, Y. (2024) · Expert Systems with Applications · doi:10.1016/j.eswa.2024.125164 · Cited by 20
Merge Conflict Resolution: Classification or Generation?
Dong, J., Zhu, Q., Sun, Z., Lou, Y., & Hao, D. (2023) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1109/ase56229.2023.00155 · Cited by 23
“The APIs of pre-trained models provided by HuggingFace are the most popular in NLP community and are widely used by researchers and developers [24], [37].”
BackgroundMethodResultInfluential
Metadata
- Authors
- Svyatkovskiy, A., Fakhoury, S., Ghorbani, N., Mytkowicz, T., Dinella, E., Bird, C., Jang, J., Sundaresan, N., & Lahiri, S. K.
- Affiliations
- Microsoft (United States) (US)
- Washington State University (US)
- University of California, Irvine (US)
- University of Pennsylvania (US)
- ORCID
- Venue
- Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering
- Publisher
- ACM
- Published
- 2022-11-07
- Pages
- 822-833
- OpenAlex
- W4296938538
- Cited by
- 38
- References
- 37
- Citations by year
- 2026: 8 · 2025: 12 · 2024: 8 · 2023: 6 · 2022: 4
- FWCI
- 6.71
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Information Systems › Software Engineering Techniques and Practices
- Physical Sciences › Computer Science › Software › Model-Driven Software Engineering Techniques
- Keywords
- merge conflict resolution, collaborative software development, pull requests, continuous integration, user study, open source projects, developer productivity
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.