arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2111.11904cs.SE
收藏

预训练的语言模型能解决文本和语义合并冲突吗?

Can Pre-trained Language Models be Used to Resolve Textual and Semantic Merge Conflicts?

Jialu Zhang, Todd Mytkowicz, Mike Kaufman, Ruzica Piskac, Shuvendu K. Lahiri

摘要:

程序合并是开发人员将他们的个人更改集成到公共代码库时的标准实践。当合并算法失败时,这被称为合并冲突。这种冲突要么表现为文本合并冲突(合并无法生成代码),要么表现为语义合并冲突(合并的代码导致编译器或测试中断)。为大型代码项目解决这些冲突是昂贵的,因为它需要开发人员手动识别冲突的来源并纠正它们。在本文中,我们探索了使用k-shot学习与大型神经语言模型(LM)(如GPT-3)自动修复合并冲突(文本和语义)的可行性。利用这样的语言模型的挑战之一是在小提示(2048个标记)内适应示例和查询。我们评估了两个广泛应用的LM和k-shot学习:(a)分歧分支微软Edge的文本和语义合并冲突,以及(b)GitHub中大量JavaScript项目的文本合并冲突。我们的结果好坏参半:一方面,与早期的符号方法相比,LM在Edge的语义合并冲突解决方面提供了最先进的(SOTA)性能;另一方面,LM还没有实现微调神经模型(当有足够的数据可用时)或为程序合成的受限模式设计专用领域特定语言(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 in textual merge conflicts where the merge fails to produce code, or semantic merge conflicts where the merged code results in compiler or test breaks. Resolving these conflicts for large code projects is expensive because it requires developers to manually identify the sources of conflict and correct them. In this paper, we explore the feasibility of automatically repairing merge conflicts (both textual and semantic) using k-shot learning with large neural language models (LM) such as GPT-3. One of the challenges in leveraging such language models is to fit the examples and the queries within a small prompt (2048 tokens). We evaluate LMs and k-shot learning for two broad applications: (a) textual and semantic merge conflicts for a divergent fork Microsoft Edge, and (b) textual merge conflicts for a large number of JavaScript projects in GitHub. Our results are mixed: one 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 fine-tuning neural models (when sufficient data is available) or the design of special purpose domain-specific languages (DSL) for restricted patterns for program synthesis.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