mlsanityData to 14 Oct 2026

Robust and Secure Code Watermarking for Large Language Models via ML/Crypto Codesign

arXiv 2502.02068 ↗First posted 4 Feb 2025cs.CR cs.CL cs.LGcited by 0

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

Abstract (arXiv)

This paper introduces RoSeMary, the first-of-its-kind ML/Crypto codesign watermarking framework that regulates LLM-generated code to avoid intellectual property rights violations and inappropriate misuse in software development. High-quality watermarks adhering to the detectability-fidelity-robustness tri-objective are limited due to codes' low-entropy nature. Watermark verification, however, often needs to reveal the signature and requires re-encoding new ones for code reuse, which potentially compromising the system's usability. To overcome these challenges, RoSeMary obtains high-quality watermarks by training the watermark insertion and extraction modules end-to-end to ensure (i) unaltered watermarked code functionality and (ii) enhanced detectability and robustness leveraging pre-trained CodeT5 as the insertion backbone to enlarge the code syntactic and variable rename transformation search space. In the deployment, RoSeMary uses zero-knowledge proofs for secure verification without revealing the underlying signatures. Extensive evaluations demonstrated RoSeMary achieves high detection accuracy while preserving the code functionality. RoSeMary is also robust against attacks and provides efficient secure watermark verification.

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 52 references that are in the map. First posted on arXiv 4 Feb 2025.

Builds on

20 of 52 references.

Closest ancestors · 6

Same direction, newest first

  1. 2025RTLMarker: Protecting LLM-Generated RTL Copyright via a Hardware Watermarking Framework5 Jan
  2. 2024Token-Specific Watermarking with Enhanced Detectability and Semantic Coherence for Large Language Models28 Feb
  3. 2023ZKROWNN: Zero Knowledge Right of Ownership for Neural Networks13 Sep
  4. 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models28 Aug
  5. 2023Who Wrote this Code? Watermarking for Code Generation24 May
  6. 2023Can AI-Generated Text be Reliably Detected?17 Mar

Other references · 14

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2021Program Synthesis with Large Language Modelscited by 3,637
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  4. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  5. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  6. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  7. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  8. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  9. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  10. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
  11. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
  12. 2023Leveraging Optimization for Adaptive Attacks on Image Watermarkscited by 52
2 more
  1. 2020On Polynomial Approximations for Privacy-Preserving and Verifiable ReLU Networkscited by 19
  2. 2024Trust the Process: Zero-Knowledge Machine Learning to Enhance Trust in Generative AI Interactionscited by 6

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Is The Watermarking Of LLM-Generated Code Robust?
  2. 2026Preserving Structure, Strengthening Signals: A Grammar-Driven Approach to Optimize the Trade-off Between Quality and Detectability in Code Watermarking
  3. 2026DuCodeMark: Dual-Purpose Code Dataset Watermarking via Style-Aware Watermark-Poison Design ↗
  4. 2025Disappearing Ink: Obfuscation Breaks N-gram Code Watermarks in Theory and Practice
  5. 2025CLASP: Training-Free LLM-Assisted Source Code Watermarking via Semantic-Preserving Transformations
  6. 2026MATRIX: Multi-Layer Code Watermarking via Dual-Channel Constrained Parity-Check Encoding ↗
  7. 2025PVMark: Enabling Public Verifiability for LLM Watermarking Schemes
  8. 2026RMCW: A Deletion-Robust Watermark Based on Reed--Muller Codes for Language Models