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

Ruisi Zhang, Neusha Javidnia, Nojan Sheybani, Farinaz Koushanfar
2/4/2025
cs.CRcs.CLcs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2025robust,
  title  = {Robust and Secure Code Watermarking for Large Language Models via ML/Crypto Codesign},
  author = {Ruisi Zhang and Neusha Javidnia and Nojan Sheybani and Farinaz Koushanfar},
  year   = {2025},
  eprint = {2502.02068},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.02068v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.02068.svg)](https://codeofpaper.com/paper/2502.02068)

Discussion