一句话:探索用 GPT-3 等预训练语言模型以 k-shot 学习自动修复文本与语义合并冲突。
程序合并失败会产生文本或语义合并冲突,手动解决成本高昂。本文以 Microsoft Edge 为案例,研究使用 GPT-3 等预训练大语言模型和 k-shot 学习自动修复两类冲突的可行性,并处理示例与查询需放入 2048 token 提示的限制。评估结果呈现混合结论:在 Edge 的语义合并冲突上,语言模型相较早期符号方法达到最先进性能;但对于受限模式,语言模型尚未能取代专用领域特定语言(DSL)在程序合成中的优势。
Program merging is standard practice when developers integrate their individual changes to a common code base. When the merge algorithm fails, this is called a merge conflict. The conflict either manifests as a textual merge conflict where the merge fails to produce code, or as a semantic merge conflict where the merged code results in compiler errors or broken tests. Resolving these conflicts for large code projects is expensive because it requires developers to manually identify the sources of conflicts and correct them. In this paper, we explore the feasibility of automatically repairing merge conflicts (both textual and semantic) using k-shot learning with pre-trained large neural language models (LM) such as GPT-3. One of the challenges in leveraging such language models is fitting the examples and the queries within a small prompt (2048 tokens). We evaluate LMs and k-shot learning for both textual and semantic merge conflicts for Microsoft Edge. Our results are mixed: on one-hand, LMs provide the state-of-the-art (SOTA) performance on semantic merge conflict resolution for Edge compared to earlier symbolic approaches; on the other hand, LMs do not yet obviate the benefits of special purpose domain-specific languages (DSL) for restricted patterns for program synthesis.
DOI 原文 ·
@inproceedings{paperbot7404,
title = {Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper)},
author = {Jialu Zhang and Todd Mytkowicz and Mike Kaufman and Ruzica Piskac and Shuvendu K. Lahiri},
booktitle = {ISSTA},
year = {2022},
doi = {10.1145/3533767.3534396}
}