Uncovering Pretraining Code in LLMs: A Syntax-Aware Attribution Approach

Read full text
Authors: Association for Artificial Intelligence 2026, Zhuoyang Chen, Liyuan heng, Kaifeng Huang, Xiaoyun Liu, Mingwei Liu, Yang Shi, Yuhao Wang, Shengjie Zhao
Cited by: 0

Abstract

As large language models (LLMs) become increasingly capable, concerns over the unauthorized use of copyrighted and licensed content in their training data have grown, especially in the context of code. Open-source code, often protected by open source licenses (e.g, GPL), poses legal and ethical challenges when used in pretraining. Detecting whether specific code samples were included in LLM training data is thus critical for transparency, accountability, and copyright compliance. We propose \textsc{SynPrune}, a syntax-pruned membership inference attack method tailored for code. Unlike prior MIA approaches that treat code as plain text, \textsc{SynPrune} leverages the structured and rule-governed nature of programming languages. Specifically, it identifies and excludes consequent tokens that are syntactically required and not reflective of authorship, from attribution when computing membership scores. Experimental results show that \textsc{SynPrune} consistently outperforms the state-of-the-arts. Our method is also robust across varying function lengths and syntax categories.

Fields of Study & Subjects

Software Engineering Research Adversarial Robustness in Machine Learning Law AI and Intellectual Property

Publication details

Journal / source
Underline Science Inc.
Publication date
7 January 2026
Language
EN