Identifying LLM-generated code through watermarking poses a challenge in preserving functional correctness. Previous methods rely on the assumption that watermarking high-entropy tokens effectively maintains output quality. Our analysis reveals a fundamental limitation of this assumption: syntax-critical tokens such as keywords often exhibit the highest entropy, making existing approaches vulnerable to logic corruption. We present STONE, a syntax-aware watermarking method that embeds watermarks only in non-syntactic tokens and preserves code integrity. For its rigorous assessment, we also introduce STEM, a comprehensive framework that balances three critical dimensions: correctness, detectability, and imperceptibility. Across Python, C++, and Java, STONE preserves correctness, sustains strong detectability, and achieves balanced performance with minimal overhead. Our implementation is available at https://anonymous.4open.science/r/STONE-watermarking-AB4B/.


翻译:通过水印技术识别LLM生成的代码在保持功能正确性方面面临挑战。现有方法基于"高熵标记水印能有效维持输出质量"的假设,但我们的分析揭示了该假设的根本局限:语法关键标记(如关键词)通常具有最高熵值,导致现有方法易受逻辑破坏。我们提出STONE——一种语法感知水印方法,仅将水印嵌入非语法标记以保持代码完整性。为进行严谨评估,我们同时提出STEM综合评估框架,该框架平衡三个关键维度:正确性、可检测性与隐蔽性。在Python、C++和Java的测试中,STONE在保持正确性的同时维持了强可检测性,并以最小开销实现了均衡性能。我们的实现发布于https://anonymous.4open.science/r/STONE-watermarking-AB4B/。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【CVPR2024】VideoMAC: 视频掩码自编码器与卷积神经网络
专知会员服务
17+阅读 · 2024年3月4日
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
MonoGRNet:单目3D目标检测的通用框架(TPAMI2021)
专知会员服务
18+阅读 · 2021年5月3日
Kaggle知识点:伪标签Pseudo Label
AINLP
40+阅读 · 2020年8月9日
【NeurIPS2019】图变换网络:Graph Transformer Network
论文报告 | Graph-based Neural Multi-Document Summarization
科技创新与创业
15+阅读 · 2017年12月15日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2016年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关资讯
Kaggle知识点:伪标签Pseudo Label
AINLP
40+阅读 · 2020年8月9日
【NeurIPS2019】图变换网络:Graph Transformer Network
论文报告 | Graph-based Neural Multi-Document Summarization
科技创新与创业
15+阅读 · 2017年12月15日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2016年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员