CRJul 10

Efficient and Universal Watermarking for LLM-Generated Code Detection

arXiv:2402.0751814.76 citationsh-index: 14
Predicted impact top 17% in CR · last 90 daysOriginality Incremental advance
AI Analysis

It addresses the need for accountable detection of AI-generated code in academic and security contexts, overcoming limitations of prior methods in universality and efficiency.

ACW proposes a training-free, plug-and-play watermarking method for detecting LLM-generated code using semantic-preserving transformations, achieving effective detection with low overhead and universality across different LLMs.

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.

Foundations

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

Your Notes