ITextWatermarker<T>

Interfaces · AiDotNet.Safety.Watermarking

Interface for keyed text watermarkers that detect, and embed, a watermark in text.

Implements: ITextSafetyModule<T>

Known implementations: IGenerationWatermarker<T>, ITextWatermarkEmbedder<T>, TextWatermarkerBase<T>

For Beginners

A text watermarker adds an invisible signature to AI-generated text. Humans can’t see the watermark, but a detector with the right key can find it later to show the text was generated by your system.

How It Works

A text watermark is embedded either while the text is generated, by biasing the language model’s next-token logits toward a keyed “green list” (IGenerationWatermarker, Kirchenbauer et al. 2023), or after generation, by keyed meaning-preserving substitutions (ITextWatermarkEmbedder). Detection is a statistical test with a stated false-positive rate: only a detector holding the same key finds the mark.

References:

  • Kirchenbauer et al., A Watermark for Large Language Models (ICML 2023, arxiv:2301.10226)
  • SoK: Systematization of watermarking across modalities (2024, arxiv:2411.18479)

Methods

Method Summary
WatermarkResult Detect(string text) Detects the watermark in the given text and reports the test behind the confidence.
double DetectWatermark(string text) Detects the watermark confidence score in the given text (0.0 = no watermark, 1.0 = certain).