← Lab /AI/ML

Post-hoc code watermark embeds 24-bit IDs with 97%+ recovery under attacks

The authors claim their multi-channel spread-spectrum watermark reliably embeds a 24-bit identifier and recovers it with high accuracy under various code transformations

AI/ML arXiv 7 Jul 2026 Method Prototype evidence

Published as “Multi-Channel Spread-Spectrum Code Watermarking”

Why it matters

Enables reliable attribution of LLM-generated code without needing access to the generation model, supporting licensing enforcement and security incident response.

Summary

The paper demonstrates a post-hoc, training-free code watermark that embeds a 24-bit identifier with zero false positives and 100% detection on clean code. It remains highly robust, recovering the identifier in 97.6% of cases after eight variable renames and 94.1% after 10% random per-site corruption, while prior post-hoc baselines drop to 0% under single-transform attacks. Robustness degrades under extreme attacks, e.g., 32 variable renames reduce accuracy to 0% and higher Reed-Solomon parameters can hurt structural attack resistance. The system runs entirely on CPU in under 250 ms for embedding and under 50 ms for detection, requiring no model access or training data.

What they found 1

  1. 100% clean-detection accuracy with zero false positives on 1,750 watermarked files

    “the watermark achieves 100% clean-detection accuracy with zero false positives.”

Caveats 5

  • Renaming 32 variables reduces detection accuracy to 0% ("Rename 32 ... 0.0†").
  • Higher Reed-Solomon parameter t can reduce structural robustness, e.g., operand_order drops from 41.6% (t=2, D32) to 29.9% (t=8, D56).
  • The Level 4 barrier, complete code regeneration by a capable LLM, is an information-theoretic limit for every post-hoc syntactic watermark (Theorem 5.7), not a defect of our construction.
  • Higher t can reduce structural robustness.
  • Post-hoc schemes like ours are more vulnerable to concentrated structural attacks but provide model attribution through a 24-bit payload without requiring model access or training.

What’s new here 4

  • First post-hoc code watermark with a 24-bit payload (vs. 0-bit or 4-bit prior work)
  • Combines variable-naming and eight structural code pattern channels with spread-spectrum voting
  • Provides formal robustness guarantees against formatting, syntactic, and structural attacks
  • Achieves zero false positives and sub-second runtime without any training or GPU