arXiv cs.AI· Andrea Gurioli, Davide D'Ascenzo, Federico Pennino, Maurizio Gabbrielli, Stefano Zacchiroli·· 9 天前AI 评分27
SourceTracker:面向 LLM 生成代码片段的高效可扩展溯源追踪
Efficient and Scalable Provenance Tracking for LLM-Generated Code Snippets
AI 导读
研究团队提出 SourceTracker——一个 300M 参数的代码检索编码器,并搭配两阶段溯源追踪流程 HybridSourceTracker(HST):先用向量搜索缩小候选片段范围,再用 Winnowing 对精确指纹重排序。
正文 · 原文
Abstract: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, 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 overperforms 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, provided that their training data is made accessible...
| Comments: | Article accepted at The Journal of Systems & Software |
| Subjects: | Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Information Retrieval (cs.IR) |
| Cite as: | arXiv:2605.28510 [cs.SE] |
| (or arXiv:2605.28510v3 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2605.28510 arXiv-issued DOI via DataCite |
Submission history
From: Andrea Gurioli [view email]
[v1]
Wed, 27 May 2026 14:12:17 UTC (309 KB)
[v2]
Mon, 8 Jun 2026 10:22:34 UTC (309 KB)
[v3]
Thu, 8 Oct 2026 07:47:28 UTC (279 KB)
来源:arXiv cs.AI · arxiv.org