@prefix : <https://arxiv.org/abs/2301.10226#> .
@prefix schema: <http://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# ---------------------------------------------------------------------------
# Ontology
# ---------------------------------------------------------------------------

:ontology a owl:Ontology ;
    schema:name "Watermark-for-LLMs Local Ontology"@en ;
    schema:description "Lightweight ontology modeling the progressive family of watermarking scheme variants (hard red-list, hash-seeded green-list, soft-biased) introduced in the paper 'A Watermark for Large Language Models'."@en ;
    schema:identifier <https://arxiv.org/abs/2301.10226> ;
    rdfs:label "Watermark-for-LLMs Local Ontology"@en ;
    rdfs:comment "Defines :WatermarkVariant and its structured attributes for representing the three progressively refined watermarking schemes discussed in the source paper."@en .

:WatermarkVariant a rdfs:Class ;
    rdfs:label "Watermark Variant"@en ;
    rdfs:comment "A distinct watermarking scheme variant discussed in the paper, distinguished by how it constrains token sampling toward the green list."@en ;
    rdfs:isDefinedBy :ontology .

:hasConstraintType a rdf:Property ;
    rdfs:label "has constraint type"@en ;
    rdfs:comment "Whether the variant enforces a hard (green-list-only) or soft (logit-biased) sampling constraint."@en ;
    rdfs:domain :WatermarkVariant ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy :ontology .

:hasLimitation a rdf:Property ;
    rdfs:label "has limitation"@en ;
    rdfs:comment "The principal drawback of this variant as identified in the paper."@en ;
    rdfs:domain :WatermarkVariant ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy :ontology .

# ---------------------------------------------------------------------------
# Skill provenance entities
# ---------------------------------------------------------------------------

<https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/kg-generator#this> a schema:SoftwareApplication ;
    schema:name "kg-generator skill"@en ;
    schema:url <https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/kg-generator> ;
    schema:description "Skill that generates comprehensive RDF-Turtle or JSON-LD knowledge graphs from web and document sources."@en .

<https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/rdf-infographic-skill#this> a schema:SoftwareApplication ;
    schema:name "rdf-infographic-skill"@en ;
    schema:url <https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/rdf-infographic-skill> ;
    schema:description "Skill that generates interactive HTML infographics and Markdown companions from RDF knowledge graphs."@en .

# ---------------------------------------------------------------------------
# Main KG document + the scholarly article it describes
# ---------------------------------------------------------------------------

:kgSummary a schema:CreativeWork ;
    schema:name "Knowledge Graph: A Watermark for Large Language Models"@en ;
    schema:description "A knowledge graph representation of the arXiv paper 'A Watermark for Large Language Models' (Kirchenbauer et al., ICML 2023), including its watermarking method, statistical detection test, and a supplementary worked example of green-list/red-list token selection."@en ;
    schema:about :paper ;
    schema:dateCreated "2026-08-11"^^xsd:date ;
    schema:hasPart :paperSummarySection, :methodSection, :variantsSection, :detectionSection,
        :entropySection, :experimentsSection, :robustnessSection, :faqSection, :glossarySection,
        :howtoSection, :simpleExampleSection ;
    prov:wasGeneratedBy <https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/kg-generator#this> .

:paperSummarySection schema:isPartOf :kgSummary ;
    a schema:CreativeWork ;
    schema:name "Paper Summary"@en ;
    schema:hasPart :paper .

