When large language models (LLMs) generate open-ended text, like a creative essay or a product review, they navigate a vast space of possibilities. At each step, there are dozens of valid synonyms and phrasing choices. Traditional text watermarking exploits this linguistic freedom. By subtly biasing the model's token selections toward a pseudo-randomly chosen "green list" of words, frameworks like the one proposed by John Kirchenbauer et al. in A Watermark for Large Language Models can plant an invisible statistical signature in the text without degrading its readability.
But what happens when the model generates computer code, mathematical proofs, or highly structured technical documentation?
In these domains, the model encounters a low-entropy bottleneck. If the next required token in a Python script is a closing bracket ] or the keyword return, the model's probability distribution collapses entirely onto that single token. Forcing a green-list alternative in these scenarios does not just make the text sound slightly unnatural—it breaks the syntax, introduces logical bugs, and destroys the utility of the output.
To solve this, a new paradigm has emerged: entropy-constrained and adaptive watermarking. Instead of treating all tokens equally, these techniques dynamically adjust the watermark based on the local predictability of the text, balancing the "impossible trinity" of text quality, watermark detectability, and robustness against tampering.
The Intuition of the Entropy Budget
To understand why low-entropy text breaks standard watermarking, it helps to think of text generation as navigating a maze. In a wide-open room (high entropy), you have many paths available. A watermarking algorithm can gently nudge you to prefer paths painted green without slowing you down or forcing you into a wall. However, in a narrow, rigid corridor (low entropy), there is only one path forward. Forcing you to choose a "green" path when none exists means forcing you to smash through a brick wall.
As Zhimeng Guo et al. observe in Practical and Effective Code Watermarking for Large Language Models, programming languages are governed by strict syntactic rules that inherently result in low branching entropy. The capacity to embed a hidden signal is fundamentally bounded by this local randomness.
Mathematically, John Thickstun et al. demonstrate in Robust Distortion-free Watermarks for Language Models that the strength of a watermark's signal is directly proportional to the Shannon entropy of the model's true next-token distribution. When a prompt has a single logical or factual answer, the available "entropy budget" drops to zero. If you attempt to force a watermark there, you inevitably introduce a measurable loss of utility or accuracy.
Strategy 1: Selective Filtering via Entropy Thresholds
The most intuitive solution to the low-entropy bottleneck is simple: don't watermark when the model is certain.
This is the core mechanism behind SWEET (Selective WatErmarking via Entropy Thresholding), a framework introduced by T. Paul Lee et al. in Who Wrote this Code? Watermarking for Code Generation. During generation, the algorithm calculates the entropy of the next-token distribution before applying any watermark bias. If the entropy falls below a predefined threshold—meaning the model is highly confident about its next choice—the watermarking mechanism steps aside, allowing the model to generate the exact token it wants.
Token Prediction -> Calculate Entropy -> Below Threshold? -> YES -> Output Natural Token
-> NO -> Apply Green-List Bias -> Output Watermarked Token
By preserving low-entropy tokens like syntax keywords (if, for, while) or structural punctuation, SWEET ensures that the code remains functional and executable. The watermark signal is instead concentrated entirely in high-entropy positions, such as variable names, docstrings, or flexible algorithmic choices where multiple valid options exist. Yepeng Liu et al. formalize a similar intuition in Adaptive Text Watermark for Large Language Models, demonstrating that restricting watermark injections to high-entropy states prevents the introduction of unnatural linguistic patterns while maximizing the use of the available entropy budget.
Strategy 2: Distribution-Adaptive Scaling and Noisy Channels
While hard thresholding protects text quality, it completely discards the signal from low-entropy regions. If a code snippet consists mostly of boilerplate syntax, a threshold-based approach might not find enough high-entropy tokens to embed a detectable signature.
To extract a signal from these constrained environments without breaking the text, researchers have introduced two complementary approaches: distribution adaptation and error-correcting codes.
Distribution-Adaptive Watermarking
Rather than using a binary on/off switch, the watermark strength can scale continuously based on the model's confidence. In Theoretically Grounded Framework for LLM Watermarking: A Distribution-Adaptive Approach, Haiyun He et al. introduce DAWA, an algorithm that dynamically reshapes the watermark bias at each step. When the model is highly certain, the bias shrinks to a microscopic level, ensuring the natural token distribution is virtually untouched. When the model is uncertain, the bias expands to capture maximum signal. This distortion-free approach ensures optimal detection reliability without triggering high false-positive rates on factual or rigid text sequences.
The Noisy Channel Analogy
What if we must embed a specific cryptographic signature across a highly predictable sequence? Jaiden Fairoze et al. tackle this in Publicly-Detectable Watermarking for Language Models by framing low-entropy text as a noisy communication channel.
Imagine trying to broadcast a message through static. Instead of hoping every single token successfully transmits a piece of the watermark, the authors integrate error-correcting codes directly into the token-selection process. If a sequence hits a low-entropy block where token choices are locked down, the system treats those positions as "erased" or "noisy" bits. Because the watermark signature is wrapped in an error-correcting code, the detector can still reconstruct the full, uncorrupted signature later by aggregating the sparse signals collected from the remaining flexible parts of the text.
Flipping the Perspective: Low-Entropy Tokens as High-Information Signals
Most literature assumes that low-entropy tokens are a nuisance for detection because they rarely host a watermark. However, a striking insight by Du Su in Low-Entropy Watermark Detection via Bayes' Rule Derived Detector flips this assumption on its head.
Consider a scenario where a language model is generating a mathematical proof. The natural probability for the next token is $P(\text{"therefore"}) = 0.99$ and $P(\text{"hence"}) = 0.01$. If the watermarking algorithm happens to place "hence" on its green list and forces the model to select it, the text deviates from its most probable natural path.
Du Su argues that while these deviations are rare, they are highly informative. In an unwatermarked text, a human or a vanilla model would almost never choose the 1% token. Therefore, if a detector encounters a token that deviates from a highly predictable, low-entropy path, the posterior probability that this deviation was caused by a watermark injection is exceptionally high.
By deriving a detector directly from Bayes' Rule (BRWD), the author demonstrates that weighing these low-entropy deviations heavily—rather than ignoring them—yields massive improvements in detection accuracy for structured domains like mathematics and code. A single unexpected token in a rigid context can provide more definitive proof of machine generation than dozens of green-list words in an open-ended creative essay.