arXiv:2602.13240cs.AIcs.SE2026-02

针对代码模型设计了语法感知的成员推理攻击,提升版权审计可靠性。

AST-PAC: AST-guided Membership Inference for Code

  • 用抽象语法树生成合法代码扰动样本,保持语法正确性。
  • 在复杂大文件上表现优于传统方法,小文件和纯字母数字代码效果差。
  • 为代码模型版权审计提供新思路,适合关注模型数据合规的研究者。

代码大模型通常在包含受限许可源码的海量数据集上训练,带来紧迫的数据治理与版权挑战。成员推理攻击(MIA)可作为审计手段,检测模型中的未经授权数据使用。尽管损失攻击提供了基线,但极化增强校准(PAC)等更复杂方法在代码领域仍研究不足。本文首次在30亿至70亿参数的代码模型上评估这些方法。结果表明,尽管PAC整体优于损失基线,但其性能依赖于忽略代码严格语法的增强策略,在大型复杂文件上反而下降。为此,我们提出AST-PAC,一种基于抽象语法树(AST)扰动的领域特定改进,生成语法有效的校准样本。初步结果显示,随着代码语法结构增大,AST-PAC性能提升,而传统PAC则退化;但在小型文件上过度扰动,且在含大量字母数字的代码中表现不佳。总体而言,该研究推动未来对语法感知、大小自适应校准方法的研究,以实现可靠的代码语言模型溯源审计。

原文摘要 · Abstract (English)

Code Large Language Models are frequently trained on massive datasets containing restrictively licensed source code. This creates urgent data governance and copyright challenges. Membership Inference Attacks (MIAs) can serve as an auditing mechanism to detect unauthorized data usage in models. While attacks like the Loss Attack provide a baseline, more involved methods like Polarized Augment Calibration (PAC) remain underexplored in the code domain. This paper presents an exploratory study evaluating these methods on 3B--7B parameter code models. We find that while PAC generally outperforms the Loss baseline, its effectiveness relies on augmentation strategies that disregard the rigid syntax of code, leading to performance degradation on larger, complex files. To address this, we introduce AST-PAC, a domain-specific adaptation that utilizes Abstract Syntax Tree (AST) based perturbations to generate syntactically valid calibration samples. Preliminary results indicate that AST-PAC improves as syntactic size grows, where PAC degrades, but under-mutates small files and underperforms on alphanumeric-rich code. Overall, the findings motivate future work on syntax-aware and size-adaptive calibration as a prerequisite for reliable provenance auditing of code language models.

成员推理代码模型版权审计语法感知

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