Manuscript Offprint

arXiv:2608.29030

Learning to Follow In-Context Watermark Instructions via Self-Distillation

Yepeng Liu, Tianyi Chen, Xuandong Zhao, Dawn Song, Yuheng Bu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

In-context watermarking (ICW) prepends an instruction to a query asking the model to embed a statistically detectable signal in its response. It thus equips LLMs with a watermarking interface that third parties can invoke without access to model internals. Its reliability hinges on the LLM following the instruction without degrading answer quality, yet how well current LLMs do so has not been measured. We introduce ICWBench, a benchmark of three verifiable ICW instruction families, each scored on both detectability and answer quality. Evaluating 14 frontier proprietary and open-source LLMs, we find that none of the evaluated LLMs achieves both objectives across all three families. To address this, we propose a self-contained two-stage training method, requiring no distillation from a stronger model, no manual annotation, and no pre-existing ICW IF ability. The first stage, self-distillation with logits perturbation (SDLP), uses the same base LLM as both teacher and student: an instruction-equivalent decoding-time logits perturbation makes the teacher follow the ICW instruction, and the student is trained to match the teacher's output distribution. The second stage applies reinforcement learning with the automatic verifier as the reward. Applied to Qwen3-14B and GPT-OSS-20B, our method raises average TPR@1%FPR across three ICW instructions from 0.100 to 0.974 and from 0.337 to 0.968, respectively, while maintaining high response quality under both perplexity evaluation and LLM-as-a-Judge. Our code is available at https://github.com/yepengliu/ICW-IF.

Figure

Figure 1: TPR@1%FPR versus perplexity of 14 evaluated frontier proprietary and open-source LLMs on ICWBench. Each point represents a model's average performance across three ICW instruction families. Our method raises the average TPR@1%FPR of Qwen3-14B from 0.100 to 0.974 and of GPT-OSS-20B from 0.337 to 0.968 while maintaining low perplexity, achieving a more favorable trade-off than all the frontier proprietary LLMs we evaluate.

*These authors contributed equally to this work.

†Correspondence to: yepengliu@ucsb.edu

1 Introduction

The instruction-following (IF) capability of large language models (LLMs) has been studied primarily as a lever for controllability [1–3], powering applications such as formatted generation [4, 5] and tool-using agents [6–9]. We study a different use of this capability: watermarking via instruction. Concretely, an in-context watermark (ICW) instruction [10] asks the model to produce an answer that carries a statistically detectable signal.

Watermarking is an important and reliable tool for detecting AI misuse. Most existing LLM watermarking techniques are designed for model owners and require access to the internal sampling process, which is not available to the general public [11–20]. However, most LLM providers do not publicly disclose the use of watermarks due to different concerns [21]. This makes AI misuse detection difficult for the general public or third-party stakeholders. To address this problem, Liu et al. [10] proposes the concept of ICWs and studies their application to detecting AI-generated reviews for academic conferences by injecting the ICW instruction into the manuscript submissions. Moreover, ICML 2026 adopts a similar ICW-based detection for identifying AI-generated reviews [22, 23], where 795 reviews (~ 1% of all reviews) are detected as AI-generated.

The reliability of ICW rests on the LLM's ability to follow the embedded instruction, yet how well current LLMs do so, and at what cost to answer quality, has not been measured. We address this gap with ICWBench, a benchmark of three verifiable ICW instruction families (Table 1): Token-Set Preference (TSP), Word-Initial Preference (WIP), and Sentence Acrostic (SA). Each family is designed to be general across queries, automatically verifiable, quality-preserving, and robust to editing. Unlike prior IF benchmarks [1] that score obedience alone, ICWBench scores both whether the response follows the instruction (carries the watermark signal) and whether it remains a high-quality answer to the query. We evaluate 14 frontier proprietary and open-source LLMs on ICWBench, including GPT-5.4 [24], Gemini-3-pro [25], Claude-opus-4.5 [26], and DeepSeek-v4-pro [27]. We observe two contrasting failure modes: under-following, where no evaluated model exceeds 0.66 AUC on TSP, and over-following, where strong watermark detectability comes at a substantial cost to output quality. For example, Gemini-3-pro reaches 1.000 AUC on WIP, while perplexity rises from 4.33 to 67.61.

Improving ICW IF capability presents a bootstrapping challenge: the models that need training are precisely those that cannot reliably produce instruction-compliant responses in the first place. Although the automatic verifier makes reinforcement learning with verifiable rewards (RLVR) a natural training framework, effective RLVR requires an initial policy that can already generate sufficiently high-reward rollouts, which weak ICW IF models may fail to provide. Obtaining such a cold start is itself non-trivial. Direct sampling from the base model yields few instruction-compliant responses, manual annotation is costly and difficult to scale, and distillation from stronger LLMs is unreliable because even frontier models exhibit limited ICW IF ability. Moreover, ICW compliance is inherently distributional: the watermark signal is encoded through aggregate token statistics rather than a particular target sequence. Consequently, even given compliant responses, standard supervised fine-tuning (SFT) discards the distribution-level structure that carries the ICW signal. This raises a central question:

How can we bootstrap reliable ICW IF capability in an LLM with weak initial ICW IF ability, without relying on stronger teacher models or human supervision?

In this paper, we propose a general self-contained method that runs on the base LLM alone: no distillation from a stronger model, no manual annotation, no strong pre-existing ICW IF ability required. Our intuition is to convert ICW IF into an instruction-equivalent decoding-time logit perturbation on the base LLM. It resolves both cold-start training problems: (1) it provides a method to synthesize instruction-compliant data from the base LLM itself, and (2) it provides a distribution-level supervision signal that is not available in SFT. Specifically, we propose a two-stage training method. Stage one, self-distillation with logits perturbation (SDLP), pairs a frozen teacher with a trainable student, both copies of the base LLM. The teacher receives only the query and produces an instruction-aligned distribution via logit perturbation; the student receives both the ICW instruction and the query without any perturbation, and is trained to match the teacher's distribution. Stage two applies GRPO [28] with the automated verifier as the reward. Applied to two open-source LLMs, Qwen3-14B and GPT-OSS-20B, our method raises their average TPR@1%FPR across the three ICW instruction families from 0.100 to 0.974 and from 0.337 to 0.968, respectively, and achieves a more favorable IF-quality trade-off than the frontier LLMs we evaluate.

We summarize our contributions as follows:

  • We evaluate 14 frontier proprietary and open-source LLMs on ICWBench and identify the trade-off of frontier LLMs between following ICW instructions and preserving generation quality.

  • We propose a self-contained two-stage training method to improve LLMs' ability to follow ICW instructions while maintaining generation quality, without external supervision (stronger teacher model, human annotation, pre-existing capability).

  • We validate our method on two open-source LLMs with weak initial ICW IF ability, Qwen3-14B and GPT-OSS-20B. Our trained models achieve average TPR@1%FPR of 0.974 and 0.968, respectively, across the three instruction families while maintaining high response quality, resulting in a more favorable ICW IF-quality trade-off than the frontier LLMs we evaluate.

References (68)