paperbot · PL 论文追踪

全部论文 待读 收藏

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

语义等价的代码变换如何影响面向代码的大语言模型上的成员推断?
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 该论文聚焦代码大模型的成员推断与隐私合规,属于安全/隐私方向,与用户的静态分析(PL→AI / AI→PL)、浮点程序分析和贝叶斯程序分析均无直接交集;仅在'代码变换/语义等价'与'LLM for code'层面有极其边缘的关联,且研究目标本身是评估 LLM 的隐私泄露而非改进程序分析。引用 0 inbox
Hua Yang, Alejandro Velasco, Thanh Le-Cong, Md Nazmul Haque, Bowen Xu, Denys Poshyvanyk
crossref: 2026-09-12

AI 速览

一句话:系统研究语义等价代码变换对代码大模型成员推断的影响,发现变量重命名可把检测成功率降低约10%。

大型代码语言模型的训练依赖海量代码,其中可能混入受许可证限制的私有代码,成员推断(membership inference, MI)被用于检测此类未授权使用。本文系统考察保持语义的代码变换能否被用来规避 MI 检测:作者对代码数据集施加多种语义等价变换规则,微调代码大模型后测量模型准确率与 MI 攻击成功率的变化,并用因果分析量化各规则的因果效应。结果表明,每条规则在最坏情况下仅使模型准确率下降 1.5%,说明变换后的数据仍可作为微调替代;其中 RenameVariable 使 MI 成功率下降 10.19%,因果分析证实变量重命名对破坏 MI 的因果效应最强;而组合多个变换并不会进一步削弱 MI。该工作揭示了代码大模型许可证合规执法中的关键漏洞。

问题
代码大模型的训练数据可能包含受许可证限制的代码,而现有的成员推断检测方法是否能被保持语义的代码变换所规避尚不清楚。
方法
系统地对代码施加多种语义等价变换规则,分别微调代码大模型并测量准确率与成员推断成功率,同时用因果分析量化各变换规则对 MI 检测效果的因果作用。
评估
以模型准确率下降幅度和 MI 攻击成功率变化为指标,评估单条规则与规则组合的效果;结果显示单规则最多仅降 1.5% 准确率,RenameVariable 使 MI 成功率下降 10.19%,组合变换无额外削弱。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11673,
  title = {How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?},
  author = {Hua Yang and Alejandro Velasco and Thanh Le-Cong and Md Nazmul Haque and Bowen Xu and Denys Poshyvanyk},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787843}
}