Researchers have introduced TextSeal2, a watermarking system for large language models (LLMs) that embeds a statistical signal into generated text without compromising output diversity or introducing measurable latency. The method is designed to remain detectable even when LLMs employ speculative decoding, a technique that speeds up text generation by predicting multiple tokens ahead. This advancement addresses a key limitation of previous watermarking approaches, which often degraded output quality or failed under such optimizations.
TextSeal2 builds upon its predecessor, TextSeal, by employing a novel approach to key management and noise coupling. While TextSeal used a coin flip to route tokens between two keys, a method that could dilute detection strength as detectors averaged scores from both keys without knowing which was used, TextSeal2 merges multiple keys into a single virtual key. This virtual key is then coupled with fresh noise through AutoMark's Gaussian copula, allowing any number of keys, including publicly shared ones, to be merged without diluting the detection signal.
A critical aspect of TextSeal2 is its compatibility with speculative decoding. In this process, a smaller draft model proposes tokens, which are then verified by the main LLM. If the main model rejects a token, it generates a replacement. TextSeal2 ensures that these replacement tokens retain the watermark signal, effectively preserving the integrity of the watermark even when tokens are rejected and re-generated. This is achieved through an additional "exponential race" that verifies keyed drafts using the leftovers from the initial draft races, ensuring the output precisely matches the target model's distribution.
The researchers evaluated TextSeal2 on three LLMs. At equal output token diversity, TextSeal2 demonstrated improved detection rates compared to TextSeal, identifying 8 to 22 percentage points more 100-token answers with a false-positive rate of $10^{-3}$. Furthermore, under speculative decoding, TextSeal2 showed even greater gains, detecting 18 to 22 percentage points more 200-token answers than TextSeal and another method called textGrain, while maintaining the same acceptance rate. The system requires no post-logits optimization and adds no measurable inference latency, making it suitable for production environments.
The development of TextSeal2 is significant because it offers a solution for tracing AI-generated content without imposing a performance penalty or degrading the quality of the output. This is particularly relevant as AI-generated text proliferates and the need to distinguish it from human-written content grows, aiding in the prevention of misuse such as fabricated news or unauthorized model distillation. The code for TextSeal2 is available on GitHub.
