NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Look It Up: Multi-bit LLM Watermarking via Codebook Search

Jarosław Janas, Paweł Morawiecki, Josef PieprzykarXiv 2026

As LLMs churn out increasingly human-like text, the need for reliable "provenance"—knowing exactly which model or user generated a specific snippet—has become critical. While "zero-bit" watermarking (simply detecting if a text is AI-generated) is maturing, "multi-bit" watermarking (embedding a specific ID or payload) remains a bottleneck, especially for short texts like product reviews or social media posts.

A new paper, "Look It Up: Multi-bit LLM Watermarking via Codebook Search," introduces a clever way to bridge the gap between accuracy and speed by treating watermark extraction as a nearest-neighbor search problem.

TL;DR

The authors propose a codebook-based watermarking scheme that maps short payloads (e.g., 24 bits) to long, redundant codewords embedded during text generation. By using a precomputed secret codebook and Levenshtein distance for extraction, they achieve near-perfect recovery on texts as short as 127 tokens with millisecond-level decoding speeds.

What Problem Does This Paper Address?

Existing multi-bit watermarking methods face a harsh trade-off. Enumeration-based methods are highly accurate but painfully slow, sometimes taking hours to decode a single paragraph because they exhaustively search the message space. Position-based methods are fast but fragile; they often fail on short texts because they lack the redundancy needed to survive the "noise" of natural language generation.

This leaves the "sub-200 token" space—where fake reviews and misinformation thrive—largely unprotected. The challenge is to embed enough identifying information to be useful without requiring a novel's worth of text to recover it.

Methods

The core idea is a Codebook-based approach. Instead of trying to decode bits directly or search through every possible message at extraction time, the system uses a pre-generated "secret" codebook.

  1. Codebook Generation: Offline, they map every possible $n$-bit payload (e.g., a user ID) to a much longer $u$-bit codeword using a random linear code. This adds significant redundancy.
  2. Watermark Embedding: During LLM generation, they use standard token-level logit biasing. For each token, the vocabulary is split into "green" and "red" sets based on a secret key and the previous token. If the codeword bit is 0, they bias the model toward the green set; if 1, toward the red set.
  3. Watermark Extraction: The receiver decodes a "noisy" bit sequence from the text. They then search the precomputed codebook for the closest codeword.
The overall watermarking pipeline: from offline codebook generation to online embedding and extraction.

A key innovation is the use of Levenshtein (edit) distance during extraction. Unlike Hamming distance, which requires bits to be in exact positions, Levenshtein distance allows the system to remain robust even if the text undergoes minor edits, deletions, or tokenization shifts.

Datasets

The authors evaluated their method across several diverse datasets to test robustness and text quality:

  • OpenGen: Used for base model evaluations (Llama 2 7B).
  • Essays-With-Instructions & HC3: Used to test performance on instruction-tuned models.
  • SAR Prompts: A dataset of review-style and social-post prompts used for "LLM-as-a-Judge" quality evaluations.

Key Insights and Ideas

  • The Power of Redundancy: By expanding a 24-bit ID into a 127-bit or 200-bit codeword, the system can tolerate many "errors" (where the LLM's natural probability overpowers the watermark bias) and still recover the correct ID.
  • Linear Codes vs. RNG: The authors found that using a structured linear code for the codebook provides a "uniform minimum distance" between codewords. This ensures that no specific ID is "unluckily" close to another, making the system more reliably robust across the entire payload space.
  • Tokenization is Tricky: LLM tokenizers are not always "round-trip stable." A word might be one token during generation but two tokens when re-encoded later. The authors implemented a stepwise consistency check during embedding to ensure the generated text would be interpreted correctly by the extractor.
  • Diversity Bonus: Surprisingly, the logit biasing actually increased the lexical diversity of the generated text. By pushing the model away from its most "obvious" (highest probability) token choices, the watermark introduced more varied and idiosyncratic phrasing.

Key Results

  • Near-Perfect Recovery: On 200-token generations, the method achieved a 99.8% to 99.9% match rate for 24-bit payloads, significantly outperforming prior state-of-the-art methods like Qu et al. (96%) and Lin et al. (90%).
  • Speed: Extraction for a 24-bit payload takes roughly 4ms to 75ms, depending on the distance metric and hardware. This is orders of magnitude faster than enumeration methods that take hours.
  • Robustness: The Levenshtein variant maintained high accuracy even under 10% word deletion or light paraphrasing, where Hamming-based methods completely failed.
Comparison of match rates under various text-editing attacks. The Levenshtein variant (green) shows superior resilience to deletions and paraphrasing.
  • High Confidence: The ROC curves show near-perfect discrimination (AUROC > 0.998) between watermarked and unwatermarked text.
Fig. 3. ROC curve with reported AUROC. Marked points have 1% False Positive Rate.

Limitations and Future Work

The primary limitation is the "Memory Wall." Because the codebook must be stored and searched, the payload size $n$ is limited. A 24-bit codebook (16 million entries) fits in 256MB of RAM, but a 32-bit codebook (4 billion entries) would require 64GB, making it impractical for many deployments.

The authors suggest that for larger payloads, one could split the message across longer texts (e.g., two 16-bit watermarks in a 256-token text). They also introduced a BCH-based variant that doesn't require a codebook, though it is currently less robust to edits. Future work may involve optimizing these algebraic codes to match the robustness of the search-based approach.

Summary updated

BibTeX
@misc{janas2026look,
  author = {Jarosław Janas and Paweł Morawiecki and Josef Pieprzyk},
  title = {{Look It Up: Multi-bit LLM Watermarking via Codebook Search}},
  year = {2026},
  eprint = {2611.16890},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.16890},
}
Figure