PuzzleMark: Implicit Jigsaw Learning for Robust Code Dataset Watermarking in Neural Code Completion Models
On the map: LLM safety and security → Watermarking generated content and models
Abstract (arXiv)
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% verification success rate and a 0% 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%, respectively. As a practical digital watermarking method, PuzzleMark provides strong protection for the intellectual property of code datasets and offers new insights for future research.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Watermarking generated content and models, one of 12 directions in LLM safety and security. Builds on 16 of its 37 references that are in the map. First posted on arXiv 30 Apr 2026.
Builds on
16 of 37 references.
Closest ancestors · 3
Same direction, newest first
- 2024Beyond Dataset Watermarking: Model-Level Copyright Protection for Code Summarization Models18 Oct
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models28 Aug
- 2023Who Wrote this Code? Watermarking for Code Generation24 May
Other references · 13
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2018Spectral Signatures in Backdoor Attackscited by 484
- 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 131
- 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 103
- 2023TrojanPuzzle: Covertly Poisoning Code-Suggestion Modelscited by 60
- 2023Stealthy Backdoor Attack for Code Modelscited by 49
- 2021CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoningcited by 47
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2022Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehensioncited by 10
- 2025Show Me Your Code! Kill Code Poisoning: A Lightweight Method Based on Code Naturalnesscited by 8
- 2018Public Git Archive: a Big Code dataset for allcited by 6
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026DuCodeMark: Dual-Purpose Code Dataset Watermarking via Style-Aware Watermark-Poison Design ↗
- 2023Towards Tracing Code Provenance with Code Watermarking
- 2025Towards Generalized and Stealthy Watermarking for Generative Code Models
- 2026MATRIX: Multi-Layer Code Watermarking via Dual-Channel Constrained Parity-Check Encoding ↗
- 2025CLASP: Training-Free LLM-Assisted Source Code Watermarking via Semantic-Preserving Transformations
- 2026PromptMark: A Prompt-Guided Iterative-Feedback Framework for Source Code Watermarking ↗
- 2026SWaRL: Safeguard Code Watermarking via Reinforcement Learning
- 2025Optimizing Token Choice for Code Watermarking: An RL Approach