TANGO: Watermarking Masked Diffusion Language Models in Token Pairs

Kasra Arabi, Nir Weinberger, Micah Goldblum, Niv CohenarXiv 2026

TL;DR

TANGO is a novel watermarking scheme designed specifically for masked-diffusion language models (MDLMs) that embeds signals in token pairs rather than individual tokens. By coupling a token's "color" to an already-unmasked neighbor via a secret checksum, TANGO remains invisible to frequency-based attacks while maintaining high detection accuracy and robustness against common text edits.

What Problem Does This Paper Address?

As large language models (LLMs) become increasingly indistinguishable from human writers, the need for reliable "watermarking"—embedding a hidden statistical signal to identify AI-generated text—has become critical.

Most existing watermarks are designed for autoregressive models, which generate text linearly from left to right. These methods typically hash the preceding tokens to determine a "green list" of allowed tokens for the next position. However, Masked-Diffusion Language Models (MDLMs), like LLaDA or Dream, generate text differently: they start with a block of masks and fill them in parallel or in a non-linear, confidence-based order. In this setting, the "preceding" tokens might still be masked, making traditional context-based watermarking impossible.

The fallback for MDLMs has been the "red-green list," which uses a fixed set of favored tokens for all positions. The fatal flaw here is leakage: an attacker can simply count token frequencies in watermarked text to recover the secret list, allowing them to forge text that bypasses the detector or remove the watermark entirely.

Methods

TANGO (Watermarking Masked Diffusion Language Models in Token Pairs) solves this by moving the signal from first-order statistics (individual token frequencies) to second-order statistics (token pairs).

  1. Keyed Balanced Coloring: A secret key partitions the vocabulary into $q$ color classes of roughly equal size. To improve robustness, the authors use semantic-quantile coloring, which sorts tokens by their embeddings. This ensures that synonyms are likely to share the same color, so replacing a word with a synonym is less likely to break the watermark.
  2. The Checksum: During the denoising (generation) loop, when the model prepares to unmask a position $i$, TANGO looks at a "tap"—a nearby token (e.g., at position $i-2$) that is already unmasked. It then biases the model's output toward the specific color class that satisfies a keyed modular relation (the checksum) with the tap's color.
  3. Either-Side Enforcement: Since MDLMs fill masks in arbitrary order, TANGO can enforce the checksum from either the left or the right, depending on which neighbor is unmasked first.
  4. Prompt-Free Detection: The detector only needs the generated text and the secret key. It recolors the tokens, counts how often the checksum holds across the text, and compares this to a binomial distribution expected by chance.
The TANGO workflow: 1) Coloring the vocabulary, 2) Enforcing the checksum during denoising, and 3) Statistical detection.

Datasets

The authors evaluated TANGO using:

  • Prompts: Sampled from the C4 dataset.
  • Models: Two state-of-the-art MDLMs: LLaDA-8B-Instruct and Dream-v0-Instruct-7B.
  • Baselines: The standard red-green list (Unigram watermark) and the Gumbel rule (a distortion-free watermark).

Key Insights and Ideas

  • First-Order Unforgeability: The paper proves (Theorem 1) that if the favored color class varies across positions, the expected frequency of any single token remains unchanged. This makes TANGO "frequency-hidden," effectively neutralizing attackers who try to steal the key by counting words.
  • The "Tap" Strategy: By keying a token to a neighbor rather than a long preceding context, TANGO adapts perfectly to the non-linear unmasking order of diffusion models.
  • Semantic Awareness: By clustering colors based on embeddings, the authors acknowledge that watermarks must survive "soft" edits like synonym swaps, not just exact matches.
  • Trade-offs in Robustness: The authors found that while TANGO is highly robust to synonym substitutions and word insertions, it is more sensitive to word deletions than fixed-list methods. This is because deleting a single word breaks every token pair that spans the gap.

Key Results

TANGO demonstrates a superior balance of security, quality, and detectability compared to existing methods for diffusion models.

  • Detection Accuracy: On clean, unedited text, TANGO achieves near-perfect detection (97% TPR at 1% FPR on LLaDA; 100% on Dream).
  • Edit Robustness: TANGO remains highly effective after synonym replacement (92-98% TPR) and random word insertion (91-97% TPR).
  • Security against Forgery: While the red-green list is 100% forgeable via frequency attacks, TANGO reduces forgery success to 0% against the same attack. Even a more sophisticated "pair-counting" attacker succeeds significantly less often against TANGO than against simpler watermarks.
  • Text Quality: TANGO maintains perplexity levels comparable to unwatermarked text and outperforms the red-green list, which often causes models to degenerate into repetitive phrases (especially in the Dream model).
Table 1: TANGO detects nearly all unedited and most edited watermarked texts at a perplexity close to the red–green list’s. TPR@1%FPR under no attack (clean) and under the three edits, with the half-width of a 95% bootstrap interval as superscript. TANGO at the default setting, red–green list with green fraction 0.25 and bias 5, Gumbel rule at temperature τ = 1.0. n = 200 per method on LLaDA and 100 on Dream, with the unwatermarked continuations of the same prompts as negatives. PPL is Qwen2.5-7B-Instruct perplexity over non-degenerate continuations (Appendix B).

Limitations and Future Work

  • Deletion Sensitivity: As noted, word deletions are TANGO's primary weakness. A 30% word deletion attack drops TANGO's detection rate to ~68-73%, whereas the red-green list stays above 96%.
  • Paraphrasing: Like most current watermarks, TANGO is vulnerable to heavy paraphrasing (e.g., back-translation), which reorders clauses and breaks the fixed-offset token pairs.
  • Calibration: The authors noted that natural text structure can sometimes cause "color correlation," leading to higher-than-expected scores in unwatermarked text. They recommend per-model calibration of the detection threshold to maintain a low false-positive rate.

Future work could explore more complex "taps" or adaptive offsets to further improve robustness against reordering and deletion.

Summary updated

BibTeX
@misc{arabi2026tango,
  author = {Kasra Arabi and Nir Weinberger and Micah Goldblum and Niv Cohen},
  title = {{TANGO: Watermarking Masked Diffusion Language Models in Token Pairs}},
  year = {2026},
  eprint = {2609.35224},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.35224},
}
Figure