A Contrastive Semantic Watermarking Framework for Large Language Models
The widespread deployment of large language models (LLMs) has raised urgent demands for verifiable content attribution and misuse mitigation. Existing text watermarking techniques often struggle in black-box or sampling-based scenarios due to limitations in robustness, imperceptibility, and detection generality. These challenges are particularly critical in open-access settings, where model internals and generation logits are unavailable for attribution. To address these limitations, we propose CWS (Contrastive Watermarking with Semantic Modeling)—a novel keyless watermarking framework that integrates contrastive semantic token selection and shared embedding space alignment. CWS enables context-aware, fluent watermark embedding while supporting robust detection via a dual-branch mechanism: a lightweight z-score statistical test for public verification and a GRU-based semantic decoder for black-box adversarial robustness. Experiments on GPT-2, OPT-1.3B, and LLaMA-7B over C4 and DBpedia datasets demonstrate that CWS achieves F1 scores up to 99.9% and maintains F1 ≥ 93% under semantic rewriting, token substitution, and lossy compression (ε ≤ 0.25, δ ≤ 0.2). The GRU-based detector offers a superior speed–accuracy trade-off (0.42 s/sample) over LSTM and Transformer baselines. These results highlight CWS as a lightweight, black-box-compatible, and semantically robust watermarking method suitable for practical content attribution across LLM architectures and decoding strategies. Furthermore, CWS maintains a symmetrical architecture between embedding and detection stages via shared semantic representations, ensuring structural consistency and robustness. This semantic symmetry helps preserve detection reliability across diverse decoding strategies and adversarial conditions.
Authors
- Chaoen Xiao (ORCID: https://orcid.org/0000-0001-6885-9063)
- Jianxin Wang (ORCID: https://orcid.org/0009-0002-6265-554X)
- Lei Zhang (ORCID: https://orcid.org/0009-0008-8698-8959)
- Xiangze Chang
Institutions
- Beijing Electronic Science and Technology Institute (CN)
Publication Details
- Journal
- Symmetry
- Published
- 2025-07-14
- DOI
- https://doi.org/10.3390/sym17071124
- Primary Topic
- Advanced Steganography and Watermarking Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00