Manuscript Offprint

arXiv:2609.35224

TANGO: Watermarking Masked Diffusion Language Models in Token Pairs

Kasra Arabi, Nir Weinberger, Micah Goldblum, Niv Cohen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Masked-diffusion language models fill in masked positions in parallel and in no fixed order. Most practical text watermarks assume left-to-right generation. They key each token to the tokens before it, and in a diffusion model those tokens may still be masked. A fixed green list needs no such context, but it favors the same tokens at every position, so these tokens appear more often in watermarked text. An attacker who compares token frequencies in watermarked and unwatermarked text can recover the list and forge text that the provider's own detector accepts. We present TANGO, a watermark for masked-diffusion language models that keys each new token to a nearby token that is already unmasked. A secret key splits the vocabulary into color classes, and TANGO biases the new token toward a color determined by the key and the nearby token's color. The watermark is therefore embedded in pairs of tokens. Because the favored color changes from position to position, token frequencies stay much closer to those of unwatermarked text than under a fixed green list. Detection needs only the text and the key, and it does not assume any unmasking order. On two masked-diffusion models, TANGO detects nearly all unedited watermarked texts and most edited ones, and frequency attacks that forge the fixed green list fail against it.

1 INTRODUCTION

Language models now write text that readers cannot tell apart from human writing, and their providers are increasingly asked to identify which texts their models produced. Text watermarking addresses this need. The provider embeds a secret statistical signal during generation and later tests for its presence. A prominent method is the context-hashed green list (Kirchenbauer et al., 2023), which derives its favored token set from a hash of the preceding tokens. In left-to-right generation, these tokens are already available when the next token is sampled. Masked-diffusion language models (Austin et al., 2021; Sahoo et al., 2024; Nie et al., 2025; Ye et al., 2025) instead fill positions out of order through a denoising loop. Under confidence-based decoding, the model unmasks the positions it is most confident about first, regardless of their order in the sequence. When a position is unmasked, the tokens before it may still be masked, so the context-hashed green list cannot be computed.

Other watermarks run on diffusion models but face different problems. Gumbel-max sampling (Aaronson, 2023), which we call the Gumbel rule, can be applied at every denoising step (Bagchi et al., 2025). However, when we key it on the preceding token, as in its autoregressive form, detection is weak in our experiments. A confidence-ordered sampler unmasks first the positions whose token the model is most certain of. With little uncertainty left there, the Gumbel rule tends to pick that same token, which likely explains why it embeds little signal (Section 4.2). The fixed green list of Zhao et al. (2024), which we call the red-green list, splits the vocabulary once into green and red tokens and favors the green ones. It needs no context and runs unchanged on diffusion models. However, it favors the same tokens at every position, so an attacker can estimate the green list from token frequencies in watermarked text. With the green list, the attacker can forge text that the detector accepts (Jovanović et al., 2024) or remove the watermark (Zhang et al., 2024b). A provider that needs to prevent forgery therefore cannot use the red-green list.

We present TANGO, a watermark that is designed for the denoising loop and does not rely on a left-to-right generation order. A secret key colors the vocabulary into q classes. TANGO pairs each position with the token at a fixed offset, which we call the position's tap. If the tap has already been generated when a position is unmasked, TANGO biases the logits toward the one class whose color satisfies a keyed modular relation with the tap's color. We call this relation the checksum. The detector recolors a candidate text with the key and counts the positions where the checksum holds. Because the classes have near-equal size, the checksum holds at about 1/q of the positions in unwatermarked text, and the detector flags text where it holds much more often. Detection needs only the text and the key, not the prompt or the model.

The watermark signal is therefore second order. It comes from pairs of token colors, not from any single token. When every class carries equal probability mass, the biases at different positions also cancel out on average. If the favored class is uniform and independent across positions, then under an idealized sampler every token has the same expected frequency as without the watermark (Theorem 1). Ranking tokens by how much more often they appear in watermarked text therefore reveals, in expectation, no difference between the color classes. Empirically, this attack recovers and forges the red-green list but stays at chance against TANGO, and none of its forgeries is accepted (Section 4.3). An attacker who knows TANGO's design can instead count token pairs. At every forging bias and every number of texts we test, forgeries built from these pair counts succeed less often against TANGO than forgeries of the red-green list succeed against it.

Embedding the signal in token pairs raises two concerns. First, editing either token of a pair can break it. TANGO therefore assigns tokens to classes by meaning. It sorts tokens by a keyed projection of their embeddings and cuts the sorted list into equal-sized classes. Tokens with similar meanings then tend to share a class, so a synonym substitution can keep the checksum. Second, forcing a relation between neighbors could hurt the quality of the generated text. TANGO favors a whole class of tokens, so the model still chooses freely within that class, and quality degrades gradually as the bias grows. Under synonym substitution and word insertion, TANGO detects nearly as many texts as the red-green list. TANGO is more sensitive to word deletion than the red-green list. Deleting a word breaks every pair that spans it, whereas the red-green list scores each token independently (Section 4.2).

References (76)