arXiv:2512.15468cs.SEcs.AI2025-12被引 2

代码变换可有效规避大模型训练中的版权检测,变量重命名最有效。

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

  • 用语义等价的代码变换(如重命名变量)干扰版权检测
  • 变换后模型性能仅下降1.5%,且重命名使检测成功率降10.19%
  • 多变换组合无额外增效,但变量重命名有最强因果影响

大语言模型训练依赖海量代码数据,包括公开的GitHub和私有企业代码,引发知识产权合规担忧。尽管已有成员推断(MI)技术用于检测未经授权使用受许可证保护的代码,但语义等价的代码变换(如语法修改但保持功能不变)可能削弱其效果。本研究系统评估此类变换对MI检测的影响:结果表明,每种变换导致模型准确率最多下降1.5%,证明变换后的数据可有效替代原数据进行微调;其中,变量重命名(RenameVariable)使MI成功率降低10.19%,显著掩盖受限代码的存在。因果分析确认变量重命名具有最强干扰作用。值得注意的是,组合多种变换并未进一步提升隐蔽性。研究揭示了当前代码模型训练中版权合规检测的关键漏洞,表明基于变换的混淆技术可显著削弱MI检测效力。

原文摘要 · Abstract (English)

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.

代码生成成员推断版权保护代码变换

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。