:paper a schema:ScholarlyArticle ;
    schema:isPartOf :paperSummarySection ;
    schema:headline "A Watermark for Large Language Models"@en ;
    schema:abstract """Potential harms of large language models can be mitigated by watermarking model output, i.e., embedding signals into generated text that are invisible to humans but algorithmically detectable from a short span of tokens. We propose a watermarking framework for proprietary language models. The watermark can be embedded with negligible impact on text quality, and can be detected using an efficient open-source algorithm without access to the language model API or parameters. The watermark works by selecting a randomized set of 'green' tokens before a word is generated, and then softly promoting use of green tokens during sampling. We propose a statistical test for detecting the watermark with interpretable p-values, and derive an information-theoretic framework for analyzing the sensitivity of the watermark. We test the watermark using a multi-billion parameter model from the Open Pretrained Transformer (OPT) family, and discuss robustness and security."""@en ;
    schema:datePublished "2023-01-24"^^xsd:date ;
    schema:dateModified "2024-05-01"^^xsd:date ;
    schema:url <https://arxiv.org/abs/2301.10226>, <https://arxiv.org/pdf/2301.10226> ;
    schema:identifier <https://doi.org/10.48550/arXiv.2301.10226> ;
    schema:author <https://www.linkedin.com/in/johnkirchenbauer#this>,
        <https://www.linkedin.com/in/jonas-geiping-9684441b5#this>,
        <https://www.linkedin.com/in/yuxin-wen-6517b717b#this>,
        <https://www.linkedin.com/in/jonathan-katz-0201871#this>,
        <https://www.linkedin.com/in/ian-miers-27240827#this>,
        <https://www.linkedin.com/in/therealtomgoldstein#this> ;
    schema:publisher :icml2023 ;
    schema:isPartOf :icml2023 ;
    schema:relatedLink <https://github.com/jwkirchenbauer/lm-watermarking> ;
    schema:hasPart :githubRepo .

:icml2023 a schema:Event ;
    schema:hasPart :paper ;
    schema:name "Fortieth International Conference on Machine Learning (ICML 2023)"@en ;
    rdfs:seeAlso <http://dbpedia.org/resource/International_Conference_on_Machine_Learning> .

:githubRepo a schema:SoftwareSourceCode ;
    schema:isPartOf :paper ;
    schema:name "lm-watermarking"@en ;
    schema:description "Open-source reference implementation of the watermark embedding and detection algorithms described in the paper."@en ;
    schema:codeRepository <https://github.com/jwkirchenbauer/lm-watermarking> ;
    schema:about :paper .

# ---------------------------------------------------------------------------
# Authors
# ---------------------------------------------------------------------------

<https://www.linkedin.com/in/johnkirchenbauer#this> a schema:Person ;
    schema:name "John Kirchenbauer"@en ;
    schema:url <https://www.linkedin.com/in/johnkirchenbauer/> ;
    schema:identifier <https://www.linkedin.com/in/johnkirchenbauer/> ;
    schema:affiliation <http://dbpedia.org/resource/University_of_Maryland,_College_Park> ;
    owl:sameAs <https://x.com/jwkirchenbauer#this> .

<https://x.com/jwkirchenbauer#this> a schema:Person ;
    schema:name "John Kirchenbauer"@en ;
    schema:url <https://x.com/jwkirchenbauer> .

<https://www.linkedin.com/in/jonas-geiping-9684441b5#this> a schema:Person ;
    schema:name "Jonas Geiping"@en ;
    schema:url <https://www.linkedin.com/in/jonas-geiping-9684441b5/> ;
    schema:identifier <https://www.linkedin.com/in/jonas-geiping-9684441b5/> ;
    schema:affiliation <http://dbpedia.org/resource/University_of_Maryland,_College_Park> ;
    owl:sameAs <https://x.com/jonasgeiping#this> .

<https://x.com/jonasgeiping#this> a schema:Person ;
    schema:name "Jonas Geiping"@en ;
    schema:url <https://x.com/jonasgeiping> .

<https://www.linkedin.com/in/yuxin-wen-6517b717b#this> a schema:Person ;
    schema:name "Yuxin Wen"@en ;
    schema:url <https://www.linkedin.com/in/yuxin-wen-6517b717b/> ;
    schema:identifier <https://www.linkedin.com/in/yuxin-wen-6517b717b/> ;
    schema:affiliation <http://dbpedia.org/resource/University_of_Maryland,_College_Park> .

<https://www.linkedin.com/in/jonathan-katz-0201871#this> a schema:Person ;
    schema:name "Jonathan Katz"@en ;
    schema:url <https://www.linkedin.com/in/jonathan-katz-0201871/> ;
    schema:identifier <https://www.linkedin.com/in/jonathan-katz-0201871/> ;
    schema:affiliation <http://dbpedia.org/resource/University_of_Maryland,_College_Park> ;
    owl:sameAs <http://dbpedia.org/resource/Jonathan_Katz_(computer_scientist)> .

