SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.13485 · ACL · 2024

An Entropy-based Text Watermarking Detection Method

Jingjing Li, Aiwei Liu, Irwin King, Yijian Lu, Dianzhi Yu

arXiv · PDF · Open in the Atlas

Code that ran

1 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2403.13485.json · badge: /api/ran/2403.13485.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
thu-bpm/markllm marked official in Papers with Code
Papers with Code archive
1 ran · 3 no recorded run
luyijian3/ewd marked official in Papers with Code
Papers with Code archive
0 ran · 2 no recorded run
FunctionStatusWhere it lives
EWDUtils Ran
ran on a synthesized input · constructed an object; no result was computed
thu-bpm/markllm/watermark/ewd/ewd.py
code served (permissive licence) · get_code("29c344b402f91007")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, EWDUtils: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal tokenizer stand-in
class SimpleTokenizer:
    def __init__(self, vocab_size=100):
        self.vocab_size = vocab_size
    
    def __len__(self):
        return self.vocab_size

# Create a minimal model stand-in
class SimpleModel(nn.Module):
    def __init__(self, vocab_size=100):
        super().__init__()
        self.vocab_size = vocab_size
        self.embedding = nn.Embedding(vocab_size, 16)
        self.linear = nn.Linear(16, vocab_size)
    
    def forward(self, input_ids):
        x = self.embedding(input_ids)
        return self.linear(x)

# Create a minimal TransformersConfig
class TransformersConfig:
    def __init__(self, model, tokenizer, vocab_size=None, device='cpu', *args, **kwargs):
        self.device = device
        self.model = model
        self.tokenizer = tokenizer
        self.vocab_size = len(tokenizer) if vocab_size is None else vocab_size
        self.gen_kwargs = {}
        self.gen_kwargs.update(kwargs)

# Create a minimal EWDConfig
class EWDConfig:
    def __init__(self, model, tokenizer, vocab_size=100, device='cpu'):
        self.model = model
        self.tokenizer = tokenizer
        self.vocab_size = vocab_size
        self.device = device
        self.gen_kwargs = {}
        # Initialize EWD-specific parameters
        self.gamma = 0.25
        self.delta = 2.0
        self.hash_key = 42
        self.z_threshold = 4.0
        self.prefix_length = 2

# Instantiate components
tokenizer = SimpleTokenizer(vocab_size=100)
model = SimpleModel(vocab_size=100)
transformers_config = TransformersConfig(
    model=model,
    tokenizer=tokenizer,
    vocab_size=100,
    device='cpu'
)

ewd_config = EWDConfig(
    model=model,
    tokenizer=tokenizer,
    vocab_size=100,
    device='cpu'
)

ARGS = {
    'config': ewd_config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EWDUtils — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EWDUtils output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
EWD Not yet run
unverified (harvested, no recorded run)
thu-bpm/markllm/watermark/ewd/ewd.py
code served (permissive licence) · get_code("bc42833e1c042e23")
How it ran

no invocation recorded.

EWDConfig Not yet run
unverified (harvested, no recorded run)
thu-bpm/markllm/watermark/ewd/ewd.py
code served (permissive licence) · get_code("dcb60e3e76ddf430")
How it ran

no invocation recorded.

EWDLogitsProcessor Not yet run
unverified (harvested, no recorded run)
thu-bpm/markllm/watermark/ewd/ewd.py
code served (permissive licence) · get_code("961f4cdd257ae8cc")
How it ran

no invocation recorded.

WatermarkBase Not yet run
unverified (harvested, no recorded run)
luyijian3/ewd/watermark.py
pointer only (licence: NONE) · get_code("462700cce0c46698")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, luyijian3/ewd when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

WatermarkDetector Not yet run
unverified (harvested, no recorded run)
luyijian3/ewd/watermark.py
pointer only (licence: NONE) · get_code("355a41a6670d4732")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, luyijian3/ewd when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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. 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 Entropybased Text Watermarking Detection (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 1 . Additionally, our algorithm could be accessed through MarkLLM (Pan et al., 2024) 2 .

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2403.13485")
get_code_for_paper("2403.13485")
have("2403.13485")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2403.13485.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2403.13485.svg)](https://syntology.ai/paper/2403.13485)

Connect an agent — have() is free.