SynMark: Semantic-Coordinate Multi-Bit Watermarking during LLM Code Generation
Abstract
LLM-generated code is increasingly reused across downstream applications and often undergoes identifier renaming or structural refactoring, making robustness to functionality-preserving edits essential for generative multi-bit code watermarking. Existing methods commonly derive message routes from surface-token prefixes, so such edits can desynchronize routing and degrade watermark recovery. We propose SynMark, which replaces surface-dependent routing with learned semantic coordinates and further calibrates residual recovery errors after transformation. For watermark embedding, Scope learns semantic coordinates from aligned prefixes of functionally equivalent variants for keyed routing and applies a syntax-aware adaptive bias during generation. For watermark extraction, Traced recomputes semantic routes from transformed code and uses reliability-weighted aggregation to suppress unreliable token contributions. Under 100% identifier renaming, SynMark retains 82.27% and 83.77% BitAcc on CodeLlama and DeepSeek-Coder, respectively. Across three code LMs, it also improves clean BitAcc and Pass@1 by up to 4.53 and 11.18 percentage points over the strongest watermarked baselines.
Create a lesson
Related papers
HiMark: Hierarchical and Controllable Multi-bit Watermarking for Large Language Models
Shared title terminologycs.CRKe Zhu, Yanli Chen, Ling Xiong et al.
Reject and Report: Forgery-Evident Undetectable Watermarks for Generative Image Models
Shared title terminologycs.CRYihan Wang, Haochen Sun, Xi He et al.
Secure and Functional Code Generation with Self-Evaluation
Shared title terminologycs.CRMd Afif Al Mamun, Gias Uddin
A Unified Attack Framework against Statistical Generative Watermarks for Large Language Models
Shared title terminologycs.CRRomina Omidi, Nima Naderloui, Yuan Hong et al.
ParseGap: Testing What Coding Agents Authorize and What Shells Execute
Shared title terminologycs.CRJieyu Li
Revealing Semantic Gaps in Zero-Knowledge Virtual Machines via Obligation-Targeted Semantic Fuzzing
Shared title terminologycs.CRHongbo Wen, Jingyu Ke, Hanzhi Liu et al.