arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2403.17983cs.CRcs.LG
收藏

大语言模型生成代码的水印是否鲁棒?

Is The Watermarking Of LLM-Generated Code Robust?

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);VMware Research(VMware研究)

Tarun Suresh, Shubham Ugare, Gagandeep Singh, Sasa Misailovic

AI总结:

首次深入研究现有水印技术在LLM生成代码中的鲁棒性,发现变量重命名等简单语义保留变换可有效擦除水印,通过AST遍历算法实验验证其脆弱性,代码已公开。

摘要:

我们首次深入研究了现有水印技术应用于大语言模型(LLM)生成代码时的鲁棒性。随着LLM在软件开发中的贡献日益增加,水印已成为检测AI生成代码并缓解滥用(如剽窃或恶意程序自动生成)的潜在解决方案。尽管此前研究已证明文本场景下水印的韧性,但我们的工作揭示水印技术在代码场景中脆弱得多。具体而言,我们表明变量重命名、死代码插入等简单语义保留变换可在不改变程序功能的情况下有效擦除水印。为系统评估水印鲁棒性,我们开发了一种算法,遍历带水印程序的抽象语法树(AST)并应用一系列随机语义保留变换。在不同LLM生成的Python代码上开展的实验结果表明,即使微小修改也能大幅降低水印可检测性,许多情况下真阳性率(TPR)降至50%以下。我们的代码公开于https://github.com/uiuc-arc/llm-code-watermark。

英文摘要:

We present the first in depth study on the robustness of existing watermarking techniques applied to code generated by large language models (LLMs). As LLMs increasingly contribute to software development, watermarking has emerged as a potential solution for detecting AI generated code and mitigating misuse, such as plagiarism or the automated generation of malicious programs. While previous research has demonstrated the resilience of watermarking in the text setting, our work reveals that watermarking techniques are significantly more fragile in code-based contexts. Specifically, we show that simple semantic-preserving transformations, such as variable renaming and dead code insertion, can effectively erase watermarks without altering the program's functionality. To systematically evaluate watermark robustness, we develop an algorithm that traverses the Abstract Syntax Tree (AST) of a watermarked program and applies a sequence of randomized, semantics-preserving transformations. Our experimental results, conducted on Python code generated by different LLMs, indicate that even minor modifications can drastically reduce watermark detectability, with true positive rates (TPR) dropping below 50% in many cases. Our code is publicly available at https://github.com/uiuc-arc/llm-code-watermark.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