<https://www.linkedin.com/in/ian-miers-27240827#this> a schema:Person ;
    schema:name "Ian Miers"@en ;
    schema:url <https://www.linkedin.com/in/ian-miers-27240827/> ;
    schema:identifier <https://www.linkedin.com/in/ian-miers-27240827/> ;
    schema:affiliation <http://dbpedia.org/resource/University_of_Maryland,_College_Park> .

<https://www.linkedin.com/in/therealtomgoldstein#this> a schema:Person ;
    schema:name "Tom Goldstein"@en ;
    schema:url <https://www.linkedin.com/in/therealtomgoldstein/> ;
    schema:identifier <https://www.linkedin.com/in/therealtomgoldstein/> ;
    schema:affiliation <http://dbpedia.org/resource/University_of_Maryland,_College_Park> ;
    owl:sameAs <https://x.com/tomgoldsteincs#this>, <http://dbpedia.org/resource/Tom_Goldstein> .

<https://x.com/tomgoldsteincs#this> a schema:Person ;
    schema:name "Tom Goldstein"@en ;
    schema:url <https://x.com/tomgoldsteincs> .

<http://dbpedia.org/resource/University_of_Maryland,_College_Park> a schema:CollegeOrUniversity ;
    schema:name "University of Maryland, College Park"@en .

# ---------------------------------------------------------------------------
# Method / detection / entropy / experiments / robustness sections
# ---------------------------------------------------------------------------

:methodSection a schema:CreativeWork ;
    schema:isPartOf :kgSummary ;
    schema:name "Watermarking Method"@en ;
    schema:abstract "At each generation step, the previous token is hashed with a secret key to seed a pseudorandom partition of the vocabulary into a green list and a red list; sampling is then biased toward the green list."@en ;
    schema:hasPart :variantsSection .
:kgSummary schema:hasPart :methodSection .

:variantsSection a schema:CreativeWork ;
    schema:isPartOf :methodSection ;
    schema:name "Progression of Watermark Variants"@en ;
    schema:hasPart :hardRedListWatermark, :greenListHashWatermark, :softWatermark .
:methodSection schema:hasPart :variantsSection .

:hardRedListWatermark a :WatermarkVariant ;
    schema:isPartOf :variantsSection ;
    schema:position 1 ;
    schema:name "Hard Red List Baseline"@en ;
    schema:description "A baseline scheme using a single fixed red list of banned tokens applied uniformly across all generation steps."@en ;
    :hasConstraintType "hard"@en ;
    :hasLimitation "A static, position-independent red list is easy to characterize and produces noticeably degraded, low-diversity text."@en .

:greenListHashWatermark a :WatermarkVariant ;
    schema:isPartOf :variantsSection ;
    schema:position 2 ;
    schema:name "Hash-Seeded Green List Watermark"@en ;
    schema:description "The green/red partition is re-derived at every position by hashing the immediately preceding token, then sampling is restricted to the green list only (hard constraint)."@en ;
    :hasConstraintType "hard"@en ;
    :hasLimitation "Hard exclusion of the entire red list can be too restrictive at low-entropy positions where only a few tokens are plausible."@en .

:softWatermark a :WatermarkVariant ;
    schema:isPartOf :variantsSection ;
    schema:position 3 ;
    schema:name "Soft Watermark"@en ;
    schema:description "Instead of forbidding red-list tokens, a hardness parameter (bias) delta is added to the logits of green-list tokens before sampling, softly promoting green tokens while preserving text quality at low-entropy positions."@en ;
    :hasConstraintType "soft"@en ;
    :hasLimitation "Watermark detection strength depends on the entropy of the generated text; near-deterministic, low-entropy passages carry a weaker signal."@en .

