CLMay 24, 2023

Who Wrote this Code? Watermarking for Code Generation

arXiv:2305.15060v4187 citationsHas Code
Originality Incremental advance
AI Analysis

This addresses ethical and legal concerns in code generation for developers and organizations, though it is incremental as it extends an existing method.

The authors tackled the problem of detecting machine-generated code by proposing SWEET, a watermarking method that improves detection ability and preserves code quality by removing low-entropy segments, significantly outperforming baselines in detection.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes