mlsanityData to 7 Oct 2026

CodeIP: A Grammar-Guided Multi-Bit Watermark for Large Language Models of Code

arXiv 2404.15639 ↗First posted 24 Apr 2024cs.CLcited by 21

On the map: LLM safety and security → Watermarking generated content and models

Abstract (arXiv)

Large Language Models (LLMs) have achieved remarkable progress in code generation. It now becomes crucial to identify whether the code is AI-generated and to determine the specific model used, particularly for purposes such as protecting Intellectual Property (IP) in industry and preventing cheating in programming exercises. To this end, several attempts have been made to insert watermarks into machine-generated code. However, existing approaches are limited to inserting only a single bit of information. In this paper, we introduce CodeIP, a novel multi-bit watermarking technique that inserts additional information to preserve crucial provenance details, such as the vendor ID of an LLM, thereby safeguarding the IPs of LLMs in code generation. Furthermore, to ensure the syntactical correctness of the generated code, we propose constraining the sampling process for predicting the next token by training a type predictor. Experiments conducted on a real-world dataset across five programming languages demonstrate the effectiveness of CodeIP in watermarking LLMs for code generation while maintaining the syntactical correctness of code.

Key facts. Cited by 21 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. Builds on 25 of its 57 references that are in the map. First posted on arXiv 24 Apr 2024.

Builds on

25 of 57 references.

Closest ancestors · 3

Same direction, newest first

  1. 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models28 Aug
  2. 2023Towards Codable Watermarking for Injecting Multi-bits Information to LLMs29 Jul
  3. 2023Who Wrote this Code? Watermarking for Code Generation24 May

Other references · 22

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  7. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  8. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  9. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  10. 2019Release Strategies and the Social Impacts of Language Modelscited by 505
  11. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  12. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
10 more
  1. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  2. 2019Real or Fake? Learning to Discriminate Machine from Human Generated Textcited by 98
  3. 2024LLM-as-a-Coauthor: Can Mixed Human-Written and Machine-Generated Text Be Detected?cited by 47
  4. 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 45
  5. 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 40
  6. 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
  7. 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMscited by 17
  8. 2020Reverse Engineering Configurations of Neural Text Generation Modelscited by 14
  9. 2024IRCoCo: Immediate Rewards-Guided Deep Reinforcement Learning for Code Completioncited by 13
  10. 2023Towards Code Watermarking with Dual-Channel Transformationscited by 9

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 14; 2026: 4.

21 papers.

Sort:

By area:

  1. 2025Towards Trustworthy Retrieval Augmented Generation for Large Language Models: A Surveycited by 29
  2. 2025Agent Guide: A Simple Agent Behavioral Watermarking Frameworkcited by 8
  3. 2024Watermarking Language Models through Language Modelscited by 7
  4. 2025Marking Code Without Breaking It: Code Watermarking for Detecting LLM-Generated Codecited by 7
  5. 2025From Trade-off to Synergy: A Versatile Symbiotic Watermarking Framework for Large Language Modelscited by 5
  6. 2025Invisible Entropy: Towards Safe and Efficient Low-Entropy LLM Watermarkingcited by 5
  7. 2025SAEMark: Steering Personalized Multilingual LLM Watermarks with Sparse Autoencoderscited by 5
  8. 2026AgentMark: Utility-Preserving Behavioral Watermarking for Agentscited by 5
  9. 2024Discovering Spoofing Attempts on Language Model Watermarkscited by 4
  10. 2025WaterMod: Modular Token-Rank Partitioning for Probability-Balanced LLM Watermarkingcited by 4
  11. 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Softwarecited by 4
  12. 2024From Intentions to Techniques: A Comprehensive Taxonomy and Challenges in Text Watermarking for Large Language Modelscited by 3
9 more
  1. 2025XAttnMark: Learning Robust Audio Watermarking with Cross-Attentioncited by 3
  2. 2025SoK: Are Watermarks in LLMs Ready for Deployment?cited by 2
  3. 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Codecited by 1
  4. 2025Disappearing Ink: Obfuscation Breaks N-gram Code Watermarks in Theory and Practicecited by 0
  5. 2025Optimizing Token Choice for Code Watermarking: An RL Approachcited by 0
  6. 2025CLASP: Training-Free LLM-Assisted Source Code Watermarking via Semantic-Preserving Transformationscited by 0
  7. 2025CODE ACROSTIC: Robust Watermarking for Code Generationcited by 0
  8. 2026Multi-Channel Spread-Spectrum Code Watermarkingcited by 0
  9. 2026TrajMark: Ownership Attribution and Segment-Level Tamper Localization for Coding-Agent Trajectoriescited by 0