← Latest papers
📊 statistics

Optimal Watermark Localization in Mixed-Source Large Language Model Texts

This paper formulates watermark localization in mixed-source LLM texts as a token-level multiple-testing problem, establishing theoretical phase transitions for detection and classification while proposing an adaptive thresholding method that achieves optimal discovery power without requiring prior knowledge of signal sparsity or distribution parameters.

Original authors: Jose H. Blanchet, T. Tony Cai, Xiang Li, Hao Liu, Qi Long, Weijie J. Su

Published 2026-08-18
📖 7 min read🧠 Deep dive

Original authors: Jose H. Blanchet, T. Tony Cai, Xiang Li, Hao Liu, Qi Long, Weijie J. Su

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the modern digital landscape, large language models have become powerful tools for generating human-like text, assisting with everything from writing essays to debugging code. However, this capability brings a significant challenge: distinguishing between text written by a human and text generated by a machine. To solve this, researchers have developed a technique called watermarking. Imagine a machine that, while writing, secretly embeds a statistical pattern into its choice of words. This pattern is invisible to the human eye and does not change the meaning or flow of the text, but it acts like a hidden signature that a verifier can detect if they possess the correct key. This allows for the authentication of AI-generated content, helping to protect academic integrity and prevent the spread of misinformation.

Yet, a major complication arises in the real world. People rarely use AI-generated text exactly as it comes out of the machine. They edit, rewrite, paraphrase, or delete parts of it before submitting or publishing. These human changes can break the hidden statistical pattern, erasing the evidence of the machine's involvement in those specific sections. This leaves a difficult question: if a document is a mix of original AI text and human edits, can we pinpoint exactly which parts still carry the machine's signature, and which parts have been altered beyond recognition? This is not just about knowing if a document contains AI; it is about finding the specific locations where the AI's fingerprint survives.

A team of researchers from Stanford University and the University of Pennsylvania has tackled this problem by treating it as a statistical search for hidden signals within a noisy sequence. They developed a new method to locate these surviving watermarks at the level of individual words, or tokens, rather than just looking at the document as a whole. Their work reveals that finding these specific locations is fundamentally harder than simply detecting that a document contains AI text. Furthermore, they discovered a hard limit: it is mathematically impossible to perfectly separate every single machine-written word from every human-written word in a mixed document, no matter how sophisticated the method. However, they also created a new, adaptive tool that can successfully identify the surviving machine-written sections with high accuracy, even without knowing exactly how much editing occurred or how the text was originally generated.

The researchers approached the problem by first understanding the nature of the "noise" created by human editing. When a human edits a text, they might replace a word, insert a new sentence, or delete a phrase. If the original word was part of the AI's hidden pattern, replacing it breaks the link. The researchers modeled this as a sequence where some positions still hold the original statistical signal, while others have been erased. They defined three levels of success for a detection system. The first is global detection, which simply asks, "Is there any AI in this text?" The second is discovery, which asks, "Can we find at least some of the AI-written parts?" The third is classification, which asks, "Can we perfectly identify every single AI-written word and every single human-written word?"

Through their analysis, the team proved that while global detection is often possible, finding the specific locations is a much stricter challenge. They showed that discovery is strictly harder than detection because it requires not just sensing a signal, but isolating it from a sea of human edits without making too many mistakes. More significantly, they demonstrated that perfect classification is impossible under their model. This is because some machine-written words, after editing, look so much like human-written words that no statistical test can reliably tell them apart. Trying to catch every single machine word would inevitably lead to falsely accusing human words of being machine-generated, and trying to avoid false accusations would mean missing many machine words. Therefore, the goal must be adjusted to finding a reliable set of machine-written sections rather than a perfect map of the entire document.

To achieve this reliable discovery, the researchers developed a method called SPOT, which stands for Scanning Pivots Over Thresholds. This method works by scanning the text and looking for words that exhibit a statistical pattern that is unusually strong, suggesting they were likely generated by the AI and not altered. The challenge is setting the right sensitivity for this scan. If the scan is too sensitive, it will flag too many human words as machine-generated. If it is too strict, it will miss the machine words that are harder to detect. SPOT solves this by automatically adjusting its sensitivity based on the data it sees. It estimates how much of the text likely still contains the AI signature and then selects a threshold that keeps the rate of false alarms low while still catching as many true signals as possible. This allows the system to adapt to different types of documents and editing styles without needing to know the specific details of how the text was created or edited beforehand.

The researchers tested their theory and method through extensive simulations and experiments with real language models. In their simulations, they created artificial texts with varying degrees of editing and different levels of signal strength. The results confirmed their theoretical predictions: there is a clear boundary where finding the machine-written parts becomes possible, and a boundary where it becomes impossible. When the editing is too heavy or the signal too weak, the method correctly fails to find a reliable set of locations. But within the achievable range, the method performs with high precision. In experiments using a real language model to generate text and then applying common human edits like random substitutions, insertions, and deletions, the SPOT method consistently outperformed existing approaches. It was able to identify a larger fraction of the surviving machine-written words while keeping the number of false accusations low.

The study also highlighted how the difficulty of the task changes with the nature of the text generation. When the language model generates text with high randomness, there are more opportunities to find the hidden statistical patterns, making localization easier. When the model is more deterministic, producing very predictable text, the hidden patterns are weaker, and the task becomes harder. The researchers found that their method remained robust across these different conditions, though the accuracy of the underlying estimates for how much text was edited did play a role in performance. They noted that while their method is highly effective, the accuracy of the initial estimate of how much editing occurred can be a bottleneck, particularly when the text is very predictable.

Ultimately, this work provides a clear statistical framework for understanding the limits of watermark localization. It establishes that while we cannot perfectly reconstruct the entire history of a mixed-source document, we can reliably identify the parts that still bear the mark of the machine. This distinction is crucial for practical applications. It means that instead of hoping for a perfect solution that separates every word, we can build systems that confidently flag the sections of a document that are likely AI-generated. This allows for more nuanced attribution, helping educators, publishers, and researchers to understand the provenance of text with greater precision. The researchers conclude that their adaptive method offers a practical and theoretically sound way to navigate the complex reality of edited AI text, providing a tool that works well even when the exact conditions of the text's creation are unknown.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →