mlsanityData to 7 Oct 2026

How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?

arXiv 2512.15468 ↗First posted 17 Dec 2025cs.SE cs.AI cs.CRcited by 0

On the map: LLM safety and security → Membership inference attacks

Abstract (arXiv)

The success of large language models for code relies on vast amounts of code data, including public open-source repositories, such as GitHub, and private, confidential code from companies. This raises concerns about intellectual property compliance and the potential unauthorized use of license-restricted code. While membership inference (MI) techniques have been proposed to detect such unauthorized usage, their effectiveness can be undermined by semantically equivalent code transformation techniques, which modify code syntax while preserving semantic. In this work, we systematically investigate whether semantically equivalent code transformation rules might be leveraged to evade MI detection. The results reveal that model accuracy drops by only 1.5% in the worst case for each rule, demonstrating that transformed datasets can effectively serve as substitutes for fine-tuning. Additionally, we find that one of the rules (RenameVariable) reduces MI success by 10.19%, highlighting its potential to obscure the presence of restricted code. To validate these findings, we conduct a causal analysis confirming that variable renaming has the strongest causal effect in disrupting MI detection. Notably, we find that combining multiple transformations does not further reduce MI effectiveness. Our results expose a critical loophole in license compliance enforcement for training large language models for code, showing that MI detection can be substantially weakened by transformation-based obfuscation techniques.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Membership inference attacks, one of 12 directions in LLM safety and security. Builds on 31 of its 55 references that are in the map. First posted on arXiv 17 Dec 2025.

Builds on

31 of 55 references.

Closest ancestors · 3

Same direction, newest first

  1. 2023Practical Membership Inference Attacks against Fine-tuned Large Language Models via Self-prompt Calibration10 Nov
  2. 2023Membership Inference Attacks against Language Models via Neighbourhood Comparison29 May
  3. 2021Mitigating Membership Inference Attacks by Self-Distillation Through a Novel Ensemble Architecture15 Oct

Other references · 28

  1. 2020Extracting Training Data from Large Language Modelscited by 2,144
  2. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  3. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  4. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  5. 2023StarCoder: may the source be with you!cited by 790
  6. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  7. 2021Differentially Private Fine-tuning of Language Modelscited by 392
  8. 2022The Stack: 3 TB of permissively licensed source codecited by 354
  9. 2018Machine Learning with Membership Privacy using Adversarial Regularizationcited by 177
  10. 2020DoWhy: An End-to-End Library for Causal Inferencecited by 92
  11. 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 53
  12. 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 41
16 more
  1. 2023Stealthy Backdoor Attack for Code Modelscited by 32
  2. 2023Unveiling Memorization in Code Modelscited by 29
  3. 2023Assessing the Security of GitHub Copilot Generated Code -- A Targeted Replication Studycited by 24
  4. 2021Challenging Machine Learning-based Clone Detectors via Semantic-preserving Code Transformationscited by 15
  5. 2022Codex Hacks HackerRank: Memorization Issues and a Framework for Code Synthesis Evaluationcited by 14
  6. 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 13
  7. 2023Gotcha! This Model Uses My Code! Evaluating Membership Leakage Risks in Code Modelscited by 11
  8. 2023Evaluating and Explaining Large Language Models for Code Using Syntactic Structurescited by 9
  9. 2024Trained Without My Consent: Detecting Code Inclusion In Language Models Trained on Codecited by 8
  10. 2024An Exploratory Investigation into Code License Infringements in Large Language Model Training Datasetscited by 8
  11. 2025Are Large Language Models Robust in Understanding Code Against Semantics-Preserving Mutations?cited by 7
  12. 2024Which Syntactic Capabilities Are Statistically Learned by Masked Language Models for Code?cited by 6
  13. 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testingcited by 5
  14. 2025How Quantization Impacts Privacy Risk on LLMs for Code?cited by 3
  15. 2022Can Identifier Splitting Improve Open-Vocabulary Language Model of Code?cited by 1
  16. 2025Understanding Privacy Risks in Code Models Through Training Dynamics: A Causal Approachcited by 1

Built on by

Not cited yet.