Manuscript Offprint

arXiv:2608.27899

OpenStamp: A Watermark for Open-Source Language Models

Miroojin Bakshi, Saksham Rastogi, Danish Pruthi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

With the growing prevalence of large language model (LLM) generated content, watermarking is considered a promising approach for attributing text to LLMs and distinguishing it from human-written content. A prominent class of techniques embeds subtle but detectable signals in generated text by modifying token sampling probabilities. However, such methods are unsuitable for open-source models, where users have white-box access and can easily disable watermarking during inference. In this work, we introduce OpenStamp, a watermarking technique that encodes the watermarking logic directly into the model weights by modifying only the final projection, or unembedding, layer. Through experiments across two models, we show that OpenStamp achieves superior detection performance, with minimal degradation in model capabilities compared to prior methods. The implanted watermark is explicitly designed, and empirically confirmed, to be more robust to paraphrasing attacks and harder to scrub off through post-hoc fine-tuning than prior open-source watermarks. To enable developers to watermark their models, we release our code alongside watermarked versions of 4 popular open-source models.

https://github.com/mb-14/openstamp

1 Introduction

Large language models (LLMs) are capable of generating human-like text, which has led to their widespread adoption in various applications (Brown et al., 2020; Chowdhery et al., 2022). As these models become more prevalent, there are looming concerns about potential misuse, such as generating large-scale misinformation (Oviedo-Trespalacios et al., 2023), influencing public opinion (Panditharatne & Giansiracusa, 2023), or orchestrating social engineering attacks (Grbic & Dujlovic, 2023). To address these concerns, it is critical to develop methods for distinguishing LLM-generated content from human-written text. Such methods can also be used to attribute the content to its source model, thereby promoting transparency and accountability in LLM use, especially for high-stakes applications.

A promising way to detect model-generated content is to watermark the text by embedding subtle, imperceptible signals into the model's outputs. To implant such signals, several prominent watermarking techniques either modify the next-token probabilities (Kirchenbauer et al., 2023; Liu & Bu, 2024) or constrain the sampling process during generation (Aaronson, 2023; Kuditipudi et al., 2024; Dathathri et al., 2024). While effective, these decoding-based techniques are incompatible with requirements of open sourcing, where users have full control over the generation process and can easily disable the watermarking logic. This motivates the need for techniques that embed watermarking signals directly into the weights of the model, making the watermark harder to erase.

Few recent works explore watermarking approaches for open-sourced LLMs. A notable approach proposes to distill a student model using the outputs of the watermarked teacher model (Gu et al., 2024). However, this method typically requires considerable amounts of training data and computational resources. Christ et al. (2024) instead add Gaussian noise

*Work done at the Indian Institute of Science

Figure

Figure 1: Overview of OpenStamp, our watermarking method. We add an offset matrix ΔW\Delta W to the unembedding layer's weights U to produce watermark logits that bias token sampling, favoring tokens with higher watermark logit values. The watermark can be detected using a log-likelihood ratio (LLR) based score which measures how much more likely the observed tokens are under the watermarked model compared to the unwatermarked model.

to the final layer’s bias vector to steer generation toward a fixed, context-independent set of tokens. This makes the scheme analogous to a fixed green list, which can be reverse-engineered and rendered ineffective (Jovanović et al., 2024; Rastogi & Pruthi, 2024). Another concern is robustness to paraphrasing attacks (Krishna et al., 2023), where an adversary rephrases the generated text to dilute, or remove, the watermarking signal. While some efforts have focused on improving robustness to paraphrasing (Liu et al., 2024; Hou et al., 2024a), none of these schemes work for open-source models.

In this work, we introduce OpenStamp, an approach to watermarking open-source LLMs by modifying the unembedding layer weights of the model. We add a carefully designed offset to these weights, which bias the logits before generation and thereby implant signals in the generated text. OpenStamp is conceptually similar to prior logit-based watermarking approaches (Kirchenbauer et al., 2023; Liu et al., 2024; Liu & Bu, 2024), which influence token selection by adding small, context-dependent biases to the logits at each decoding step. However, an important distinction is that we embed the biasing logic directly into the unembedding layer's weights. Moreover, the offset is designed to produce consistent biases across semantically similar contexts, ensuring robustness against paraphrasing attacks. While conceptually similar to semantic watermarks (Hou et al., 2024b;a; Liu et al., 2024), OpenStamp requires no auxiliary embedding model at generation or detection time, since this semantic robustness is baked into the model weights. Figure 1 shows a high-level overview of our watermarking method. To detect watermarked text, we compute a length normalized log-likelihood ratio (LLR) score, which measures how much more likely the observed tokens are under the watermarked model compared to the unwatermarked model.

OpenStamp achieves near-perfect detection (TPR ≥ 99% at 1% FPR) with only minimal degradation in text quality, outperforming other open-source watermarking methods at comparable perplexity levels. Our watermarking method approaches the Pareto frontier defined by prominent decoding-based techniques. Furthermore, our watermarking signal is more difficult to erase via fine-tuning and offers improved robustness to paraphrasing attacks compared to existing approaches. We believe that these strengths make our approach a strong candidate for watermarking open-source models. To encourage model developers to watermark their models prior to release and to foster the development of new watermarking techniques for open-source models, we publicly release our code and watermarked versions of four popular open-source models created using OpenStamp.

References (89)