Lune

AAAI2026Top-tier venue

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

Yuanheng Li, Zhuoyang Chen, Xiaoyun Liu, Yuhao Wang, Mingwei Liu, Yang Shi, Kaifeng Huang, Shengjie Zhao

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 SynPrune, a syntax-pruned membership inference attack method tailored for code. Unlike prior MIA approaches that treat code as plain text, 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 SynPrune consistently outperforms the state-of-the-arts. Our method is also robust across varying function lengths and syntax categories.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Comprehensive Privacy Analysis of Deep Learning: Passive and Active White-box Inference Attacks against Centralized and Federated Learning cites Membership Inference Attacks Against Machine Learning Models
  • Comprehensive Privacy Analysis of Deep Learning: Passive and Active White-box Inference Attacks against Centralized and Federated Learning cites ML-Leaks: Model and Data Independent Membership Inference Attacks and Defenses on Machine Learning Models
  • ML-Leaks: Model and Data Independent Membership Inference Attacks and Defenses on Machine Learning Models cites Membership Inference Attacks Against Machine Learning Models
  • Membership Inference Attacks From First Principles cites Membership Inference Attacks Against Machine Learning Models
  • Membership Inference Attacks From First Principles cites Comprehensive Privacy Analysis of Deep Learning: Passive and Active White-box Inference Attacks against Centralized and Federated Learning
  • Membership Inference Attacks From First Principles cites ML-Leaks: Model and Data Independent Membership Inference Attacks and Defenses on Machine Learning Models
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on20

  1. Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 citations
  2. Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley et al.ICML 2023 · 1,822 citations
  3. Comprehensive Privacy Analysis of Deep Learning: Passive and Active White-box Inference Attacks against Centralized and Federated LearningMilad Nasr, Reza Shokri, Amir HoumansadrS&P 2019 · 1,778 citations
  4. ML-Leaks: Model and Data Independent Membership Inference Attacks and Defenses on Machine Learning ModelsAhmed Salem, Yang Zhang, Mathias Humbert, Pascal Berrang et al.NDSS 2019 · 1,141 citations
  5. Membership Inference Attacks From First PrinciplesNicholas Carlini, Steve Chien, Milad Nasr, Shuang Song et al.S&P 2022 · 1,049 citations

Related papers

  1. Code Membership Inference for Detecting Unauthorized Data Use in Code Pre-trained Language ModelsSheng Zhang, Hui Li, Rongrong JiEMNLP Findings 2024 · 6 citations
  2. Sampling-based Pseudo-Likelihood for Membership Inference AttacksMasahiro Kaneko, Youmi Ma, Yuki Wata, Naoaki OkazakiACL Findings 2025 · 6 citations
  3. How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?Hua Yang, Alejandro Velasco, Thanh Le-Cong, Md Nazmul Haque et al.ICSE 2026
  4. Can Watermarking Large Language Models Prevent Copyrighted Text Generation and Hide Training Data?Michael-Andrei Panaitescu-Liess, Zora Che, Bang An, Yuancheng Xu et al.AAAI 2025 · 21 citations
  5. DPDLLM: A Black-box Framework for Detecting Pre-training Data from Large Language ModelsBaohang Zhou, Zezhong Wang, Lingzhi Wang, Hongru Wang et al.ACL Findings 2024 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines