Thanks to the rapid adoption of AI code assistants powered by large language models (LLMs), industry codebases are, increasingly, a hybrid of AI- and human-authored code. For risk management and productivity analysis purposes, it is crucial to enable fine-grained location detection of AI-generated code. To develop algorithms for this task, quality benchmarks are needed to assess performance. However, existing benchmarks tend to comprise academic, LeetCode-style problems and presume a code snippet is either completely human-authored or completely AI-authored, which is not reflective of the diverse intents and styles of industry codebases utilizing AI code assistants. To fill these gaps, we introduce HybridCodeAuthorship, a novel benchmark of Python code files with interleaved human- and AI-authored lines of code to simulate authentic utilization of AI code assistants. In this paper, we first present our dataset construction pipeline, which leverages CodeSearchNet, a massive collection of links to open sourced repositories on GitHub. We then benchmark the performance of two state-of-the-art AI-generated code detection algorithms at both the line- and chunk-level. Experimental results demonstrate that HybridCodeAuthorship is a challenging benchmark with a top-scoring algorithm, AIGCode Detector, obtaining a highest F1 score of 0.48 and 0.56 on chunk-level and line-level code detection tasks, respectively.


翻译:得益于基于大型语言模型(LLMs)的AI代码助手的快速普及,工业级代码库正日益成为AI生成代码与人类编写代码的混合体。出于风险管理和生产力分析的目的,实现AI生成代码的细粒度位置检测至关重要。为开发此类检测算法,需要高质量的基准来评估性能。然而,现有基准数据集通常包含学术性、LeetCode风格的题目,并且假设代码片段要么完全由人类编写,要么完全由AI生成,这未能反映工业代码库在使用AI代码助手时的多样化意图与风格。为填补这些空白,我们提出了HybridCodeAuthorship,一个新颖的Python代码文件基准数据集,其特点是在行级别交替混合人类编写与AI生成的代码,以模拟AI代码助手的真实使用场景。本文首先介绍了我们的数据集构建流程,该流程利用了CodeSearchNet(一个包含GitHub上开源仓库链接的大规模集合)。随后,我们在行级和片段级两种粒度上,对两种最先进的AI生成代码检测算法进行了基准测试。实验结果表明,HybridCodeAuthorship是一个具有挑战性的基准,其中得分最高的算法AIGCode Detector在片段级和行级代码检测任务上分别取得了0.48和0.56的最高F1分数。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
《深度学习代码智能》综述、基准和工具集
专知会员服务
56+阅读 · 2024年1月2日
如何检测LLM内容?UCSB等最新首篇《LLM生成内容检测》综述
NLP-Progress记录NLP最新数据集、论文和代码: 助你紧跟NLP前沿
中国人工智能学会
12+阅读 · 2018年11月15日
GitHub获赞过千:PyTorch 自然语言处理项目Top 5
新智元
12+阅读 · 2018年7月10日
上百份文字的检测与识别资源,包含数据集、code和paper
数据挖掘入门与实战
17+阅读 · 2017年12月7日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月18日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
8+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
10+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员