arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.07706cs.CLcs.IRcs.PL
收藏

基于表征相似性分析的代码语言模型语义Grounding挖掘

Probing Semantic Grounding in Language Models of Code with Representational Similarity Analysis

BITS Pilani, K. K. Birla Goa Campus(贝拉理工学院(BITS Pilani)K.K.比拉拉果阿校区)

Shounak Naik, Rajaswa Patil, Swati Agarwal, Veeky Baths

摘要:

表征相似性分析是认知神经科学的一种方法,它有助于比较来自两个不同数据源的表征。在本文中,我们提出使用表征相似性分析来探测代码的语言模型的语义基础。我们通过使用IBM CodeNet数据集的数据来探测CodeBERT模型的语义基础表示。通过我们的实验,我们表明,目前的预训练方法不会在代码的语言模型中引入语义基础,而是专注于优化基于形式的模式。我们还表明,即使是少量的微调语义相关的任务增加了语义基础CodeBERT显着。我们对CodeBERT模型的输入模态的消融表明,使用双峰输入(代码和自然语言)而不是单峰输入(仅代码)在语义微调期间提供了更好的语义基础和样本效率。最后,我们对代码中语义扰动的实验表明,CodeBERT能够鲁棒地区分语义正确和不正确的代码。

英文摘要:

Representational Similarity Analysis is a method from cognitive neuroscience, which helps in comparing representations from two different sources of data. In this paper, we propose using Representational Similarity Analysis to probe the semantic grounding in language models of code. We probe representations from the CodeBERT model for semantic grounding by using the data from the IBM CodeNet dataset. Through our experiments, we show that current pre-training methods do not induce semantic grounding in language models of code, and instead focus on optimizing form-based patterns. We also show that even a little amount of fine-tuning on semantically relevant tasks increases the semantic grounding in CodeBERT significantly. Our ablations with the input modality to the CodeBERT model show that using bimodal inputs (code and natural language) over unimodal inputs (only code) gives better semantic grounding and sample efficiency during semantic fine-tuning. Finally, our experiments with semantic perturbations in code reveal that CodeBERT is able to robustly distinguish between semantically correct and incorrect code.

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

↑