Anchor-ECC: Local Integrity Checking for Watermarked LLM Outputs via Error-Correcting Codes

Zewei Deng, Muhammad Siddeek, Liyan Xie, Mohamed Seif, Mengdi Wang, H. Vincent Poor, Andrea GoldsmitharXiv 2026 · arXiv

TL;DR

Anchor-ECC is a new watermarking framework that moves beyond simple source attribution to provide local integrity checking for LLM outputs. By embedding joint Error-Correcting Code (ECC) constraints and explicit boundary anchors into the generation process, it allows users to detect and localize specific post-generation edits—such as insertions, deletions, or substitutions—with near-perfect accuracy.

What Problem Does This Paper Address?

Current LLM watermarking techniques are primarily designed for document-level detection: they tell you if a text was AI-generated, but not if it was tampered with after the fact.

This creates a significant attribution risk. An attacker could take a watermarked AI output and make a small, surgical edit—changing "The study found no evidence of harm" to "The study found evidence of harm." Because the document-level watermark signal remains largely intact, the modified (and now false) statement is still attributed to the original model. Anchor-ECC addresses this by providing "structural evidence" at a local level, allowing reviewers to pinpoint exactly where a text has been modified.

Methods

The authors introduce a block-based integrity layer that treats the LLM's token stream as a sequence of structural symbols.

  1. Vocabulary Partitioning: The tokenizer vocabulary is split into three buckets: two payload buckets ($B_0, B_1$) representing bits 0 and 1, and a disjoint "boundary-anchor" bucket ($B_{bd}$).
  2. Joint ECC Design: Each block of text must satisfy two mathematical constraints:
  3. Varshamov–Tenengolts (VT) Codes: These are classical codes designed to detect synchronization errors like insertions and deletions.
  4. Hamming-type Constraints: These are used to detect substitutions (bit-flips) where the length of the text remains the same but the content changes.
  5. Adaptive Generation: During inference, an "Adaptive ECC Generator" tracks the current block prefix. It restricts or biases the model's logit distribution to ensure the next token chosen belongs to a bucket that keeps the sequence compatible with the feasible ECC codeset.
  6. Global Decoding: At detection time, the system doesn't just look for broken patterns. It uses a dynamic-programming decoder to find the minimum-cost alignment of the observed text against the expected block structure. This allows it to recover from deleted or substituted boundary anchors that would otherwise cause a "cascading misalignment" in simpler detectors.
Figure 1: Left: Overview of the Anchor-ECC watermark embedding procedure. The tokenizer vocabulary is partitioned into two buckets B0, B1 and a disjoint boundary-anchor bucket Bbd. The feasible codeword set C = Va(n) ∩H combines VT and Hamming constraints. During Anchor-ECC generation, the adaptive generator tracks the current block prefix and restricts or biases the next-token distribution toward feasible bits, while boundary anchors close each structural block. Right: Overview of block-addressable integrity detection and candidate refinement using an insertion example. The edited text is first decoded into structural symbols, globally parsed into structural blocks, and then checked against the feasible codeword set C. A block is flagged as suspicious when its minimum edit distance to the feasible set exceeds the tolerance threshold r.

Datasets

The researchers evaluated Anchor-ECC using:

  • Models: Qwen3-8B, Mistral-7B-Instruct-v0.3, and OPT-125M.
  • Task: Long-form question answering (LFQA) using the LFQA corpus.
  • Edit Protocols:
    • Synthetic Edits: Randomly sampled insertions, deletions, and substitutions.
  • LLM-Guided Edits: A separate "editor" model was tasked with making benign changes (grammar, clarity) and malicious changes (claim distortion, stance shifting) to simulate real-world tampering.

Key Insights and Ideas

  • From Detection to Verification: The core shift is moving from "Is this AI?" to "Is this exactly what the AI said?"
  • The Necessity of Boundaries: Explicit boundary anchors (the '2' symbol in the structural alphabet) are the "secret sauce" that prevents a single deletion from ruining the watermark for the rest of the document.
  • Semantic Balancing: To minimize the impact on text quality, the authors group semantically similar tokens before splitting them into buckets. This ensures that even when the ECC requires a "bit 0" token, the model likely has a contextually appropriate word available in that bucket.
  • Tunable Reliability: By adjusting the logit bias ($\delta$), users can trade off between "hard" watermarking (near-perfect detection but higher perplexity) and "soft" watermarking (better text quality but lower detection sensitivity).

Key Results

Anchor-ECC significantly outperforms existing baselines (like KGW, Zhao-AOL, and WaterSeeker) in localizing edits, especially substitutions.

  • Detection Accuracy: In the "approximate-hard" setting ($\delta=20$), the system achieved a block-level True Positive Rate (TPR) of ~99.7% across all three models.
  • False Alarms: The False Alarm Rate (FAR) remained impressively low, staying below 0.8% for Mistral and OPT models.
  • Quality Trade-offs: The authors found that using a larger boundary pool (allocating 1/8th of the vocabulary to anchors) reduced conditional perplexity by 35.7% to 59.6% compared to a small 150-token anchor set, while still maintaining strong detection.
Table 1: Three-model LFQA results, macro-averaged over four edit rates and three edit budgets. Clean is the mean number of initially feasible blocks among 18; Cov. is candidate coverage.

Limitations and Future Work

  • Generation Cost: Even with semantic balancing, imposing structural constraints increases the perplexity of the model's output, which can occasionally lead to less natural phrasing.
  • Vocabulary Fragmentation: The method requires partitioning the vocabulary, which might be problematic for models with very small vocabularies or for highly specialized domains.
  • Adversarial Robustness: While the system handles random and LLM-guided edits well, the authors note that a "key-aware" attacker who knows the specific vocabulary partitions might be able to craft edits that bypass the ECC constraints.
  • Future Directions: The authors suggest exploring more sophisticated ECCs and investigating how these local integrity layers can be combined with multi-bit watermarking to embed metadata like timestamps or session IDs.

Summary updated

Abstract

LLM watermarking has become an effective approach to distinguishing AI-generated text from human-written text by embedding detectable patterns during generation. However, a small post-generation edit may change the meaning of the text without removing its overall watermark signal, creating a risk that the modified content is still attributed to the original model. We propose Anchor-ECC, which incorporates the error-correcting code (ECC) constraints and explicit boundary anchors into the watermark structure and pairs them with a dynamic-programming decoder to detect and localize post-generation edits. Across Qwen3-8B, Mistral-7B-Instruct-v0.3, and OPT-125M, the approximate-hard setting achieves about 99.7% block-level true positive rate (TPR) with at most 7.6% false alarm rate (FAR) for edit detection under mixed insertions, deletions, and substitutions, while preserving the distinction between watermarked outputs and unwatermarked text. Additional quality experiments identify lower-perplexity configurations that retain strong edit-detection performance. Together, these results extend LLM watermarking from source identification to local integrity verification while supporting configurable trade-offs between detection reliability and generation quality.
BibTeX
@misc{deng2026anchor,
  author = {Zewei Deng and Muhammad Siddeek and Liyan Xie and Mohamed Seif and Mengdi Wang and H. Vincent Poor and Andrea Goldsmith},
  title = {{Anchor-ECC: Local Integrity Checking for Watermarked LLM Outputs via Error-Correcting Codes}},
  year = {2026},
  eprint = {2609.38722},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.38722},
}
Figure