Efficient and Scalable Provenance Tracking for LLM-Generated Code Snippets
Not on the map. Why?
Abstract (arXiv)
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...
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 21 of its 37 references that are in the map. First posted on arXiv 27 May 2026.
Builds on
21 of 37 references.
References · 21
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2025Qwen3 Technical Reportcited by 8,820
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,160
- 2016Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphscited by 861
- 2023StarCoder: may the source be with you!cited by 799
- 2022Quantifying Memorization Across Neural Language Modelscited by 763
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2023CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languagescited by 174
9 more
- 2024Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokenscited by 153
- 2023Foundation Models and Fair Usecited by 116
- 2023On Provable Copyright Protection for Generative Modelscited by 98
- 2022Do Language Models Plagiarize?cited by 73
- 2025OLMoTrace: Tracing Language Model Outputs Back to Trillions of Training Tokenscited by 27
- 2024Can Watermarking Large Language Models Prevent Copyrighted Text Generation and Hide Training Data?cited by 18
- 2024PlagBench: Exploring the Duality of Large Language Models in Plagiarism Generation and Detectioncited by 3
- 2025Do LLMs Provide Links to Code Similar to what they Generate? A Study with Gemini and Bing CoPilotcited by 2
- 2025MoSE: Hierarchical Self-Distillation Enhances Early Layer Embeddingscited by 2
Built on by
Not cited yet.