Sign inGet started
Paper · arXiv

Preserving Structure, Strengthening Signals: A Grammar-Driven Approach to Optimize the Trade-off Between Quality and Detectability in Code Watermarking

Text watermarking has emerged as a crucial technique for identifying AI-generated content. However, current watermarking schemes entail a trade-off between text quality and watermark detectability, which is further intensified by the inherent low-entropy nature of code. To mitigate this dilemma, we propose Grammar-Driven Watermark (GDW), a training-free watermarking approach tailored to LLM-based code generation. GDW employs a three-level masking mechanism consisting of a green-list mask, a syntactic validity mask, and a structural role mask to regulate watermark injection. These masks are integrated through hierarchical modulation, which limits the scope of watermark injection to syntact...

AuthorsLicheng Yu, Aiwei Liu, Songze Li
Primary categorycs.CR
Published11 July 2026
Last updated at source12 October 2026
cs.CRcs.CL
Embed this entry
<iframe src="https://silytics.si/embed/item/7c84a42f-3751-4366-9c36-7438303664f4" width="420" height="190" style="border:0" loading="lazy" title="Silytics entry"></iframe>

Free, no tracking. More about feeds and embeds.

Silytics shows public metadata from arXiv and links to the original. Information may be incomplete or out of date. Last refreshed 17 October 2026. Licenses and terms of the original apply to the work itself. Not financial, legal or professional advice.