arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.15468cs.SEcs.AIcs.CR
收藏

语义等价的代码转换如何影响LLM代码上的成员推断?

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

North Carolina State University(北卡罗来纳州立大学);Singapore University of Technology and Design(新加坡科技与设计大学)

Hua Yang, Alejandro Velasco, Thanh Le-Cong, Md Nazmul Haque, Bowen Xu, Denys Poshyvanyk

AI总结:

本研究探讨了语义等价代码转换对LLM代码成员推断的影响,发现变量重命名可降低MI成功率10.19%,揭示了训练模型时的合规性漏洞。

摘要:

大型语言模型在代码上的成功依赖于大量的代码数据,包括公共开源仓库,如GitHub,以及公司的私有保密代码。这引发了关于知识产权合规性和潜在未经授权使用受许可代码的担忧。尽管已提出成员推断(MI)技术来检测此类未经授权的使用,但语义等价的代码转换技术可能会削弱其有效性。这些技术修改代码语法,同时保持语义。在本工作中,我们系统地研究了是否可以利用语义等价的代码转换规则来逃避MI检测。结果表明,对于每种规则,最坏情况下模型准确性下降仅1.5%,证明了转换后的数据集可以有效替代微调。此外,我们发现其中一种规则(重命名变量)使MI成功性降低10.19%,突显了其可能掩盖受限制代码的存在。为了验证这些发现,我们进行了因果分析,确认变量重命名在破坏MI检测中有最强的因果效应。值得注意的是,我们发现结合多种转换不会进一步减少MI的有效性。我们的结果揭示了在训练大型语言模型时知识产权合规性执行的关键漏洞,显示通过基于转换的混淆技术可以显著削弱MI检测。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