:detectionSection a schema:CreativeWork ;
    schema:isPartOf :kgSummary ;
    schema:name "Watermark Detection Test"@en ;
    schema:abstract "Detection recomputes the green list at each position of a candidate text using the same hash function and secret key, counts the observed green tokens, and computes a one-proportion z-statistic against the null hypothesis of no watermark to derive an interpretable p-value."@en .
:kgSummary schema:hasPart :detectionSection .

:entropySection a schema:CreativeWork ;
    schema:isPartOf :kgSummary ;
    schema:name "Information-Theoretic Sensitivity Analysis"@en ;
    schema:abstract "The paper derives an information-theoretic framework, including a spike entropy measure, to analyze how the watermark's detectability depends on the entropy of the token distribution at each generation step."@en .
:kgSummary schema:hasPart :entropySection .

:experimentsSection a schema:CreativeWork ;
    schema:isPartOf :kgSummary ;
    schema:name "Experimental Evaluation"@en ;
    schema:abstract "The watermark is evaluated on a multi-billion parameter model from the Open Pretrained Transformer (OPT) family, measuring detectability and text-quality impact."@en ;
    schema:hasPart :optModel .
:kgSummary schema:hasPart :experimentsSection .

:optModel a schema:SoftwareApplication ;
    schema:isPartOf :experimentsSection ;
    schema:name "OPT (Open Pretrained Transformer)"@en ;
    schema:description "Multi-billion parameter open-weight language model family used to empirically test the watermarking scheme."@en ;
    schema:creator :metaAI .

:metaAI a schema:Organization ;
    schema:name "Meta AI"@en ;
    schema:parentOrganization <http://dbpedia.org/resource/Meta_Platforms> .

<http://dbpedia.org/resource/Meta_Platforms> a schema:Organization ;
    schema:name "Meta Platforms"@en .

:robustnessSection a schema:CreativeWork ;
    schema:isPartOf :kgSummary ;
    schema:name "Robustness and Security Discussion"@en ;
    schema:abstract "The paper discusses the watermark's robustness to text modification and paraphrasing, and security considerations such as an adversary attempting to spoof or remove the watermark without knowledge of the secret key."@en .
:kgSummary schema:hasPart :robustnessSection .

# ---------------------------------------------------------------------------
# FAQ
# ---------------------------------------------------------------------------

:faqSection a schema:FAQPage ;
    schema:isPartOf :kgSummary ;
    schema:name "Frequently Asked Questions"@en ;
    schema:mainEntity :q1, :q2, :q3, :q4, :q5, :q6, :q7, :q8, :q9, :q10, :q11, :q12, :q13, :q14, :q15 .

:q1 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What problem does the watermark address?"@en ;
    schema:acceptedAnswer :a1 .
:a1 a schema:Answer ; schema:text "It aims to mitigate potential harms from large language models by embedding a detectable signal into generated text, so machine-generated content can be identified even though it is invisible to human readers."@en .

:q2 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "How does the watermark embed a signal into text?"@en ;
    schema:acceptedAnswer :a2 .
:a2 a schema:Answer ; schema:text "At each generation step it selects a randomized set of 'green' tokens before a word is generated and then softly promotes the use of green tokens during sampling."@en .

:q3 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What is a green list and a red list?"@en ;
    schema:acceptedAnswer :a3 .
:a3 a schema:Answer ; schema:text "The model vocabulary is partitioned at each position into a 'green' subset that is favored during sampling and a 'red' subset that is not, using a pseudorandom split."@en .

:q4 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "How is the green list selected for each token?"@en ;
    schema:acceptedAnswer :a4 .
:a4 a schema:Answer ; schema:text "The immediately preceding token is hashed with a secret key, and the resulting value seeds a pseudorandom permutation of the vocabulary that determines that position's green/red partition."@en .

:q5 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What role does the hash of the previous token play?"@en ;
    schema:acceptedAnswer :a5 .
:a5 a schema:Answer ; schema:text "It makes the green list unpredictable without the secret key while remaining exactly reproducible by anyone who holds that key, which is what allows detection without model access."@en .

:q6 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What is the hardness parameter delta and what does it control?"@en ;
    schema:acceptedAnswer :a6 .
