DeCoMa: Detecting and Purifying Code Dataset Watermarks through Dual Channel Code Abstraction

📅 2025-04-09
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing code watermarking techniques exhibit robustness against dilution and backdoor attacks but suffer from poor detectability and cleanability due to their high concealment. This paper proposes a dual-channel code abstraction framework enabling zero-shot watermark detection and silent purification without model training. Leveraging standardized template modeling and anomaly correlation analysis, the framework jointly exploits syntactic structures and semantic patterns to identify watermarks embedded at ultra-low rates (0.1%). Its key innovation is the first unsupervised outlier correlation detection mechanism under dual-channel constraints. Evaluated across 14 watermark types and 14 code-related tasks, the method achieves 100% stable recall, with detection speed accelerated by 31.5–130.9× over baselines. Crucially, post-purification model performance remains fully preserved, demonstrating both efficacy and practicality for real-world deployment.

Technology Category

Application Category

📝 Abstract
Watermarking is a technique to help identify the source of data points, which can be used to help prevent the misuse of protected datasets. Existing methods on code watermarking, leveraging the idea from the backdoor research, embed stealthy triggers as watermarks.Despite their high resilience against dilution attacks and backdoor detections, the robustness has not been fully evaluated. To fill this gap, we propose DeCoMa, a dual-channel approach to Detect and purify Code dataset waterMarks.To overcome the high barrier created by the stealthy and hidden nature of code watermarks, DeCoMa leverages dual-channel constraints on code to generalize and map code samples into standardized templates. Subsequently, DeCoMa extracts hidden watermarks by identifying outlier associations between paired elements within the standardized templates. Finally, DeCoMa purifies the watermarked dataset by removing all samples containing the detected watermark, enabling the silent appropriation of protected code. We conduct extensive experiments to evaluate the effectiveness and efficiency of DeCoMa, covering 14 types of code watermarks and 3 representative intelligent code tasks (a total of 14 scenarios). Experimental results demonstrate that DeCoMa achieves a stable recall of 100% in 14 code watermark detection scenarios, significantly outperforming the baselines. Additionally, DeCoMa effectively attacks code watermarks with embedding rates as low as 0.1%, while maintaining comparable model performance after training on the purified dataset. Furthermore, as DeCoMa requires no model training for detection, it achieves substantially higher efficiency than all baselines, with a speedup ranging from 31.5 to 130.9X. The results call for more advanced watermarking techniques for code models, while DeCoMa can serve as a baseline for future evaluation.
Problem

Research questions and friction points this paper is trying to address.

Detect and purify hidden watermarks in code datasets
Evaluate robustness of existing code watermarking techniques
Enable silent appropriation of protected code resources
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dual-channel constraints generalize code samples
Extracts watermarks via outlier associations
Purifies dataset by removing watermarked samples
🔎 Similar Papers
No similar papers found.
Yuan Xiao
Yuan Xiao
ShanghaiTech University
Computer Security
Yuchen Chen
Yuchen Chen
assistant professor of communication studies at CUNY, baruch college
chinadigital studiesSTS
Shiqing Ma
Shiqing Ma
University of Massachusetts, Amherst
SecurityAISE
H
Haocheng Huang
Soochow University, China
Chunrong Fang
Chunrong Fang
Software Institute, Nanjing University
Software TestingSoftware EngineeringComputer Science
Y
Yanwei Chen
State Key Laboratory for Novel Software Technology, Nanjing University, China
Weisong Sun
Weisong Sun
Nanyang Technological University
Trustworthy Intelligent SE (Software Engineering)
Y
Yunfeng Zhu
State Key Laboratory for Novel Software Technology, Nanjing University, China
X
Xiaofang Zhang
Soochow University, China
Z
Zhenyu Chen
State Key Laboratory for Novel Software Technology, Nanjing University, China and Shenzhen Research Institute, Nanjing University, China