Patch-CLIP:一种补丁-文本预训练模型
Patch-CLIP: A Patch-Text Pre-Trained Model
AI总结:
本文提出PATCH-CLIP预训练框架,通过对比学习、匹配和生成三重损失联合训练补丁与文本表示,在补丁描述生成等预测与生成任务上取得最优性能。
摘要:
近年来,补丁表示学习已成为利用机器学习能力进行软件生成的一个必要研究方向。这些表示在涉及代码变更的多种任务中带来了显著的性能提升。尽管进展不可否认,现有模型的一个共同局限在于其专用性:它们主要擅长预测性任务(如安全补丁分类)或生成性任务(如补丁描述生成)。这种二分现象还因普遍依赖可能含有噪声的数据源而进一步加剧。具体而言,许多模型使用与抽象语法树(AST)集成的补丁,但不幸的是,这些AST可能包含解析不准确之处,从而成为次优的监督来源。为应对这些挑战,我们提出了PATCH-CLIP,这是一种面向补丁和自然语言文本的新型预训练框架。PATCH-CLIP采用三重损失训练策略,用于1)补丁-描述对比学习,使得在嵌入空间中能够分离补丁和描述;2)补丁-描述匹配,确保每个补丁在嵌入空间中与其描述相关联;以及3)补丁-描述生成,确保补丁嵌入对生成任务有效。这些损失被用于联合学习,以在涉及补丁的预测性和生成性任务中均取得良好性能。以补丁描述生成为重点的实证评估表明,PATCH-CLIP树立了新的最先进性能,在BLEU、ROUGE-L、METEOR和Recall等指标上持续超越现有最佳水平。
英文摘要:
In recent years, patch representation learning has emerged as a necessary research direction for exploiting the capabilities of machine learning in software generation. These representations have driven significant performance enhancements across a variety of tasks involving code changes. While the progress is undeniable, a common limitation among existing models is their specialization: they predominantly excel in either predictive tasks, such as security patch classification, or in generative tasks such as patch description generation. This dichotomy is further exacerbated by a prevalent dependency on potentially noisy data sources. Specifically, many models utilize patches integrated with Abstract Syntax Trees (AST) that, unfortunately, may contain parsing inaccuracies, thus acting as a suboptimal source of supervision. In response to these challenges, we introduce PATCH-CLIP, a novel pre-training framework for patches and natural language text. PATCH-CLIP deploys a triple-loss training strategy for 1) patch-description contrastive learning, which enables to separate patches and descriptions in the embedding space, 2) patch-description matching, which ensures that each patch is associated to its description in the embedding space, and 3) patch-description generation, which ensures that the patch embedding is effective for generation. These losses are implemented for joint learning to achieve good performance in both predictive and generative tasks involving patches. Empirical evaluations focusing on patch description generation, demonstrate that PATCH-CLIP sets new state of the art performance, consistently outperforming the state-of-the-art in metrics like BLEU, ROUGE-L, METEOR, and Recall.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。