:a6 a schema:Answer ; schema:text "Delta is a logit bias added to green-list tokens before sampling in the soft-watermark variant; larger delta strengthens the watermark signal at the cost of greater potential impact on text quality."@en .

:q7 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What is the difference between the hard and soft watermark variants?"@en ;
    schema:acceptedAnswer :a7 .
:a7 a schema:Answer ; schema:text "The hard variant restricts sampling to green-list tokens only, while the soft variant adds a logit bias to green-list tokens without forbidding red-list tokens, preserving quality at low-entropy positions."@en .

:q8 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "How is the watermark detected?"@en ;
    schema:acceptedAnswer :a8 .
:a8 a schema:Answer ; schema:text "A detector recomputes the green list at each position of a candidate text using the same hash function and secret key, then counts how many observed tokens fall in their position's green list."@en .

:q9 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What is the z-statistic test used for?"@en ;
    schema:acceptedAnswer :a9 .
:a9 a schema:Answer ; schema:text "It is a one-proportion statistical test comparing the observed count of green tokens against the count expected under the null hypothesis of no watermark, yielding an interpretable p-value."@en .

:q10 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "Does detecting the watermark require access to the LLM API or weights?"@en ;
    schema:acceptedAnswer :a10 .
:a10 a schema:Answer ; schema:text "No. Detection uses an efficient open-source algorithm and only requires the secret key and the candidate text, not access to the language model API or parameters."@en .

:q11 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What is spike entropy and why does it matter?"@en ;
    schema:acceptedAnswer :a11 .
:a11 a schema:Answer ; schema:text "Spike entropy is part of the paper's information-theoretic framework for analyzing watermark sensitivity; it captures how concentrated a token distribution is, which determines how strongly the watermark signal can be embedded at that position."@en .

:q12 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "What model was used to test the watermark?"@en ;
    schema:acceptedAnswer :a12 .
:a12 a schema:Answer ; schema:text "The authors tested the watermark using a multi-billion parameter model from Meta AI's Open Pretrained Transformer (OPT) family."@en .

:q13 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "How does the paper address robustness to text editing or paraphrasing attacks?"@en ;
    schema:acceptedAnswer :a13 .
:a13 a schema:Answer ; schema:text "The paper discusses robustness of the detection statistic under text modification and considers security scenarios where an adversary without the secret key attempts to remove or spoof the watermark."@en .

:q14 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "Is the watermark visible to human readers?"@en ;
    schema:acceptedAnswer :a14 .
:a14 a schema:Answer ; schema:text "No. The watermark is designed to be invisible to humans while remaining algorithmically detectable from a short span of tokens."@en .

:q15 a schema:Question ; schema:isPartOf :faqSection ;
    schema:name "Where can I find the reference implementation of the watermark?"@en ;
    schema:acceptedAnswer :a15 .
:a15 a schema:Answer ; schema:text "The authors published an open-source implementation of the embedding and detection algorithms at github.com/jwkirchenbauer/lm-watermarking."@en .

# ---------------------------------------------------------------------------
# Glossary
# ---------------------------------------------------------------------------

:glossarySection a schema:DefinedTermSet ;
    skos:prefLabel "Watermark-for-LLMs Glossary"@en ;
    schema:isPartOf :kgSummary ;
    schema:name "Glossary"@en ;
    schema:hasDefinedTerm :termWatermarking, :termGreenList, :termRedList, :termHashFunction,
        :termHardnessParameter, :termSoftWatermark, :termHardWatermark, :termZStatistic,
        :termPValue, :termSpikeEntropy, :termOPT, :termPerplexity .

:termWatermarking a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Watermarking"@en ;
    schema:description "Embedding a signal into generated text that is invisible to humans but algorithmically detectable from a short span of tokens."@en ;
    schema:inDefinedTermSet :glossarySection .

:termGreenList a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Green List"@en ;
    schema:description "The subset of the vocabulary favored for sampling at a given generation step under the watermarking scheme."@en ;
    schema:inDefinedTermSet :glossarySection .

