一句话:提出 CodeMark,通过语义保持变换向代码数据集嵌入不可感知水印,以追踪其是否被用于训练神经代码补全模型。
代码数据集对训练神经代码补全模型具有巨大价值,但面临数据泄露、许可违规和未经授权使用等风险;神经模型的黑盒特性又使外部难以审计其训练数据,而现有图像与自然语言水印方法因领域差异无法直接应用于代码。本文提出 CodeMark,基于自适应语义保持变换将用户定义的水印嵌入代码数据集,既保持代码功能不变,又使改动对违规者隐蔽。作者实现工具包并在代码补全模型上开展广泛评估,验证 CodeMark 满足实用水印的关键性质:不损害模型准确率、可验证、鲁棒且不可感知。
Code datasets are of immense value for training neural-network-based code completion models, where companies or organizations have made substantial investments to establish and process these datasets. Unluckily, these datasets, either built for proprietary or public usage, face the high risk of unauthorized exploits, resulting from data leakages, license violations, etc. Even worse, the "black-box" nature of neural models sets a high barrier for externals to audit their training datasets, which further connives these unauthorized usages. Currently, watermarking methods have been proposed to prohibit inappropriate usage of image and natural language datasets. However, due to domain specificity, they are not directly applicable to code datasets, leaving the copyright protection of this emerging and important field of code data still exposed to threats. To fill this gap, we propose a method, named CodeMark, to embed user-defined imperceptible watermarks into code datasets to trace their usage in training neural code completion models. CodeMark is based on adaptive semantic-preserving transformations, which preserve the exact functionality of the code data and keep the changes covert against rule-breakers. We implement CodeMark in a toolkit and conduct an extensive evaluation of code completion models. CodeMark is validated to fulfill all desired properties of practical watermarks, including harmlessness to model accuracy, verifiability, robustness, and imperceptibility.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2308-14401,
title = {CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models},
author = {Zhensu Sun and Xiaoning Du and Fu Song and Li Li},
booktitle = {FSE},
year = {2023},
doi = {10.1145/3611643.3616297}
}