Lune

ICLR2026Top-tier venue

In-Context Watermarks for Large Language Models

Yepeng Liu, Xuandong Zhao, Christopher Kruegel, Dawn Song, Yuheng Bu

Abstract

The growing use of large language models (LLMs) for sensitive applications has highlighted the need for effective watermarking techniques to ensure the provenance and accountability of AI-generated text. However, most existing watermarking methods require access to the decoding process, limiting their applicability in real-world settings. One illustrative example is the use of LLMs by dishonest reviewers in the context of academic peer review, where conference organizers have no access to the model used but still need to detect AI-generated reviews. Motivated by this gap, we introduce In-Context Watermarking (ICW), which embeds watermarks into generated text solely through prompt engineering, leveraging LLMs' in-context learning and instruction-following abilities. We investigate four ICW strategies at different levels of granularity, each paired with a tailored detection method. We further examine the Indirect Prompt Injection (IPI) setting as a specific case study, in which watermarking is covertly triggered by modifying input documents such as academic manuscripts. Our experiments validate the feasibility of ICW as a model-agnostic, practical watermarking approach. Moreover, our findings suggest that as LLMs become more capable, ICW offers a promising direction for scalable and accessible content attribution. Our code is available at https://github.com/yepengliu/In-Context-Watermarks.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A Survey on In-context Learning cites Language Models are Few-Shot Learners
  • DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature cites Language Models are Few-Shot Learners
  • DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature cites A Watermark for Large Language Models
  • Theoretically Grounded Framework for LLM Watermarking: A Distribution-Adaptive Approach cites Provable Robust Watermarking for AI-Generated Text
  • Theoretically Grounded Framework for LLM Watermarking: A Distribution-Adaptive Approach cites Language Models are Few-Shot Learners
  • Theoretically Grounded Framework for LLM Watermarking: A Distribution-Adaptive Approach cites A Watermark for Large Language Models
  • Provable Robust Watermarking for AI-Generated Text cites DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
  • Provable Robust Watermarking for AI-Generated Text cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Theoretically Grounded Framework for LLM Watermarking: A Distribution-Adaptive ApproachHaiyun He, Yepeng Liu, Ziqiao Wang, Yongyi Mao et al.NeurIPS 2025 · 26 citations

Builds on32

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability CurvatureEric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D. Manning et al.ICML 2023 · 988 citations
  3. A Watermark for Large Language ModelsJohn Kirchenbauer, Jonas Geiping, Yuxin Wen, Jonathan Katz et al.ICML 2023 · 854 citations
  4. A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng et al.EMNLP 2024 · 479 citations
  5. Provable Robust Watermarking for AI-Generated TextXuandong Zhao, Prabhanjan Vijendra Ananth, Lei Li, Yu-Xiang WangICLR 2024 · 312 citations

Related papers

  1. Position: LLM Watermarking Should Align Stakeholders' Incentives for Practical AdoptionYepeng Liu, Xuandong Zhao, Dawn Song, Gregory W. Wornell et al.ACL Findings 2026
  2. IACW: Intent-Aware Controllable Watermarking for Scalable Authorial Intent AttributionHao Huang, Ruihua Zhou, JiaTang Luo, Yunpeng Li et al.ICML 2026
  3. Adaptive Text Watermark for Large Language ModelsYepeng Liu, Yuheng BuICML 2024 · 63 citations
  4. StealthInk: A Multi-bit and Stealthy Watermark for Large Language ModelsYa Jiang, Chuxiong Wu, Massieh Kordi Boroujeny, Brian L. Mark et al.ICML 2025
  5. WASA: WAtermark-based Source Attribution for Large Language Model-Generated DataXinyang Lu, Jingtan Wang, Zitong Zhao, Zhongxiang Dai et al.ACL Findings 2025
Dusk over the sea between two cliffs drawn in fine vertical lines