LexiMark: Robust Watermarking via Lexical Substitutions to Enhance Membership Verification of an LLM's Textual Training Data

Eyal German, Sagiv Antebi, Edan Habler, Asaf Shabtai, Yuval EloviciarXiv 2025 · DOI

Abstract

LexiMark is a stealthy watermarking technique designed to protect textual datasets by replacing high-entropy words with rarer synonyms. By nudging Large Language Models (LLMs) to memorize these specific lexical choices during training, LexiMark enables data owners to verify unauthorized dataset usage with significantly higher accuracy and fewer samples than traditional membership inference methods.

Introduction

As Large Language Models (LLMs) grow in capability, the demand for high-quality training data has led to the unauthorized scraping of proprietary and copyrighted content. Proving that a specific model was trained on a particular dataset—a process known as Membership Inference—is a significant challenge. Traditional detection methods, such as Membership Inference Attacks (MIAs) that monitor perplexity, are often unreliable for large-scale datasets. Furthermore, existing watermarking techniques like inserting random strings or invisible Unicode characters are easily detected and removed during preprocessing.

LexiMark addresses these limitations by creating a watermark that is stealthy (invisible to humans), robust (resistant to removal), and effective (statistically verifiable). It leverages the inherent way LLMs handle word rarity to create a "memorization hook" that serves as a smoking gun for unauthorized training.

Methodology

LexiMark’s core innovation lies in its use of "entropy"—the unpredictability of a word given its context. The embedding process follows a structured pipeline to ensure both detectability and semantic preservation.

The LexiMark workflow for embedding watermarks into textual data.
  1. Watermark Embedding: The algorithm identifies "high-entropy" words in a sentence—tokens that are rare or surprising. These are replaced with synonyms that possess even higher entropy. For example, "quick" might become "speedy," and "lazy" might become "sluggish."
  2. Semantic Integrity: To ensure the original meaning is preserved, LexiMark utilizes models like BERT or SBERT to filter synonyms, maintaining high semantic similarity and grammatical correctness.
  3. The Memorization Hook: LLMs find high-entropy tokens more difficult to predict and are consequently more likely to memorize these specific sequences during training. This intentional memorization creates a verifiable trail within the model's weights.
  4. Watermark Detection: Verification is performed using an MIA (such as the Min-K++ attack). If the model demonstrates an unusually high familiarity with the specific watermarked synonyms compared to the original text, it provides strong evidence of unauthorized usage.

Experimental Evaluation

The authors evaluated LexiMark across a diverse range of text types and model architectures:

  • Datasets: BookMIA (pre- and post-2023 book snippets) and subsets of The Pile, including PubMed Abstracts, Enron Emails, FreeLaw, Wikipedia, and USPTO Backgrounds.
  • Models: Seven open-source models were tested, ranging from Pythia (160M) to larger architectures like LLaMA-3 (8B) and Mistral (7B).

Key Results and Insights

  • Significant Detection Boost: LexiMark substantially improves detection accuracy. For the Pythia-6.9B model on the BookMIA dataset, the AUROC increased from 69.1% (no watermark) to 94.8%.
  • High Efficiency: Due to the distinct signal created by the watermark, researchers could verify a dataset's presence with just 6 samples, whereas non-watermarked data required 40 samples for similar confidence.
  • Robustness and Stealth: The watermark remained detectable even after adversarial attempts to remove it via synonym replacement and persisted through instruction tuning. Unlike Unicode-based methods, LexiMark had a negligible impact on model perplexity, making it difficult to detect via automated filters.
  • Semantic Preservation: Using SBERT for synonym selection, the watermarked text maintained over 99% cosine similarity to the original content, ensuring the data's utility remained intact.

Limitations and Future Work

While effective, LexiMark currently relies on English-centric lexical resources like WordNet and English BERT. Future work will focus on expanding the method to multilingual datasets. Additionally, while the authors suggest lightweight alternatives like WordNet, the computational overhead of using advanced LLMs for synonym selection on massive datasets remains a consideration. Future refinements will aim to balance the number of substitutions ($K$) with natural text flow to ensure the watermark remains undetectable even by advanced AI cleaning tools.

Summary updated

BibTeX
@misc{german2025leximark,
  author = {Eyal German and Sagiv Antebi and Edan Habler and Asaf Shabtai and Yuval Elovici},
  title = {{LexiMark: Robust Watermarking via Lexical Substitutions to Enhance Membership Verification of an LLM's Textual Training Data}},
  year = {2025},
  eprint = {2506.14474},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.14474},
}
Figure