Code Membership Inference for Detecting Unauthorized Data Use in Code Pre-trained Language Models
Sheng Zhang, Hui Li
TL;DR
Code Membership Inference targets unauthorized training-data use in code pre-trained language models by introducing Code Membership Inference (CMI) and a practical tool, Buzzer. Buzzer combines signal extraction from pre-training tasks, calibration to handle hard-to-learn samples, and weighted inference to distinguish member from non-member data under white-box and black-box settings. Experiments across CodeBERT, CodeT5, DeepseekCoder, and CodeLlama show high AUC, with larger CPLMs delivering stronger signals and black-box performance remaining competitive, supporting IP-protection applications. The work offers a concrete auditing framework for CPLMs and points to future extensions to larger modalities and stronger generalization capabilities.
Abstract
Code pre-trained language models (CPLMs) have received great attention since they can benefit various tasks that facilitate software development and maintenance. However, CPLMs are trained on massive open-source code, raising concerns about potential data infringement. This paper launches the study of detecting unauthorized code use in CPLMs, i.e., Code Membership Inference (CMI) task. We design a framework Buzzer for different settings of CMI. Buzzer deploys several inference techniques, including signal extraction from pre-training tasks, hard-to-learn sample calibration and weighted inference, to identify code membership status accurately. Extensive experiments show that CMI can be achieved with high accuracy using Buzzer. Hence, Buzzer can serve as a CMI tool and help protect intellectual property rights.
