EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

PuzzleMark: Implicit Jigsaw Learning for Robust Code Dataset Watermarking in Neural Code Completion Models

Haocheng Huang, Yuchen Chen, Weisong Sun, Peizhuo Lv, Yuan Xiao, Chunrong Fang, Yang Liu, Xiaofang Zhang

Proceedings of the ACM on Software Engineering · 30.06.2026 · 3 (FSE) · 590-612

DOI: 10.1145/3797122 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Software Engineering, online erschienen am 30.06.2026. Verfasst von Haocheng Huang und 7 weiteren Autor:innen. Die Arbeit nennt 43 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: National Natural Science Foundation of China, Major Program of the Natural Science Foundation of Jiangsu Higher Education Institutions of China, Collaborative Innovation Center of Novel Software Technology and Industrialization.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Constructing and curating high-quality code datasets requires significant resources, making them valuable intellectual property. Unfortunately, these datasets currently face severe risks of unauthorized use. Although digital watermarking offers a post hoc mechanism for copyright authentication, existing methods are predominantly based on the co-occurrence pattern, which is not robust and is susceptible to watermark detection and removal attacks. In this paper, we propose PuzzleMark, a robust watermarking method for code datasets. To reduce the risk of watermark exposure, PuzzleMark introduces a carrier selection strategy that leverages code complexity to evaluate the suitability of code snippets as watermark carriers, and selects those with high suitability for watermarking. To enhance the robustness of the watermark, PuzzleMark proposes a novel concatenation pattern to replace the traditional co-occurrence pattern, and implements two watermarking strategies through variable name concatenation. PuzzleMark adaptively embeds watermarks based on the inherent characteristics of the code, making it more stealthy while maintaining design simplicity. For watermark verification, PuzzleMark employs Fisher’s exact test to verify suspicious models under a black-box setting. Experimental results demonstrate that PuzzleMark achieves a 100 percent verification success rate and a 0 percent false positive rate, with negligible impact on model performance. Both our human study and our evaluation using four state-of-the-art watermark detection methods show that PuzzleMark exhibits strong imperceptibility, with an average suspicious rate ≤ 0.24 and an average recall ≤ 30.41 percent, respectively. Furthermore, the consistent retention of verifiability under two attack scenarios further corroborates the robustness of PuzzleMark. As a practical digital watermarking method, PuzzleMark provides strong protection for the intellectual property of code datasets and offers new insights for future research.

Förderung

  • National Natural Science Foundation of China
  • Major Program of the Natural Science Foundation of Jiangsu Higher Education Institutions of China
  • Collaborative Innovation Center of Novel Software Technology and Industrialization
  • Priority Academic Program Development of Jiangsu Higher Education Institutions
  • National Research Foundation Singapore
  • DSO National Laboratories - Singapore

Zitieren

APA

Huang, H., Chen, Y., Sun, W., Lv, P., Xiao, Y., Fang, C., Liu, Y., & Zhang, X. (2026). PuzzleMark: Implicit Jigsaw Learning for Robust Code Dataset Watermarking in Neural Code Completion Models. Proceedings of the ACM on Software Engineering, 3(FSE), 590-612. https://doi.org/10.1145/3797122

Vancouver

Huang H, Chen Y, Sun W, Lv P, Xiao Y, Fang C, et al. PuzzleMark: Implicit Jigsaw Learning for Robust Code Dataset Watermarking in Neural Code Completion Models. Proceedings of the ACM on Software Engineering. 2026;3(FSE):590-612. doi:10.1145/3797122

BibTeX
@article{Huang2026,
  author = {Huang, Haocheng and Chen, Yuchen and Sun, Weisong and Lv, Peizhuo and Xiao, Yuan and Fang, Chunrong and Liu, Yang and Zhang, Xiaofang},
  title = {PuzzleMark: Implicit Jigsaw Learning for Robust Code Dataset Watermarking in Neural Code Completion Models},
  journal = {Proceedings of the ACM on Software Engineering},
  year = {2026},
  volume = {3},
  number = {FSE},
  pages = {590--612},
  doi = {10.1145/3797122}
}
Kostenlos starten →