An Entropy-based Text Watermarking Detection Method

Yijian Lu, Aiwei Liu, Dianzhi Yu, Jingjing Li, Irwin King
3/20/2024
116 citations
cs.CL

Official code: THU-BPM/MarkLLM (1,092 stars, Python, Apache-2.0, last commit 2026-03-17). 1 more implementation below.

Abstract

Text watermarking algorithms for large language models (LLMs) can effectively identify machine-generated texts by embedding and detecting hidden features in the text. Although the current text watermarking algorithms perform well in most high-entropy scenarios, its performance in low-entropy scenarios still needs to be improved.

Show full abstract

In this work, we opine that the influence of token entropy should be fully considered in the watermark detection process, $i.e.$, the weight of each token during watermark detection should be customized according to its entropy, rather than setting the weights of all tokens to the same value as in previous methods. Specifically, we propose \textbf{E}ntropy-based Text \textbf{W}atermarking \textbf{D}etection (\textbf{EWD}) that gives higher-entropy tokens higher influence weights during watermark detection, so as to better reflect the degree of watermarking. Furthermore, the proposed detection process is training-free and fully automated. From the experiments, we demonstrate that our EWD can achieve better detection performance in low-entropy scenarios, and our method is also general and can be applied to texts with different entropy distributions. Our code and data is available\footnote{\url{https://github.com/luyijian3/EWD}}. Additionally, our algorithm could be accessed through MarkLLM \cite{pan2024markllm}\footnote{\url{https://github.com/THU-BPM/MarkLLM}}.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
THU-BPM/MarkLLMOfficial1,092PythonApache-2.02026-03-17
luyijian3/EWDOfficial7Python–2024-08-27
THU-BPM/MarkLLMOfficial100%
Apache-2.0

[EMNLP 2024 Demo] MarkLLM: An Open-Source Toolkit for LLM Watermarking

1,09295Python, Jupyter NotebookMay 16, 20248 months agoApache-2.0
large-language-modelsllmsafetytoolkittrustworthy-ai+1 more
luyijian3/EWDOfficial100%
70PythonJun 4, 20242 years ago

Similar Papers

Cite this paper

@article{lu2024entropybased,
  title  = {An Entropy-based Text Watermarking Detection Method},
  author = {Yijian Lu and Aiwei Liu and Dianzhi Yu and Jingjing Li and Irwin King},
  year   = {2024},
  eprint = {2403.13485},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.13485v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.13485.svg)](https://codeofpaper.com/paper/2403.13485)

Discussion