Efficient and Universal Watermarking for LLM-Generated Code Detection
On the map: LLM safety and security → Watermarking generated content and models
Abstract (arXiv)
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.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Placed in Watermarking generated content and models, one of 12 directions in LLM safety and security. First posted on arXiv 12 Feb 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 1; 2026: 3.
5 papers.
- 2024Building Intelligence Identification System via Large Language Model Watermarking: A Survey and Beyondcited by 4
- 2025Optimizing Token Choice for Code Watermarking: An RL Approachcited by 0
- 2026SWaRL: Safeguard Code Watermarking via Reinforcement Learningcited by 0
- 2026WorldCup Sampling for Multi-bit LLM Watermarkingcited by 0
- 2026Multi-Channel Spread-Spectrum Code Watermarkingcited by 0
- 2026Multi-Channel Spread-Spectrum Code Watermarking7 Jul 2026
- 2026WorldCup Sampling for Multi-bit LLM Watermarking2 Feb 2026
- 2026SWaRL: Safeguard Code Watermarking via Reinforcement Learning5 Jan 2026
- 2025Optimizing Token Choice for Code Watermarking: An RL Approach16 Aug 2025
- 2024Building Intelligence Identification System via Large Language Model Watermarking: A Survey and Beyond15 Jul 2024