将代码归因于生成它的大语言模型对于出处、许可和滥用问责至关重要,但目前没有已部署的水印能满足这一需求。生成时方案需要访问生成模型,无法应用于第三方代码;事后方案虽适用于任何代码,但有效载荷最多4位,不足以区分众多已部署的模型配置。我们提出多通道扩频水印,这是首个具有24位有效载荷且无需训练的事后代码水印,并具有形式化的鲁棒性保证。该方案在变量命名约定和八对语义等效的代码模式中编码位,通过密钥伪随机置换将每个位置映射到码字位,使每个位获得多个独立投票。多数投票吸收分布式损坏,外部里德 - 所罗门码在集中通道攻击击败投票时恢复标识符,为格式化、句法和结构攻击提供了可证明的鲁棒性界限。在来自CodeNet以及GPT - 4.1和Llama - 4生成的1750个Python文件上,水印实现了100%的干净检测准确率且零误报。在17种攻击类型下,在8次变量重命名时恢复标识符的准确率为97.6%,在10%的随机逐位损坏下为94.1%,而最强的事后基线在任何单一变换攻击下准确率降至0%。在CPU上嵌入和检测 together take under 200 ms on CPU without training data or GPU。
英文摘要:
Attributing code to the large language model that produced it is essential for provenance, licensing, and misuse accountability, yet no deployed watermark meets this need. Generation-time schemes require access to the producing model and cannot be applied to third-party code, while post-hoc schemes work on any code but carry at most 4 bits of payload, far too few to distinguish the many deployed model configurations. We present multi-channel spread-spectrum watermarking, the first post-hoc, training-free code watermark with a 24-bit payload and formal robustness guarantees. The scheme encodes bits in variable naming conventions and in eight pairs of semantically equivalent code patterns, and a keyed pseudo-random permutation maps every site to a codeword bit so that each bit receives multiple independent votes. Majority voting absorbs distributed corruption, while an outer Reed-Solomon code recovers the identifier when concentrated channel attacks defeat the vote, yielding provable robustness bounds for formatting, syntactic, and structural attacks. Across 1,750 Python files from CodeNet and from GPT-4.1 and Llama-4 generations, the watermark achieves 100% clean-detection accuracy with zero false positives. Under 17 attack types, it recovers the identifier at 97.6% accuracy under 8 variable renames and 94.1% under 10% random per-site corruption, while the strongest post-hoc baseline collapses to 0% under any single-transform attack. Embedding and detection together take under 200 ms on CPU without training data or GPU.
MATRIX: Multi-Layer Code Watermarking via Dual-Channel Constrained Parity-Check Encoding
Beijing University of Posts and Telecommunications(北京邮电大学);Nanyang Technological University(南洋理工大学);Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));School of Cyberspace Security, Huazhong University of Science and Technology(华中科技大学网络空间安全学院)
PMark: Towards Robust and Distortion-free Semantic-level Watermarking with Channel Constraints
The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));The Hong Kong University of Science and Technology(香港科技大学);Peking University(北京大学);National University of Singapore(新加坡国立大学);Tsinghua University(清华大学)
DRGW: Learning Disentangled Representations for Robust Graph Watermarking
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);State Key Laboratory of Cyberspace Security Defense(网络空间安全防御国家重点实验室)
Identifying Appropriate Intellectual Property Protection Mechanisms for Machine Learning Models: A Systematization of Watermarking, Fingerprinting, Model Access, and Attacks
SBA Research(SBA研究中心);Vienna University of Technology(维也纳工业大学)
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络与信息安全学院)
PURA: Provably Unbiased and Robust Multi-Bit Watermarking for AI-Generated Text Attribution
Hefei University of Technology(合肥工业大学);University of Chinese Academy of Sciences(中国科学院大学);University of Science and Technology of China(中国科学技术大学);Bilkent University(比尔肯特大学)
Bit-Level Triangular Content-Aware Permutation for Fragile Image Watermarking: Zero False Positive Rate, Single-Bit Sensitivity, and Arbitrary Dimension Support
Amirkabir University of Technology (Tehran Polytechnic)(阿米尔卡比尔理工大学(德黑兰理工大学));Iran University of Science and Technology(伊朗科技大学)
Gaussian Shading++: Rethinking the Realistic Deployment Challenge of Performance-Lossless Image Watermark for Diffusion Models
University of Science and Technology of China(中国科学技术大学);Anhui Province Key Laboratory of Digital Security(安徽省数字安全重点实验室);Department of Information Engineering and Mathematics(信息工程与数学系);University of Siena(锡耶纳大学);School of Computing(计算学院);National University of Singapore(新加坡国立大学)