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

用于大语言模型生成代码检测的高效通用水印技术

Efficient and Universal Watermarking for LLM-Generated Code Detection

College of Computer Science and Technology, Harbin Engineering University(哈尔滨工程大学计算机科学与技术学院);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算与信息学院)

Boquan Li, Zirui Fu, Mengdi Zhang, Peixin Zhang, Jun Sun, Xingmei Wang

AI总结:

针对大语言模型生成代码检测问题,提出即插即用的ACW水印方法,无需训练,通过精心设计的代码转换作隐式水印,有效高效检测代码,保留其实用性且具通用性,解决了现有方法的局限。

摘要:

大语言模型显著提升了人工智能生成代码的可用性,但引发了学术不诚实和恶意代码生成等伦理和法律问题。为了追究责任,检测代码是否由人工智能生成至关重要。水印技术被广泛认为是一种有前途的解决方案,已成功应用于识别大语言模型生成的文本。然而,现有的代码水印技术并不理想,存在通用性有限、时间和内存消耗过多等问题。在这项工作中,我们提出了一种即插即用的水印方法ACW(人工智能代码水印),用于人工智能生成代码的检测。ACW无需训练,通过有选择地对大语言模型代码输出应用一组精心设计、语义保留且幂等的代码转换来工作。转换的存在与否作为隐式水印,能够检测人工智能生成的代码。我们的实验结果表明,ACW能够有效且高效地检测人工智能生成的代码,保留代码实用性,并能抵御潜在的代码干扰。特别是,ACW在不同的大语言模型中具有通用性,解决了现有方法的局限性。

英文摘要:

Large language models (LLMs) have significantly enhanced the usability of AI-generated code, providing effective assistance to programmers. This advancement also raises ethical and legal concerns, such as academic dishonesty and the generation of malicious code. For accountability, it is imperative to detect whether a piece of code is AI-generated. Watermarking is broadly considered a promising solution and has been successfully applied to identify LLM-generated text. However, existing efforts on code are far from ideal, suffering from limited universality and excessive time and memory consumption. In this work, we propose a plug-and-play watermarking approach for AI-generated code detection, named ACW (AI Code Watermarking). ACW is training-free and works by selectively applying a set of carefully-designed, semantic-preserving and idempotent code transformations to LLM code outputs. The presence or absence of the transformations serves as implicit watermarks, enabling the detection of AI-generated code. Our experimental results show that ACW effectively and efficiently detects AI-generated code, preserves code utility, and is resilient against potential code disruptions. Especially, ACW is universal across different LLMs, addressing the limitations of existing approaches.

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

↑