It is proved that, under an intuitive and experimentally supported assumption called distribution consistency, obfuscation can nullify the robustness of N-gram-based watermarks and motivate more semantics-aware alternatives.
Abstract
Large language models (LLMs) are increasingly used for code generation, making reliable identification of machine-generated code important for attribution, tracking, and misuse detection. Existing code watermarking methods are dominated by N-gram-based schemes, yet their robustness has mostly been evaluated only against simple edits or optimizations. We argue that this significantly overstates security, because software engineering already provides stronger semantics-preserving transformations in the form of code obfuscation. We study N-gram-based code watermarking under obfuscation. We formally model semantics-preserving transformations as a Markov random walk and prove that, under an intuitive and experimentally supported assumption called distribution consistency, obfuscation can nullify the robustness of N-gram-based watermarks. If the original detector has a false positive rate fpr, then after obfuscation, its failure rate on watermarked code approaches 1 - fpr. We validate this theory on three state-of-the-art watermarking schemes, two LLMs, two programming languages, four benchmarks, and four obfuscators. Across all settings, detectors collapse to near-random performance on obfuscated code (AUROC tightly around 0.5), and for each language, at least one attack leaves all post-obfuscation AUROC scores below 0.6. These results jointly show that current N-gram-based code watermarks are not robust to realistic obfuscation attacks and motivate more semantics-aware alternatives.
This work introduces OpenStamp, a watermarking technique that encodes the watermarking logic directly into the model weights by modifying only the final projection, or unembedding, layer, and shows that OpenStamp achieves superior detection performance, with minimal degradation in model capabilities compared to prior m...
Results show that the copy–paste attack degrades watermark detectability when using very sparingly and only short sentences are used, while deletion becomes effective only at extreme levels on short texts, and underscore the need for future watermark designs to prioritise resilience to semantic and cross-lingual transf...
Jakob Elias Albrecht, A. Jakoby, Benno Maria et al.· 0 citations
It is observed that strings serve as a critical information source for code semantics, offering superior contextual density, obfuscation robustness, and language independence, and a context-aware secret detection tool, Secretron, is designed, based on StringGroup methods and Transformer model.
Zheng-Dong Huang, Kevin Li, Jin-Qiu Yang et al.· Proceedings of the ACM on So...· 0 citations
Stateless Bernoulli Watermarking (SBW) is introduced, a new statistical watermark for Large Language Models that determines green list membership through independent per-token Bernoulli trials, reducing membership complexity to $O(1)$ and enabling single-kernel execution with zero intermediate allocations.
DHMark is introduced, a public-key watermarking framework for LLM-generated text that avoids exact recovery of a long embedded signature and instead treats watermark detection as registry-aided statistical evidence aggregation.
Haocheng Fu, Yuqi Qian, Luyao Wang et al.· 0 citations
This work reproduces the Reprompt forgery attack of M\"uller et al. against Tree-Ring on Stable Diffusion XL, and reports a prediction made from reading the detector source that the authors' measurements then contradicted.
Saifur Rahman Tamim, Md Taslimul Hasan Toufique, A. M. Tayeful Islam· 0 citations
Research Manager Mike Walker reflects on a career spanning hacker culture, cybersecurity, and AI, sharing lessons about trust, teamwork, leadership, and why solving difficult problems requires curiosity, judgment, agility—and an understanding of the rules. The post Learn the rules: The hacker mindset appeared first on Microsoft Research.
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.