LLM output watermarking in ~91 lines of dependency-free Python
This repo builds on Karpathy's microgpt to show LLM watermarking at its most minimal: a secret-keyed Gumbel sampler swaps in for random sampling without touching the model's token probabilities. Generated text stays indistinguishable from normal output, yet the detector flags it at p ≈ 6.8×10⁻⁵³ while a wrong key lands at chance. It's proof the watermarks modelers actually ship are just a few nudged decisions, no frameworks required.