CodeMark: Imperceptible watermarking for code datasets against neural code completion models

Zhensu Sun, Xiaoning Du, Fu Song, Li Li

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearchpeer-review

7 Citations (Scopus)

Abstract

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.

Original languageEnglish
Title of host publicationESEC/FSE 2023 - Proceedings of the 31st ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering
EditorsSatish Chandra, Kelly Blincoe, Paolo Tonella
Place of PublicationNew York NY USA
PublisherAssociation for Computing Machinery (ACM)
Pages1561-1572
Number of pages12
ISBN (Electronic)9798400703270
DOIs
Publication statusPublished - 30 Nov 2023
EventJoint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering 2023 - San Francisco, United States of America
Duration: 3 Dec 20239 Dec 2023
Conference number: 31st
https://dl.acm.org/doi/proceedings/10.1145/3611643 (Proceedings)
https://conf.researchr.org/home/fse-2023 (Website)

Conference

ConferenceJoint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering 2023
Abbreviated titleESEC/FSE 2023
Country/TerritoryUnited States of America
CitySan Francisco
Period3/12/239/12/23
Internet address

Keywords

  • Code dataset
  • Neural code completion models
  • Watermarking

Cite this