:termRedList a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Red List"@en ;
    schema:description "The complementary subset of the vocabulary that is disfavored (hard variant) or not biased upward (soft variant) at a given generation step."@en ;
    schema:inDefinedTermSet :glossarySection .

:termHashFunction a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Previous-Token Hash Function"@en ;
    schema:description "A keyed hash of the immediately preceding token used to pseudorandomly seed the green/red partition at each position, reproducible by anyone holding the secret key."@en ;
    schema:inDefinedTermSet :glossarySection .

:termHardnessParameter a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Hardness Parameter (Delta)"@en ;
    schema:description "The logit bias added to green-list tokens in the soft watermark variant, controlling the strength of the watermark signal."@en ;
    schema:inDefinedTermSet :glossarySection .

:termSoftWatermark a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Soft Watermark"@en ;
    schema:description "A watermark variant that biases green-list token logits upward by delta rather than forbidding red-list tokens outright."@en ;
    schema:inDefinedTermSet :glossarySection .

:termHardWatermark a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Hard Watermark"@en ;
    schema:description "A watermark variant that restricts sampling to the green list only, forbidding red-list tokens entirely."@en ;
    schema:inDefinedTermSet :glossarySection .

:termZStatistic a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Z-Statistic"@en ;
    schema:description "A one-proportion statistical test comparing the observed green-token count in a candidate text against the count expected under the null hypothesis of no watermark."@en ;
    schema:inDefinedTermSet :glossarySection .

:termPValue a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "P-Value"@en ;
    schema:description "The interpretable probability value derived from the z-statistic, used to decide whether a text is watermarked."@en ;
    schema:inDefinedTermSet :glossarySection .

:termSpikeEntropy a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Spike Entropy"@en ;
    schema:description "A measure from the paper's information-theoretic framework capturing how concentrated a token probability distribution is, used to analyze watermark detectability."@en ;
    schema:inDefinedTermSet :glossarySection .

:termOPT a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Open Pretrained Transformer (OPT)"@en ;
    schema:description "A family of multi-billion parameter open-weight language models released by Meta AI, used in the paper's experiments."@en ;
    schema:inDefinedTermSet :glossarySection .

:termPerplexity a schema:DefinedTerm, skos:Concept ; schema:isPartOf :glossarySection ;
    schema:name "Perplexity"@en ;
    schema:description "A standard text-quality metric used in the paper to measure the impact of watermarking on generated-text fluency."@en ;
    schema:inDefinedTermSet :glossarySection .

# ---------------------------------------------------------------------------
# HowTo 1 — the paper's own embedding + detection algorithm
# ---------------------------------------------------------------------------

:howtoSection a schema:HowTo ;
    schema:isPartOf :kgSummary ;
    schema:name "How the Watermark Embedding and Detection Algorithm Works"@en ;
    schema:description "The general procedure the paper uses to embed and later detect the watermark in generated text."@en ;
    schema:step :step1, :step2, :step3, :step4, :step5, :step6, :step7, :step8 .

:step1 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 1 ;
    schema:name "Hash the previous token"@en ;
    schema:text "At each generation step, hash the immediately preceding token using a secret key."@en .
:step2 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 2 ;
    schema:name "Derive the green/red partition"@en ;
    schema:text "Use the hash value to seed a pseudorandom partition of the vocabulary into a green list and a red list for this position."@en .
:step3 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 3 ;
    schema:name "Bias or restrict the logits"@en ;
    schema:text "In the hard variant, restrict sampling to green-list tokens only; in the soft variant, add the hardness parameter delta to green-list token logits."@en .
:step4 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 4 ;
    schema:name "Sample the next token"@en ;
    schema:text "Apply softmax to the adjusted logits and sample the next token from the resulting distribution."@en .
:step5 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 5 ;
    schema:name "Repeat for the full sequence"@en ;
    schema:text "Repeat the hash, partition, bias, and sample steps for each subsequent token to embed the watermark across the generated text."@en .
:step6 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 6 ;
    schema:name "Recompute green lists for detection"@en ;
    schema:text "Given a candidate text, recompute the green list at each position using the same hash function and secret key."@en .
