Watermarking is a common way to identify AI-generated text, but it typically forces a trade-off: stronger watermarks are easier to detect, yet they tend to degrade output quality. The new arXiv paper argues this tension is especially problematic for code, where a small structural break can make the output unusable.

The authors propose a grammar-driven approach that embeds watermark signals while respecting the grammar of the target programming language. By preserving structure, the method aims to strengthen the watermark's detectability without sacrificing as much quality as conventional schemes.

The paper frames this as an optimization of the quality-detectability trade-off, suggesting that structure-aware watermarking can improve both sides at once. This summary is based on a single source; no independent results or comparisons are included here.