Multi-Channel Spread-Spectrum Code Watermarking

📄 arXiv: 2607.06009v1 📥 PDF

作者: Soohyeon Choi, Debin Gao, Yue Duan

分类: cs.CR, cs.LG, cs.SE

发布日期: 2026-07-07

备注: 15 pages, 3 figures, 16 tables, 2 algorithms


💡 一句话要点

提出多通道扩频水印技术以解决代码归属问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码水印 扩频技术 鲁棒性 大语言模型 软件版权 攻击防御 机器学习

📋 核心要点

  1. 现有的代码水印方案无法有效区分不同的大语言模型配置,且在面对攻击时鲁棒性不足。
  2. 本文提出了一种多通道扩频水印技术,能够在不依赖训练的情况下实现24位有效负载的代码水印。
  3. 在1,750个Python文件的实验中,该水印方案实现了100%的干净检测准确率,并在多种攻击下保持高识别率。

📝 摘要(中文)

归属代码到生成其的大语言模型对于追溯、许可和滥用责任至关重要,但现有水印方案无法满足这一需求。生成时方案需要访问生成模型,无法应用于第三方代码,而事后方案虽然适用于任何代码,但承载的有效负载最多仅为4位,远不足以区分众多已部署的模型配置。本文提出的多通道扩频水印技术是首个事后、无训练的代码水印,具有24位有效负载和正式的鲁棒性保证。该方案通过变量命名约定和八对语义等价的代码模式编码位,并通过一个带密钥的伪随机置换将每个位置映射到一个代码字位,从而使每个位获得多个独立投票。多数投票吸收分布式损坏,而外部的Reed-Solomon编码在集中通道攻击下恢复标识符,提供了格式、语法和结构攻击的可证明鲁棒性界限。

🔬 方法详解

问题定义:本文旨在解决现有代码水印技术在归属标识和鲁棒性方面的不足,尤其是在面对多种攻击时的有效性问题。现有的事后水印方案承载的有效负载过低,无法满足实际需求。

核心思路:提出的多通道扩频水印技术通过在变量命名和语义等价代码模式中编码位,结合伪随机置换和多数投票机制,增强了水印的鲁棒性和有效负载。

技术框架:整体架构包括编码阶段和检测阶段。在编码阶段,水印信息通过变量命名和代码模式嵌入;在检测阶段,通过多数投票和Reed-Solomon编码恢复标识符。

关键创新:该方案的最大创新在于实现了24位有效负载的事后水印,同时提供了对格式、语法和结构攻击的可证明鲁棒性,显著优于现有技术。

关键设计:水印的嵌入和检测过程在CPU上完成,且不需要训练数据或GPU,整体时间控制在200毫秒以内。关键参数包括变量重命名的数量和随机腐败的比例,确保在多种攻击下仍能保持高识别率。

🖼️ 关键图片

fig_0
fig_1

📊 实验亮点

实验结果显示,该水印方案在1,750个Python文件中实现了100%的干净检测准确率,且在17种攻击类型下,识别率分别为97.6%(8次变量重命名)和94.1%(10%随机每位腐败)。相比之下,最强的事后基线在任何单一变换攻击下均降至0%。

🎯 应用场景

该研究的潜在应用领域包括软件版权保护、代码审计和模型归属追踪等。通过有效的水印技术,开发者可以确保其代码的来源和合法性,防止滥用和盗用,具有重要的实际价值和社会影响。未来,该技术可能在开源软件和商业软件中得到广泛应用,促进代码的安全性和透明度。

📄 摘要(原文)

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.