:step7 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 7 ;
    schema:name "Count green tokens and compute the z-statistic"@en ;
    schema:text "Count how many observed tokens fall in their position's green list and compute the one-proportion z-statistic against the null hypothesis of no watermark."@en .
:step8 a schema:HowToStep ; schema:isPartOf :howtoSection ; schema:position 8 ;
    schema:name "Decide watermark presence from the p-value"@en ;
    schema:text "Compare the resulting p-value against a chosen significance threshold to decide whether the text is watermarked."@en .

# ---------------------------------------------------------------------------
# HowTo 2 — additional simple worked example (as requested)
# ---------------------------------------------------------------------------

:simpleExampleSection a schema:HowTo ;
    schema:isPartOf :kgSummary ;
    schema:name "A Simple Worked Example of Green-List/Red-List Token Selection"@en ;
    schema:description "A concrete, illustrative numeric walkthrough of one embedding step and one detection step of the hash-seeded green-list watermarking scheme, for readers new to the method."@en ;
    schema:about :greenListHashWatermark, :softWatermark ;
    schema:step :sestep1, :sestep2, :sestep3, :sestep4, :sestep5, :sestep6, :sestep7, :sestep8, :sestep9, :sestep10 .

:sestep1 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 1 ;
    schema:name "Start with a previous token"@en ;
    schema:text "Suppose the text generated so far ends in the token 'the', and the model is about to generate the next token."@en .
:sestep2 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 2 ;
    schema:name "Hash the previous token with the secret key"@en ;
    schema:text "Compute hash(secret_key, token_id_of('the')) to produce an integer seed value, for example seed = 738291."@en .
:sestep3 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 3 ;
    schema:name "Seed a pseudorandom vocabulary partition"@en ;
    schema:text "Use the seed to initialize a pseudorandom number generator and pseudorandomly split the full vocabulary into a green fraction gamma (for example gamma = 0.5) and the remaining red fraction."@en .
:sestep4 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 4 ;
    schema:name "Compute the model's raw logits"@en ;
    schema:text "The language model computes a raw logit score for every token in the vocabulary as the candidate next token, for example logit('cat') = 3.1 and logit('dog') = 3.4, with 'cat' in the green list and 'dog' in the red list."@en .
:sestep5 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 5 ;
    schema:name "Add the hardness bias to green-list logits"@en ;
    schema:text "Add the hardness parameter delta (for example delta = 2.0) to the logits of every green-list token only: new logit('cat') = 3.1 + 2.0 = 5.1, while logit('dog') remains 3.4."@en .
:sestep6 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 6 ;
    schema:name "Apply softmax and sample"@en ;
    schema:text "Convert the biased logits into a probability distribution with softmax and sample the next token; 'cat' (green, biased) is now more likely to be chosen than 'dog' (red, unbiased) even though 'dog' had the higher raw logit."@en .
:sestep7 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 7 ;
    schema:name "Advance to the next position"@en ;
    schema:text "With 'cat' now the previous token, repeat steps 2 through 6 using hash(secret_key, token_id_of('cat')) to derive a fresh green/red partition for the following token."@en .
:sestep8 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 8 ;
    schema:name "Collect the full watermarked text"@en ;
    schema:text "Continue this process token by token until generation stops, producing a complete passage of text 'the cat ...' whose token choices are subtly but consistently biased toward each position's green list."@en .
:sestep9 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 9 ;
    schema:name "Recompute green lists to detect the watermark"@en ;
    schema:text "Given the text and the same secret key, walk through it token by token, recomputing each position's green list from the hash of the token immediately before it, and count how many tokens landed in their own position's green list (here, 'cat' after 'the')."@en .
:sestep10 a schema:HowToStep ; schema:isPartOf :simpleExampleSection ; schema:position 10 ;
    schema:name "Compute z and decide"@en ;
    schema:text "Compute z = (observed_green_count - gamma * total_tokens) / sqrt(total_tokens * gamma * (1 - gamma)); a large z (for example z > 4) yields a very small p-value and indicates the text is watermarked."@en .
