Skip to content

Add TextSeal dual-key watermarking - #75

Open
UUUUxx wants to merge 1 commit into
THU-BPM:mainfrom
UUUUxx:feat/textseal-watermark
Open

Add TextSeal dual-key watermarking#75
UUUUxx wants to merge 1 commit into
THU-BPM:mainfrom
UUUUxx:feat/textseal-watermark

Conversation

@UUUUxx

@UUUUxx UUUUxx commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • integrate Meta TextSeal dual-key Gumbel-max generation with the MarkLLM BaseWatermark and Hugging Face generation interfaces
  • add entropy-aware dual-key fused detection with v1/v2 deduplication and a MarkLLM-compatible -log10(p) score
  • add config/TextSeal.json, automatic registration, batched logits processing, continuous token-evidence visualization, tests, and Apache-2.0 attribution
  • keep the PR focused on standard generation/global detection; speculative decoding and localized multi-region APIs remain documented as upstream extensions

Validation

  • pytest -q test/test_textseal.py — 5 passed
  • exact parity check against Meta upstream on CPU:
    • Key-A PRF tensor: exact match
    • Key-B PRF tensor: exact match
    • seeded Gumbel-max selected token: exact match
  • real MarkLLM pipelines with facebook/opt-125m, 96 generated tokens, three C4 samples:
    • clean watermarked scores: 23.8678, 15.3098, 9.7306
    • 30% word-deletion scores: 11.4136, 11.6603, 6.1834
    • natural-text scores: 0.6396, 0.1706, 0.2319
    • dynamic-threshold clean F1: 1.0; 30% deletion F1: 1.0
  • generated and visually inspected continuous per-token evidence output

These three-sample runs are integration smoke tests, not a reproduction of the full paper benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant