arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.15060cs.CL
收藏

谁写的这段代码?面向代码生成的水印技术

Who Wrote this Code? Watermarking for Code Generation

Seoul National University(首尔大学);LG AI Research(LG人工智能研究院);Georgia Institute of Technology(佐治亚理工学院);NAVER AI Lab(NAVER人工智能实验室)

Taehyun Lee, Seokhee Hong, Jaewoo Ahn, Ilgee Hong, Hwaran Lee, Sangdoo Yun, Jamin Shin, Gunhee Kim

AI总结:

针对代码生成任务低熵导致现有水印方法失效的问题,本文提出基于熵阈值的 SWEET 方法,通过移除低熵片段提升检测能力并保持代码质量,实验优于所有基线。

摘要:

由于大语言模型卓越的生成性能引发了伦理与法律方面的担忧,通过嵌入水印来检测机器生成文本的方法正在发展之中。然而,我们发现现有工作在代码生成任务中无法正常发挥作用,原因在于该任务具有低熵的特性。我们扩展了一种修改 logit 的水印方法,提出基于熵阈值的选择性水印方法(SWEET),通过在生成和检测水印时移除低熵片段来增强检测能力并缓解代码质量退化。我们的实验表明,SWEET 在检测机器生成代码文本方面显著改善了代码质量保持效果,同时优于包括事后检测方法在内的所有基线。我们的代码可在 https://github.com/hongcheki/sweet-watermark 获取。

英文摘要:

Since the remarkable generation performance of large language models raised ethical and legal concerns, approaches to detect machine-generated text by embedding watermarks are being developed. However, we discover that the existing works fail to function appropriately in code generation tasks due to the task's nature of having low entropy. Extending a logit-modifying watermark method, we propose Selective WatErmarking via Entropy Thresholding (SWEET), which enhances detection ability and mitigates code quality degeneration by removing low-entropy segments at generating and detecting watermarks. Our experiments show that SWEET significantly improves code quality preservation while outperforming all baselines, including post-hoc detection methods, in detecting machine-generated code text. Our code is available in https://github.com/hongcheki/sweet-watermark.

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

↑