CLAVE: A deep learning model for source code authorship verification with contrastive learning and transformer encoders

IF 6.9 1区 管理学 Q1 COMPUTER SCIENCE, INFORMATION SYSTEMS Information Processing & Management Pub Date : 2025-05-01 Epub Date: 2024-12-06 DOI:10.1016/j.ipm.2024.104005
David Álvarez-Fidalgo , Francisco Ortin
{"title":"CLAVE: A deep learning model for source code authorship verification with contrastive learning and transformer encoders","authors":"David Álvarez-Fidalgo ,&nbsp;Francisco Ortin","doi":"10.1016/j.ipm.2024.104005","DOIUrl":null,"url":null,"abstract":"<div><div>Source code authorship verification involves determining whether two code fragments are written by the same programmer. It has many uses, including malware authorship analysis, copyright dispute resolution and plagiarism detection. Source code authorship verification is challenging because it must generalize to code written by programmers not included in its training data. In this paper, we present CLAVE (Contrastive Learning for Authorship Verification with Encoder representations), a novel deep learning model for source code authorship verification that leverages contrastive learning and a Transformer Encoder-based architecture. We initially pre-train CLAVE on a dataset of 270,602 Python source code files extracted from GitHub. Subsequently, we fine-tune CLAVE for authorship verification using contrastive learning on Python submissions from 61,956 distinct programmers in Google Code Jam and Kick Start competitions. This approach allows the model to learn stylometric representations of source code, enabling comparison via vector distance for authorship verification. CLAVE achieves an AUC of 0.9782, reduces the error of the state-of-the-art source code authorship verification systems by at least 23.4% and improves the AUC of cutting-edge source code LLMs by 21.9% to 40%. We also evaluate the main components of CLAVE on its AUC performance improvement: pre-training (1.8%), loss function (0.2%–2.8%), input length (0.1%–0.7%), model size (0.2%), and tokenizer (0.1%–0.7%).</div></div>","PeriodicalId":50365,"journal":{"name":"Information Processing & Management","volume":"62 3","pages":"Article 104005"},"PeriodicalIF":6.9000,"publicationDate":"2025-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information Processing & Management","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0306457324003649","RegionNum":1,"RegionCategory":"管理学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2024/12/6 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0

Abstract

Source code authorship verification involves determining whether two code fragments are written by the same programmer. It has many uses, including malware authorship analysis, copyright dispute resolution and plagiarism detection. Source code authorship verification is challenging because it must generalize to code written by programmers not included in its training data. In this paper, we present CLAVE (Contrastive Learning for Authorship Verification with Encoder representations), a novel deep learning model for source code authorship verification that leverages contrastive learning and a Transformer Encoder-based architecture. We initially pre-train CLAVE on a dataset of 270,602 Python source code files extracted from GitHub. Subsequently, we fine-tune CLAVE for authorship verification using contrastive learning on Python submissions from 61,956 distinct programmers in Google Code Jam and Kick Start competitions. This approach allows the model to learn stylometric representations of source code, enabling comparison via vector distance for authorship verification. CLAVE achieves an AUC of 0.9782, reduces the error of the state-of-the-art source code authorship verification systems by at least 23.4% and improves the AUC of cutting-edge source code LLMs by 21.9% to 40%. We also evaluate the main components of CLAVE on its AUC performance improvement: pre-training (1.8%), loss function (0.2%–2.8%), input length (0.1%–0.7%), model size (0.2%), and tokenizer (0.1%–0.7%).
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
CLAVE:一个使用对比学习和转换器编码器进行源代码作者验证的深度学习模型
源代码作者身份验证包括确定两个代码片段是否由同一程序员编写。它有许多用途,包括恶意软件作者分析,版权纠纷解决和抄袭检测。源代码作者验证是具有挑战性的,因为它必须泛化到由未包含在其训练数据中的程序员编写的代码。在本文中,我们提出了CLAVE(基于编码器表示的作者身份验证的对比学习),这是一种利用对比学习和基于Transformer编码器的架构的源代码作者身份验证的新型深度学习模型。我们最初在从GitHub提取的270,602个Python源代码文件的数据集上预训练CLAVE。随后,我们对CLAVE的作者身份验证进行了微调,并对谷歌Code Jam和Kick Start比赛中61956名不同程序员提交的Python进行了对比学习。这种方法允许模型学习源代码的风格表示,通过矢量距离进行比较以验证作者身份。CLAVE实现了0.9782的AUC,将最先进的源代码作者身份验证系统的误差降低了至少23.4%,并将最先进的源代码llm的AUC提高了21.9%至40%。我们还对CLAVE的AUC性能改进的主要组成部分进行了评估:预训练(1.8%)、损失函数(0.2% - 2.8%)、输入长度(0.1%-0.7%)、模型大小(0.2%)和标记器(0.1%-0.7%)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
Information Processing & Management
Information Processing & Management 工程技术-计算机:信息系统
CiteScore
17.00
自引率
11.60%
发文量
276
审稿时长
39 days
期刊介绍: Information Processing and Management is dedicated to publishing cutting-edge original research at the convergence of computing and information science. Our scope encompasses theory, methods, and applications across various domains, including advertising, business, health, information science, information technology marketing, and social computing. We aim to cater to the interests of both primary researchers and practitioners by offering an effective platform for the timely dissemination of advanced and topical issues in this interdisciplinary field. The journal places particular emphasis on original research articles, research survey articles, research method articles, and articles addressing critical applications of research. Join us in advancing knowledge and innovation at the intersection of computing and information science.
期刊最新文献
Fuzzy neighborhood rough set-based attribute reduction over temporal information systems with application to clinical efficacy evaluation Empowering open-domain LLMs for legal document correction via legal knowledge integration and decoding constraints CTJANet: A class-task joint-aware network for enhanced few-shot image classification ALC-DRKG: an active learning-based framework for dynamic knowledge graph construction for drug repositioning Measuring stance dynamics in political debate using temporal graph neural networks
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1