CODE ACROSTIC: Robust Watermarking for Code Generation
On the map: LLM safety and security → Watermarking generated content and models
Abstract (arXiv)
Watermarking large language models (LLMs) is vital for preventing their misuse, including the fabrication of fake news, plagiarism, and spam. It is especially important to watermark LLM-generated code, as it often contains intellectual property.However, we found that existing methods for watermarking LLM-generated code fail to address comment removal attack.In such cases, an attacker can simply remove the comments from the generated code without affecting its functionality, significantly reducing the effectiveness of current code-watermarking techniques.On the other hand, injecting a watermark into code is challenging because, as previous works have noted, most code represents a low-entropy scenario compared to natural language. Our approach to addressing this issue involves leveraging prior knowledge to distinguish between low-entropy and high-entropy parts of the code, as indicated by a Cue List of words.We then inject the watermark guided by this Cue List, achieving higher detectability and usability than existing methods.We evaluated our proposed method on HumanEvaland compared our method with three state-of-the-art code watermarking techniques. The results demonstrate the effectiveness of our approach.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Watermarking generated content and models, one of 12 directions in LLM safety and security. Builds on 20 of its 28 references that are in the map. First posted on arXiv 14 Dec 2025.
Builds on
20 of 28 references.
Closest ancestors · 14
Same direction, newest first
- 2025Marking Code Without Breaking It: Code Watermarking for Detecting LLM-Generated Code26 Feb
- 2024Inevitable Trade-off between Watermark Strength and Speculative Sampling Efficiency for Language Models27 Oct
- 2024MarkLLM: An Open-Source Toolkit for LLM Watermarking16 May
- 2024CodeIP: A Grammar-Guided Multi-Bit Watermark for Large Language Models of Code24 Apr
- 2024Is The Watermarking Of LLM-Generated Code Robust?24 Mar
- 2024An Entropy-based Text Watermarking Detection Method20 Mar
- 2024GumbelSoft: Diversified Language Model Watermarking via the GumbelMax-trick20 Feb
- 2023A Survey of Text Watermarking in the Era of Large Language Models13 Dec
- 2023Publicly-Detectable Watermarking for Language Models27 Oct
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models28 Aug
- 2023Undetectable Watermarks for Language Models25 May
- 2023Who Wrote this Code? Watermarking for Code Generation24 May
2 more
Other references · 6
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023A Survey of Large Language Modelscited by 2,576
- 2022Survey of Hallucination in Natural Language Generationcited by 2,075
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2023OUTFOX: LLM-Generated Essay Detection Through In-Context Learning with Adversarially Generated Examplescited by 80
- 2020Neural Deepfake Detection with Factual Structure of Textcited by 41
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Efficient and Universal Watermarking for LLM-Generated Code Detection
- 2026Can we Watermark Low-Entropy LLM Outputs?
- 2025CLASP: Training-Free LLM-Assisted Source Code Watermarking via Semantic-Preserving Transformations
- 2024Watermarking Large Language Models and the Generated Content: Opportunities and Challenges
- 2026Preserving Structure, Strengthening Signals: A Grammar-Driven Approach to Optimize the Trade-off Between Quality and Detectability in Code Watermarking
- 2025HeavyWater and SimplexWater: Distortion-Free LLM Watermarks for Low-Entropy Next-Token Predictions
- 2024Large Language Model Watermark Stealing With Mixed Integer Programming
- 2025Entropy-Guided Watermarking for LLMs: A Test-Time Framework for Robust and Traceable Text Generation