Large language models (LLMs) for code completion and generation are increasingly used in software development, yet they may reproduce training examples verbatim and without authorship attribution, raising legal and ethical concerns around plagiarism and license compliance. Classical fingerprint-based plagiarism detectors based on fingerprinting, such as Winnowing, remain highly effective, yet the inspection requires comparing fragments of code to the entire training set, and their linear-time search makes them impractical for the billion-scale corpora used to train modern code LLMs. To bridge this gap, we introduce SOURCETRACKER, a 300M-parameter encoder tailored for code retrieval, together with a hybrid two-stage provenance-tracking pipeline HYBRIDSOURCETRACKER (HST). HST first narrows down a small set of candidate snippets via vector search, then re-ranks those candidates using Winnowing on exact fingerprints. We train and evaluate our system on a 10M-snippet subset of the THESTACKV2 dataset, with both verbatim and adapted snippets that emulate realistic identifier renaming. On an in vitro 100k-snippet search space with adapted queries, our hybrid approach reaches a mean reciprocal rank on par with Winnowing for 30-token fragments. Then, starting from windows >= 60 tokens, it consistently over-performs by up to 5.4% while preserving logarithmic-time query complexity. In a complementary evaluation using an LLM-based judge, we find that many retrieved snippets not labeled as ground truth are still highly similar to the expected sources, particularly with longer context windows, and thus remain useful for end users. Overall, our results demonstrate that integrating vector search with fingerprinting enables scalable, high-precision provenance tracking for code produced by LLMs.


翻译:用于代码补全与生成的大型语言模型(LLM)在软件开发中日益普及,但其可能逐字复现训练示例且未标注作者归属,引发关于剽窃与许可合规性的法律与伦理问题。基于指纹识别的经典抄袭检测方法(如Winnowing)虽仍高效,但检测过程需将代码片段与整个训练集比对,其线性时间复杂度使其无法适用于训练现代代码LLM所需的十亿级语料库。为弥合这一鸿沟,我们提出SOURCETRACKER——一个专为代码检索定制的3亿参数编码器,并配套设计混合两阶段溯源管线HYBRIDSOURCETRACKER(HST)。HST先通过向量检索缩小候选片段集,再基于精确指纹利用Winnowing对候选结果重排序。我们在THESTACKV2数据集的1000万片段子集上训练并评估系统,其中包含逐字复制及模拟真实标识符重命名的适应性片段。在包含适应性查询的10万片段体外搜索空间中,我们的混合方法对30标记片段的平均倒数排名与Winnowing持平。当起始片段窗口≥60标记时,该方法持续提升性能高达5.4%,同时保持对数时间的查询复杂度。在基于LLM法官的补充评估中,我们发现许多未标记为真实值的检索片段仍与预期源高度相似(尤其在较长上下文窗口下),从而对最终用户具有实用价值。总体而言,我们的结果表明,将向量检索与指纹识别相结合,可为LLM生成的代码实现可扩展、高精度的溯源追踪。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
利用多个大型语言模型:关于LLM集成的调研
专知会员服务
35+阅读 · 2025年2月27日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
32+阅读 · 2024年9月26日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
如何检测LLM内容?UCSB等最新首篇《LLM生成内容检测》综述
高效的文本生成方法 — LaserTagger 现已开源
TensorFlow
30+阅读 · 2020年2月27日
文本生成公开数据集/开源工具/经典论文详细列表分享
深度学习与NLP
30+阅读 · 2019年9月22日
视频生成的前沿论文,看我们推荐的7篇就够了
人工智能前沿讲习班
34+阅读 · 2018年12月30日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
VIP会员
最新内容
《通过小型无人机系统将情报能力“作战化”》
消耗优势:美军的“精确规模化”概念
专知会员服务
8+阅读 · 6月15日
《离线语言支持系统:面向空战战术决策》
专知会员服务
10+阅读 · 6月15日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员