Detect an LLM Text Watermark

hard
Unit 29 · Safety0/0 to milestone

The Kirchenbauer et al. (2023) watermark nudges an LLM to prefer a pseudo-random green list of tokens at each step, chosen by hashing the previous token. Normal text uses green tokens about a fraction γ of the time. Watermarked text uses far more, which a z-test detects.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Detect an LLM Text Watermark · TechGradify