Source Attribution for Large Language Model-Generated Data

## Abstract

Abstract The impressive performances of large language models (LLMs) and their immense potential for commercialization have given rise to serious concerns over the intellectual property (IP) of their training data. In particular, the synthetic texts generated by LLMs may infringe the IP of the data being used to train the LLMs. To this end, it is imperative to be able to perform source attribution by identifying the data provider who contributed to the generation of a synthetic text by an LLM. In this paper, we show that this problem can be tackled by watermarking, i.e., by enabling an LLM to generate synthetic texts with embedded watermarks that contain information about their source(s). We identify the key properties of such watermarking frameworks (e.g., source attribution accuracy, robustness against adversaries), and propose a source attribution framework that satisfies these key properties due to our algorithmic designs. Our framework enables an LLM to learn an accurate mapping from the generated texts to data providers, which sets the foundation for effective source attribution. Extensive empirical evaluations show that our framework achieves effective source attribution.

## 1 Introduction

*Large language models* (LLMs) (Ouyang et al., ; Touvron et al., ) have recently demonstrated remarkable performances and hence received a surging interest.
These LLMs, trained using massive text data, have displayed impressive text generation abilities.
This has given rise to the immense potential of adopting LLM-generated texts for commercial use.
However, this potential commercialization has led to major concerns regarding the *intellectual property* (IP) of training data for LLMs because the texts generated by an LLM may infringe the IP of the data being used to train the LLM.
These concerns have been reflected by the increasing regulations on
data protection related to AI models.
For example, the Coalition for Content Provenance and Authenticity has stressed the necessity of certifying the *source* of online content produced by generative models (Rosenthol, ).
Therefore, it is of crucial importance for LLMs to be equipped with source attribution
for their generated synthetic texts.

In source attribution, given some texts generated by an LLM, its aim is to find the source responsible for the generation of these texts.
That is, if the data from a data provider has been used to train the LLM and contributed to the generation of a sentence by the LLM,
then source attribution
identifies this data provider.
Moreover, source attribution also improves the interpretability of LLM-generated texts: for example, if the generated content from an LLM is attributed to a trustworthy source (e.g., a peer-reviewed academic paper), then the user
is likely to consider the content more reliable.
The ability to perform source attribution can endow the LLM with the capability of data provenance, which presents a different problem where a data provider can verify whether its data has been used to train the LLM. This problem can be solved with source attribution.
Specifically, a data provider can check the source of the generated texts from an LLM via source attribution, and hence verify data provenance,
as detailed in App. F.1.6.

Figure: Figure 1: Illustration of WASA’s problem setting. Watermarks are embedded into the texts from data providers for training the LLM. The LLM produced by our WASA framework can generate synthetic texts with embedded watermarks that allow for effective source attribution.
Refer to caption: x1.png

While some recent works have addressed the problem of data provenance in LLMs (Kirchenbauer et al., ; Liu et al., ), to the best of our knowledge, effective source attribution for LLMs remains an open problem. In contrast to data provenance which presents a binary determination, source attribution aims to identify the specific data source(s) influencing a particular output, which presents a more challenging task. Our work focuses on addressing source attribution rather than on data provenance.
Additionally, although some works in Computer Vision (CV) have tackled the problem of source attribution (Marra et al., ; Yu et al., ; ), the techniques in CV cannot be directly applied to solve source attribution in LLMs due to the fundamental difference between CV and LLMs in the input and output spaces: the inputs are perceived continuously in CV, hence minor alterations are nearly imperceptible; however, the inputs to LLMs are discrete where minor changes can be easily detected and can significantly alter the semantic integrity.

To perform source attribution
for LLM-generated texts, a natural solution involves *watermarking*, i.e., by enabling the LLM to generate synthetic texts with embedded watermarks that contain information about their source(s). Consequently, source attribution can be performed by examining the watermarks embedded in the generated texts.
Our problem setting (Fig. 1)
involves $3$ parties: *data providers* contributing text data that may be used for LLM training, an honest third-party *LLM platform operator* producing an LLM with generated
texts that embed watermarks (hence allowing for source attribution),
and *users* of the
texts generated by this LLM.
The users may request source attribution for the LLM-generated synthetic texts to find out which data provider is responsible for the generated texts.
We consider scenarios where each data provider contributes ample balanced data with unique characteristics, i.e., the data from different data providers exhibit dissimilarities.
This encompasses a wide variety of real-world scenarios: For example,
online articles
written by different authors (i.e., data providers) usually feature their unique writing styles.
On the other hand, we do not consider individual documents/sentences as data providers since they have insufficient data. Additionally, this work focuses on single-source scenarios, where the generated content can be attributed to a single data provider.

An effective source attribution framework has to satisfy some key properties:
The framework should
(1) achieve accurate source attribution,
(2) be robust against malicious attacks
on the watermarks,
(3) preserve the performance (i.e., text generation ability) of the LLM,
(4) be scalable to a large number of data providers,
(5) ensure that the generated watermarks are transferable to (i.e., persist after being used as training data for) other LLMs,
and
(6) be adaptable to fit different LLMs.
Sec. 2 discusses these key properties in more detail.
To this end, this paper introduces a *WAtermarking for Source Attribution* (WASA) framework which, to our best knowledge, is the first framework capable of enabling effective source attribution in text generated by large language models
Our WASA framework
assigns a unique watermark (i.e., imperceptible to human eyes) to every data provider, and enables an LLM (coined as WASA-LLM) to learn an accurate mapping from the texts of different data providers to their corresponding watermarks (Sec. 3).
So, if a data provider is responsible for generating
a sentence, then our WASA-LLM is able to include the unique watermark of this data provider in this generated sentence, which naturally supports source attribution.
Our contributions are summarized below:

- •
We propose to use watermarking for source attribution
on LLM-generated synthetic texts and identify the key properties of such source attribution frameworks.
- •
We introduce the WASA framework which satisfies these key properties and is hence capable of producing LLMs whose generated texts allow for effective source attribution.
- •
We perform extensive empirical evaluations (Sec. 4) to verify that our WASA framework satisfies these key properties and achieves effective source attribution.

## 2 Key Properties of Watermarking for Source Attribution

Here, we first present a clear definition of source attribution.
For a piece of LLM-generated synthetic text $s$, if $s$ correlates the most with the LLM’s training data provided by one data provider compared to other providers, we recognize that data provider as the source for $s$ and denote as a one-hot label $y_{s}:=\{0,0,...,1,...,0\}$ where $y_{s}[i]=1$ if $y_{s}[i]$ is the source, otherwise $y_{s}[i]=0$; the dimension is $n$, which is the total number of data providers and is fixed.
The goal of source attribution is: given a piece of LLM-generated text $s$, we want to find a mapping $s\rightarrow y_{s}$ that attributes $s$ to its source $y_{s}$.

To simplify the problem, we discuss the following scenarios:
(1) While $x$ may correlate with multiple training data from provides, meaning that $y$ may not necessarily be a one-hot vector, we only consider attribution to a single data source (that $x$ correlates the most with), restricting the $y$ to be one-hot vector in our case, and present case studies when attributing to more than one data source in App. H.3;
(2) There might be an edge case where the generated content $x$ correlates the most with pretraining data (from public training datasets) rather than data from data providers. We do not consider this case in our paper and ensure that in our evaluations the generated contents are related to the data from providers by carefully designing controlled experiments.

In this paper, we would like to address the problem of source attribution with watermarking.
Specifically, to use watermarking for source attribution, we first transform the data providers $y$ to watermarks $wtm$ correspondingly: $\text{encoder}(y)=wtm$ where encoder denotes the watermark encoder. During LLM training, we aim to allow the LLM to learn a mapping $g:s\rightarrow wtm$ to generate watermarks along with synthetic texts. Then during inference, we can perform the mapping $s\rightarrow y_{s}$ by $y_{s}=\text{decoder}(g(s))$ where $\text{decoder}(wtm)=y$ is the watermark decoder function, translating the watermark to sources for the user.
Importantly, since each generated content $s$ must correlate with some pieces of training data, there always exists a source $y_{s}$ which is the most correlated data source with $s$. Hence, under all conditions (except the special case mentioned above), as long as a user requests, $s$ should be attributed to its source $y_{s}$. In our WASA framework, since we assume that all data providers provide watermarked training data, we can perform source attribution under all conditions: Upon request, we can perform $y_{s}=\text{decoder}(g(s))$ and map the generated watermark to the corresponding data provider $y_{s}$.

Subsequently, we discuss the key properties for an effective watermarking
source attribution framework
and how our WASA framework satisfies them.

Accuracy.
Accurate source attribution should be enforced.
Our WASA framework achieves this by training the WASA-LLM to map texts from different data providers to their respective watermarks.
Specifically, we first train WASA-LLM  using watermarked texts (Sec. 3.1) and separate the prediction/generation spaces for the texts and watermarks to both *reduce the complexity of watermark prediction* (Sec. 3.2) and *explicitly enforce watermark generation* (Sec. 3.3). Empirical results in Sec. 4.1 demonstrate the effectiveness in source attribution.

Robustness.
Generated text with watermarks should be robust against
malicious attacks.
Since our trained WASA-LLM is able to learn an accurate mapping from the texts to the watermarks as mentioned
(a) it can be exploited
to *regenerate* the watermarks even if generated texts are tampered with
and (b) it maintains generating the correct watermarks even if the input texts (prompts) are perturbed, which are empirically verified in Sec. 4.2.

Scalability. The framework should cater to a large number of data providers. The design of the watermark (Sec. 3.1) facilitates the generation of numerous unique watermarks and the scalability can be empirically verified in Sec. 4.3.

Performance Preservation.
The introduction of watermarks should (a) not significantly degrade the text generation ability of the LLM (b) nor affect
the readability of the LLM-generated synthetic texts too much.
We empirically show in Sec. 4.4 that our WASA-LLM preserves (a), and
the watermarks are carefully designed
to achieve (b) (see App. H.1).

Transferability. After the generated watermarked
texts are used as training data for other LLMs, their generated texts should preserve the watermarks.
We achieve this by ensuring that the watermarked training data of our WASA-LLM has the same structure as the generated watermarked data.

Adaptability. The framework should be easily adapted to fit different LLMs.
Our WASA framework
only requires mild modifications to the LLMs and can hence adopt a wide variety of LLMs using the transformer architecture, as shown in Sec. 4.1.

We have only listed above the most essential properties of such source attribution frameworks; there may be additional considerations depending on specific applications.
In Sec. 3, we will discuss in more detail how our WASA framework satisfies these key properties due to our algorithmic designs.

Figure: Figure 2: Sentences embedded (the first one) and not embedded (the second one) with our imperceptible watermark visualized in the bottom sentence.
Refer to caption: x2.png

## 3 Watermarking for Source Attribution ( WASA ) Framework

Sec. 3.1 discusses watermark design and embedding process. Sec. 3.2 details the training of WASA-LLM  with watermarked texts and its alignment with key properties. Sec. 3.3 explains how our trained WASA-LLM  produces synthetic texts with watermarks for source attribution.

### 3.1 Embedding Watermarks into Texts

Firstly,
the LLM platform operator
embeds a unique watermark for each data provider’s texts.

Design of Watermarks.
We construct the watermarks using Unicode characters which are imperceptible to human eyes (yet can be decoded by machine learning models).
Some of these invisible characters have also been adopted in other studies with language models (Boucher et al., ).
Every watermark is made up of $10$ characters, each of which is chosen among the following $6$ Unicode characters:
U+200B, U+200C, U+200D, U+2062, U+2063, U+2064.
We chose these
characters because they are found to be invisible on many commonly used platforms.
So, these watermarks
preserve the semantic meaning of the
original
texts to human readers
(Fig. 2).
Also, our WASA framework can easily adopt other choices of characters depending on the
use cases.
Moreover, these $10$-character watermarks allow us to construct
numerous
combinations and hence achieve scalability to a large number of data providers.
As shown in App. G.9, reducing the watermark length trades off scalability for source attribution accuracy.

Embedding Watermarks into Sentences.
To enable our WASA-LLM to learn the mapping from the texts of different data providers to their watermarks,
it is important to only embed watermarks into the sentences that are *representative of the unique characteristics of the data providers*.
To this end, we calculate the *term frequency-inverse document frequency* (TF-IDF) scores of all sentences from a data provider and select the sentences with the top $20\%$ of the TF-IDF scores (i.e., most representative sentences)
for watermarking, which empirically yields the best trade-off of source attribution accuracy vs. text generation performance among different tested proportions, as reported in
App. G.7.
For every selected sentence, we embed our $10$-character watermark at a random position in the sentence, which allows the LLM to learn to map texts of different lengths to the watermarks and also makes it harder for an adversary to remove/modify the watermarks.
As empirically verified in App. G.2, our method of selecting sentences for watermarking based on TF-IDF indeed leads to more accurate source attribution than random selection.

### 3.2 Training WASA -LLM

We consider a practical scenario where the LLM is already pre-trained before being used by WASA framework, and we refer to our training of the LLM
as *second-stage pre-training*.
Our framework can also be used to train an LLM from scratch.

Preliminaries on LLMs.
Denote an unsupervised corpus by $\bm{D}$, in which every sequence $s_{i}=[u_{1},u_{2},\ldots,u_{k}]$ is with a block of $k$ tokens. We focus on decoder-only language models (e.g., GPT (Radford et al., ), OPT (Zhang et al., ), Llama2 (Touvron et al., )). When presented with a sub-sequence $s=s_{i}[1:j-1]=[u_{1},\ldots,u_{j-1}]$, the LLM predicts $P(u_{j})$ using feed-forward operations, as detailed below:

$$ $\displaystyle h_{0}$ $\displaystyle=s\cdot W_{e}+W_{p}\ ,$ (1) $\displaystyle h_{\tau}$ $\displaystyle=\text{decoder}(h_{\tau-1})\ \ \text{for}\ \ \tau=1,\ldots,l\ ,$ $\displaystyle z$ $\displaystyle=h_{l}[j-1]\cdot{W_{e}}^{\top},$ $\displaystyle P(u_{j})$ $\displaystyle=\text{softmax}(z)\ .\vspace{-2.2mm}$ $$

$W_{e}$ represents the embedding matrix with a dimension of vocabulary size $V$ by embedding/hidden dimension $E$, and $W_{p}$ is the positional encoding.
The training objective is to maximize the log-likelihood $L(s_{i})$ of a sequence $s_{i}$ of tokens:

$$ $\displaystyle L(s_{i})$ $\displaystyle={\textstyle\sum}_{j=2}^{k}\log P(u_{j}|u_{1},\ldots,u_{j-1})\$ (2) $$

where
$P(u_{j}|u_{1},\ldots,u_{j-1})$ (i.e., similar to $P(u_{j})$ in equation 1) is the
probability of $j$-th token $u_{j}$ conditioned on the preceding $j-1$ tokens $[u_{1},\ldots,u_{j-1}]$.

Figure: Figure 3: Separation of token embeddings and prediction spaces for texts and watermarks.
Refer to caption: x4.png

Forward Pass.
To ease exposition,
we consider one watermark in a block.
Denote a sequence with an embedded watermark by $s^{\prime}_{i}=[u_{1},u_{2},\ldots,u_{t},w_{1},w_{2},\ldots,w_{m},u_{t+1},
\ldots,u_{k-m}]$ where $m=10$ for $10$-character watermark and the $u$’s and $w$’s are the word and watermark tokens, respectively.
Hereafter, we will use $t$ to denote the
token index before the first watermark token.

To begin with, we augment the original vocabulary by our $V^{\prime}=6$ watermark characters (Sec. 3.1),
leading to
our modified token embedding matrix $W^{\prime}_{e}$ is $(V+V^{\prime})\times E$ (Fig. 3).
For a sequence $s^{\prime}_{i}$, given a sub-sequence $s^{\prime}=s^{\prime}_{i}[1:j-1]$ comprising the first $j-1$ tokens,
the same feed-forward operations in equation 1 are applied
to produce
$h_{l}$.
Next, depending on whether the ground-truth $j$-th token
being predicted
is a word token $u$ or watermark token $w$, we adopt *two separate prediction spaces* (i.e., separate softmax layers):
For a *word token* $u$, $(W^{\prime}_{e}[1:V])^{\top}$ forms the linear layer:

$$ $\displaystyle z_{u}$ $\displaystyle=h_{l}[j-1]\cdot(W^{\prime}_{e}[1:V])^{\top},$ (3) $\displaystyle P_{u}(u)$ $\displaystyle=\text{softmax}(z_{u})\ .$ $$

For a *watermark token* $w$, $(W^{\prime}_{e}[V+1:V+V^{\prime}])^{\top}$ forms the linear layer:

$$ $\displaystyle z_{w}$ $\displaystyle=h_{l}[j-1]\cdot(W^{\prime}_{e}[V+1:V+V^{\prime}])^{\top},$ (4) $\displaystyle P_{w}(w)$ $\displaystyle=\text{softmax}(z_{w})\ .$ $$

This separation of the prediction/generation spaces of the word tokens equation 3 and watermark tokens equation 4 allows
us to use *a small number of additional parameters* (i.e., $E\times V^{\prime}$ instead of $E\times(V+V^{\prime})$) for watermark prediction based on the hidden states of WASA-LLM.
Moreover, this separation allows us to explicitly enforce the generation of watermarks (i.e., using its designated generation space) when we use the trained WASA-LLM to generate synthetic texts, as discussed in Sec. 3.3. Therefore, the watermarks can be *regenerated* using cleaned texts after being attacked, and
the correct watermarks can still be generated even if the input texts (i.e., prompts) are perturbed, hence ensuring the robustness of our WASA framework; more details are in Sec. 4.2.

The two separate softmax layers naturally lead to the following separate log-likelihoods:

$$ $\begin{array}[]{l}\textstyle L_{\text{lm}}(s^{\prime}_{i})=\sum_{j=2}^{t}\log P _{u}(u_{j}|u_{1},\ldots,u_{j-1})\\ \displaystyle+\sum_{j=t+1}^{k-m}\log P_{u}(u_{j}|u_{1},\ldots,u_{t},w_{1}, \ldots,w_{m},u_{t+1},\ldots,u_{j-1})\ ,\end{array}\vspace{-4mm}$ (5) $$

$$ $\begin{array}[]{l}\displaystyle L_{\text{wtm}}(s^{\prime}_{i})=\sum_{j=1}^{m} \log P_{w}(w_{j}|u_{1},\ldots,u_{t},w_{1},\ldots,w_{j-1})\end{array}\vspace{0. 5mm}$ (6) $$

where $L_{\text{lm}}(s^{\prime}_{i})$ equation 5 is the log-likelihood of word tokens,
and $L_{\text{wtm}}(s^{\prime}_{i})$ equation 6 is the log-likelihood of watermark tokens
, which
encourages the LLM to learn texts-to-watermarks mapping.(^1^11To simplify exposition, for the second sum in equation 5, when $j=t+1$, the term reduces to $\log P_{u}(u_{j}|u_{1},\ldots,u_{t},w_{1},\ldots,w_{m})$. In equation 6, when $j=1$, the term reduces to $\log P_{w}(w_{j}|u_{1},\ldots,u_{t})$.)
The overall log-likelihood
we aim to maximize is therefore $L_{\text{{WASA}-LLM}}(s^{\prime}_{i})=L_{\text{lm}}(s^{\prime}_{i})+L_{\text{
wtm}}(s^{\prime}_{i})$.

The maximization of the log-likelihood of the watermarks conditioned on the texts equation 6, together with the separation of the prediction/generation spaces, enables WASA-LLM to accurately learn the mapping from the texts to watermarks and achieve a high accuracy in source attribution, which will be empirically verified in Sec. 4.1.
The backward pass is further elaborated in App. C.

### 3.3 Generating Texts with Embedded Watermarks using WASA -LLM

After our WASA-LLM is trained (Sec. 3.2), it can generate synthetic texts which naturally include both the word
and watermark tokens due to their *separate prediction/generation spaces*.
To further improve the alignment between our training and generation stages, we introduce a *special token* $[WTM]$ which is similar to other specialized tokens and in the vocabulary of $V$ word tokens:
When training our WASA-LLM using the watermarked texts,
$[WTM]$ is added right before the watermark tokens during tokenization so that the presence of $[WTM]$ indicates that the subsequent $m=10$ tokens are watermark tokens; when generating
texts, if
$[WTM]$ is encountered/generated, then it indicates that our WASA-LLM should switch to generating watermark tokens.
After watermark tokens have been generated,
our WASA-LLM resumes the word token generation.
Fig. 9 (App. H.1) shows the WASA-LLM-generated synthetic texts with embedded watermarks, which verifies that the watermarks are
imperceptible to human eyes.
Subsequently, when a user requests source attribution for some synthetic texts generated by our WASA-LLM, the LLM platform operator uses a designated *watermark decoder* algorithm to extract the generated watermark from the texts and then attribute these texts to the source (data provider) whose watermark matches
the generated watermark (Fig. 1). The matching algorithm is elaborated in App. D.

## 4 Experiments

We perform extensive empirical evaluations to validate that our WASA framework satisfies the $6$ key properties in Sec. 2.
The experimental results are the average taken from $5$ random seeds. We consider two datasets in the main experiments:

ArXiv is collected by
post-processing PDF version of academic papers from ArXiv (Clement et al., ).
This dataset contains academic papers from several fields,
each field functions as a *data provider*.

BookSum (Kryściński et al., )
consists of
various
books, each considered as a *data provider*.

We further incorporate more diverse datasets in App. F.1.7. They comprise contents crawled from different websites and the data providers offer similar information, thus presenting more challenging scenarios for source attribution.
We adopt $10$ data providers for each dataset in our main experiments and show that our WASA can scale to a larger number of data providers in Sec. 4.3.
We obtain WASA-LLM from our second-stage pre-training (Sec. 3.2)
of the
pre-trained GPT2-Large
, OPT-1.3B,
and Llama2-7B. The results from OPT-1.3B are presented in App. F.
App. E gives more details on the datasets and model training.

Baseline.
Since WASA is the first effective source attribution framework, there is no existing baseline. We extend BM25 (Trotman et al., ), a famous search engine algorithm that estimates the relevance of generated texts to data providers, to perform source attribution (detailed in App. F.1.3).

### 4.1 Accuracy

We design the following experiment to facilitate easier evaluations of the single-source attribution accuracy. Specifically,
for each data provider, we use the sentences selected for watermarking (after removing the watermarks) as the inputs/prompts to the trained WASA-LLM, and perform source attribution on the generated texts.
This simplifies the evaluations, especially the determination of ground-truth source because the data provider corresponding to the input sentence is naturally the ground-truth source of the generated text. We verify the effectiveness of this evaluation method in App. E.3.
Subsequently, we select $50$ sentences from each data provider after removing the watermarks (i.e., $50$ trials) as the input/prompt to the trained WASA-LLM, which generates texts (by continuing the sentence) together with watermarks.
More details are in App. F.1.
The watermark embedded into the generated sentence is then decoded, and the source attribution is correct if this watermark matches the watermark of the data provider corresponding to the input sentence (Sec. 3.3).
As a result, for every data provider, the accuracy of source attribution is calculated as

$$ $\mathrm{accuracy}=\frac{\mathrm{number\ of\ correct\ watermarks}}{\mathrm{ number\ of\ trials}}.$ (7) $$

The macro F1 score is also reported in the results with the definition detailed in App. F.1.
To mitigate the impact of the length of the generated sentence on our evaluations
(i.e., a watermark may not be generated if the generated sentence is too short), we use a simple technique to enforce watermark generation: If a watermark is not generated,
then we force the generation of a watermark by adding the token $[WTM]$ to the end of the sentence (Sec. 3.3).
This is only adopted to simplify the evaluations; as
verified in App. G.3,
naturally and forcefully generated watermarks lead to comparable source attribution accuracy.
We also show in App. G.8 that this enforced watermark generation is not necessary if the generated texts are long enough.
Tab. 1 reports the source attribution accuracy averaged over $10$ data providers.
Our WASA framework consistently achieves *more accurate source attribution for both datasets and both language models*;
Tabs. 8 and 9 in App. F.1.4 gives the source attribution accuracy for different data providers.

Top-$k$ Source Attribution.
In addition to attributing a generated sentence to a single source by using one watermark, it may be acceptable for some users to attribute a generated sentence to multiple possible sources that contain the true source.
To account for these scenarios, we propose *top-$k$ source attribution* in which we modify our watermark generation
(Sec. 3.3) so that when the token $[WTM]$ is encountered, we generate the top $k>1$ watermarks with the largest beam search scores.
In this case, source attribution is successful if the true watermark is contained in these $k$ watermarks,
so the *top-$k$ accuracy* can be defined by replacing the number of correct watermarks in equation 7 with the number of generated sentences whose top $k$ watermarks contain the true watermark.
Note that even though the methodology and main evaluation are targeted at single-source, an extension to multiple data providers can be handled by our top-k source attribution, and we present a case study when true sources are multiple sources in App. H.3.

Fine-grained Error Analysis.
To better understand the incorrect attributions, where the generated text is not correctly attributed to its true source, we conduct a detailed error analysis on the ArXiv dataset.
For every category (i.e., data provider), we separate the source attribution errors into two types of errors: (a) *misclassification* in which the generated watermark matches the watermark of another incorrect category, and (b) *incorrect watermark* in which the generated watermark does not match the watermark of any category.
The results are presented in Tab. 10 in App. F.1, which show that the
vast majority of our errors result from misclassification and our WASA-LLM rarely generates incorrect watermarks not belonging to any category.
This further substantiates the reliability of our WASA-LLM.
The results also suggest that errors are mostly caused by the generated texts exhibiting the characteristics of multiple data providers.
Additionally, an edge case of incorrect attribution may arise when the true source is not watermarked, such as the public pre-training data. In such cases, content cannot be attributed to any recognized provider. To investigate this phenomenon, we design a controlled experiment detailed in App. F.1.

**Table 1: Accuracies of top-$1$, top-$3$, and top-$5$ source attribution (resp. denoted by ‘acc.’, ‘top-$3$.’, and ‘top-$5$.’) and F1 score by BM25 and WASA-LLM from second-stage pre-training of different models on various datasets.**
| model | method | ArXiv dataset | BookSum dataset |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| acc. | top-$3$. | top-$5$. | F1 | acc. | top-$3$. | top-$5$. | F1 |  |  |
| GPT2 | BM25 | $54.73_{\pm 6.52}$ | $85.13_{\pm 0.58}$ | $93.80_{\pm 0.53}$ | $0.517_{\pm 0.01}$ | $58.94_{\pm 3.43}$ | $77.73_{\pm 1.94}$ | $88.33_{\pm 2.53}$ | $0.593_{\pm 0.04}$ |
| WASA | $\textbf{74.84}_{\pm 2.04}$ | $\textbf{95.76}_{\pm 1.24}$ | $\textbf{98.56}_{\pm 0.82}$ | $\textbf{0.758}_{\pm 0.02}$ | $\textbf{77.92}_{\pm 1.57}$ | $\textbf{91.80}_{\pm 0.24}$ | $\textbf{96.52}_{\pm 0.76}$ | $\textbf{0.723}_{\pm 0.08}$ |  |
| Llama2 | BM25 | $60.07_{\pm 4.83}$ | $88.67_{\pm 1.33}$ | $95.60_{\pm 1.31}$ | $0.576_{\pm 0.01}$ | $54.01_{\pm 12.3}$ | $75.40_{\pm 9.53}$ | $86.60_{\pm 4.04}$ | $0.607_{\pm 0.05}$ |
| WASA | $\textbf{77.40}_{\pm 1.91}$ | $\textbf{96.87}_{\pm 1.62}$ | $\textbf{99.40}_{\pm 0.35}$ | $\textbf{0.800}_{\pm 0.03}$ | $\textbf{83.27}_{\pm 4.50}$ | $\textbf{95.27}_{\pm 1.53}$ | $\textbf{97.67}_{\pm 0.46}$ | $\textbf{0.840}_{\pm 0.06}$ |  |

### 4.2 Robustness

Our WASA framework is robust against malicious attacks aiming to disrupt the source attribution. We introduce the threat model as follows: We identify potential attackers as those intending to alter the LLM-generated text to remove IP acknowledgments to data contributors or alter input sentences to disrupt the watermark generation and hence the source attribution results. The attackers do not have access to the LLM itself but can query the model and modify the generated outputs. The attackers may also possess tools that can remove the Unicode characters (hence the watermark) inside a text.

Watermark Removal/Modification Attack.
An adversary may remove/modify the watermarks in our generated sentence to sabotage the source attribution accuracy.
Due to the ability of our WASA-LLM in learning an accurate texts-to-watermarks mapping,
the watermark can be *regenerated* if it is manipulated.
Specifically, we clean the generated sentence by removing the
corrupted watermark, and use the cleaned sentence as
input/prompt to WASA-LLM to regenerate the watermark (without generating synthetic texts) which is then used for source attribution.
The regenerated watermarks by WASA-LLM (from second-stage pre-training of GPT2 on ArXiv dataset) lead to an overall accuracy (top-$3$ accuracy) of $71.60\%(93.76\%$) which is comparable to the original
$74.84\%(95.76\%$) (Tab. 1).
So, our watermark regeneration
is an effective defense mechanism.
Besides removing/modifying the watermark, an adversary may *additionally modify the content of the generated sentence*:

**Table 2: Source attribution accuracy using regenerated watermarks by WASA-LLM (from second-stage pre-training of GPT2 on ArXiv dataset) under various attacks on generated sentences with embedded watermarks (*in addition to watermark removal/modification attacks*) and on input sentences. std is given in Tabs. 14 and 15 (App. F.2).**
| strength | attacks on generated sentences with embedded watermarks | attacks on input sentences |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| insertion attack | deletion attack | synonym substitution | insertion attack | deletion attack | synonym substitution |  |  |  |  |  |  |  |
| acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. |  |
| $0\%$ | $71.60$ | $93.76$ | $71.60$ | $93.76$ | $71.60$ | $93.76$ | $74.84$ | $95.76$ | $74.84$ | $95.76$ | $74.84$ | $95.76$ |
| Localized | $71.40$ | $93.56$ | - | - | - | - | $74.20$ | $95.40$ | - | - | - | - |
| $5\%$ | $70.12$ | $93.20$ | $71.08$ | $93.92$ | $70.52$ | $93.52$ | $74.20$ | $95.40$ | $73.56$ | $95.52$ | $72.84$ | $95.24$ |
| $10\%$ | $69.12$ | $92.20$ | $71.84$ | $93.68$ | $71.02$ | $92.88$ | $72.88$ | $94.68$ | $72.96$ | $94.68$ | $73.60$ | $95.00$ |
| $15\%$ | $66.92$ | $91.96$ | $71.36$ | $94.04$ | $70.96$ | $92.72$ | $71.52$ | $93.20$ | $72.68$ | $94.12$ | $71.88$ | $94.20$ |
| $20\%$ | $65.12$ | $91.44$ | $70.00$ | $93.24$ | $69.20$ | $93.20$ | $68.60$ | $93.40$ | $72.68$ | $94.12$ | $72.08$ | $93.76$ |

Additional Attacks.
We also consider additional attacks on generated sentences with embedded watermarks and on input sentences, including insertion, deletion, synonym substitution, syntactic transformation attacks, and an oracle-based attack (Zhang et al., ).
Tab. 2 reports the source attribution accuracy under the first $3$ attacks, where the attack strength relates to how many words in the sentence are attacked, and App. F.2 reports the accuracy under the last $2$ attacks along with all the attacks descriptions.
For such attacks (*in addition to watermark removal/modification attacks*) on generated sentences, watermark regeneration is used.
The results show that although the
attacks deteriorate attribution accuracy,
high source attribution accuracy can still be preserved.
This can again be explained by the reliable texts-to-watermarks mapping of our WASA-LLM, which is robust against perturbations to the input/prompt.

**Table 3: Source attribution accuracy and F1 score for different numbers of data providers on ArXiv dataset. ‘BM25’ denotes the source attribution obtained from BM25 on Llama2 as a baseline.**
| n | BM25 Llama2 | WASA GPT2 | WASA Llama2 |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| acc. | F1 | acc. | top-$3$. | top-$5$. | F1 | acc. | top-$3$. | top-$5$. | F1 |  |
| $10$ | $60.07\pm_{4.83}$ | $0.576\pm_{0.01}$ | $74.84\pm_{2.04}$ | $95.76\pm_{1.24}$ | $98.56\pm_{0.82}$ | $0.758\pm_{0.02}$ | $77.40_{\pm 1.91}$ | $96.87_{\pm 1.62}$ | $99.40_{\pm 0.35}$ | $0.800\pm_{0.03}$ |
| $25$ | $46.08\pm_{2.75}$ | $0.445\pm_{0.01}$ | $66.48\pm_{0.76}$ | $90.69\pm_{4.23}$ | $94.05\pm_{0.32}$ | $0.663\pm_{0.01}$ | $72.38_{\pm 1.18}$ | $92.44_{\pm 1.66}$ | $96.60_{\pm 0.70}$ | $0.717\pm_{0.01}$ |
| $50$ | $26.85\pm_{10.1}$ | $0.348\pm_{0.02}$ | $56.44\pm_{0.84}$ | $80.19\pm_{1.02}$ | $87.54\pm_{0.68}$ | $0.560\pm_{0.01}$ | $63.15_{\pm 2.71}$ | $84.74_{\pm 0.76}$ | $90.49_{\pm 0.47}$ | $0.600\pm_{0.01}$ |
| $100$ | $19.91\pm_{12.5}$ | $0.229\pm_{0.01}$ | $45.06\pm_{0.67}$ | $68.61\pm_{0.27}$ | $78.76\pm_{2.80}$ | $0.443\pm_{0.01}$ | $49.88_{\pm 0.34}$ | $73.63_{\pm 0.04}$ | $82.34_{\pm 0.31}$ | $0.505\pm_{0.01}$ |

### 4.3 Scalability

Here, we verify WASA’s ability to scale to a large number of data providers.
We follow the experimental setup in Sec. 4.1
and increase the number of data providers.
Results in Tab. 3, Tab. 18, and Tab. 19 (App. F.3, which includes $500$ data providers) show that as the number of data providers increases, the source attribution accuracy inevitably decreases yet still remains high compared with
the BM25 baseline.
With more data providers, we recommend using $k>1$ in top-$k$ attribution due to higher resulting accuracy and identifying the true source from among them.

### 4.4 Performance Preservation

Here, we show that our WASA-LLM preserves the text generation ability of the original LLM
by comparing it with the original GPT2-Large model which we denote as *originalGPT*.
We train originalGPT using the same (but un-watermarked) data from the ArXiv dataset as that used for our WASA-LLM.
We assess the text generation performance
using several commonly used evaluation metrics (with a separate evaluation dataset, as explained in App. E.1): perplexity, distinct-$1$, and distinct-$2$ scores (Li et al., ).
To further assess the naturalness and coherence of the generated text, we have also employed the GPT4 zero-shot prompt method (i.e., introduced in the work of Yao et al. ()) to assess the text’s naturalness and coherence.
The results in Tab. 4 show that the text generation performance of our WASA-LLM is comparable to that of
originalGPT, which indicates that our WASA framework preserves the ability of the LLM to generate high-quality texts (Sec. 2).
The larger degradation in naturalness may stem from the embedded watermarks (Unicode characters). We validate that our WASA-LLM balances between the number of embedded watermarks and source attribution accuracy in App. G.7. We show that our framework also ensures decent readability of generated text in App. H.1.

**Table 4: Comparison of the text generation performances achieved by our WASA-LLM vs. the baseline model. The coherency and naturalness are evaluated by GPT4.**
| models | perplexity ($\downarrow$) | distinct-$1$ ($\uparrow$) | distinct-$2$ ($\uparrow$) | coherency ($\uparrow$) | naturalness ($\uparrow$) |
| --- | --- | --- | --- | --- | --- |
| originalGPT | $12.4682_{\pm 0.40}$ | $0.8141_{\pm 0.00}$ | $0.9796_{\pm 0.00}$ | 7.370 | 7.744 |
| WASA-LLM | $12.6570_{\pm 0.54}$ | $0.8193_{\pm 0.00}$ | $0.9795_{\pm 0.00}$ | 7.135 | 6.926 |

### 4.5 Other Key Properties

Transferability and Adaptability are elaborated in Apps. F.4 & F.5.

Ablation Studies are carried out to assess the effectiveness of the
designs, including (a) the designated embedding space for watermark tokens and separation of the prediction/generation spaces (App. G.1), (b) adopting TF-IDF to select sentences for embedding watermarks
(App. G.2), and (c) the enforced watermark generation (App. G.3).
Additional analysis, including (d) unattributable content (App. G.4), (e) the effectiveness in supervised fine-tuning (App. G.5),
and (f) the relative positions of the generated watermarks (App. G.6), are examined.
We also explored the impact of hyperparameters from App. G.7 to App. G.12.

## 5 Related Work

In this section, we will review related works on source attribution and data provenance; further discussions on watermarking natural languages and models as well as text steganography are in App. B.
Recent studies by Song & Shmatikov () on verifying dataset usage in language model training through membership inference attacks are limited by the model’s output length, making them unsuitable for long-generated texts which we have considered in this work.
Liu et al. () have proposed to plant backdoor triggers in training texts to check for data usage, but this method is not robust against removals of the backdoor triggers and can impair text generation performance.
Importantly, the above works have only focused on data provenance and *cannot be easily adapted to perform effective source attribution*.
Abdelnabi & Fritz () have embedded messages post-generation via adversarial training, which means the messages can only be used for IP protection and *cannot be used for source attribution* during generation.
Some recent works in computer vision have tackled the problem of source attribution (Marra et al., ; Yu et al., ; ).
However, to the best of our knowledge, effective source attribution for the texts generated by language models remains an open problem
and is the focus of our work here.

## 6 Conclusion

This paper describes our proposed WASA framework which allows for effective source attribution
as a solution to intellectual property infringement in the context of LLMs.
By embedding unique watermarks into LLM-generated texts,
WASA not only enhances the reliability and interpretability of LLM-generated content but also provides a crucial tool for data protection, allowing data providers to verify the use of their contributions in LLM training processes.
The extensive empirical evaluations of the WASA framework affirm its effectiveness in achieving accurate source attribution
while satisfying the key properties we have identified above.
Since our WASA is the first effective source attribution framework for LLM-generated texts, it faces some limitations which may call for future work. For example, though we have shown that our WASA is robust against various adversarial attacks, it is unclear whether it is robust against more advanced/sophisticated attacks, which may be achieved through adversarial training in future work.

## Appendix A Ethical Considerations

Similar to other research topics on LLMs, watermarking the synthetic texts generated by LLMs for source attribution
requires a thoughtful and ethical approach due to its potential societal implications.
That is, it is important to take necessary measures to avoid causing harm to certain parties.
Potential risks related to our watermarking framework include the following:

- •
Privacy Risks. Watermarking can potentially reveal sensitive information about data providers, thus leading to privacy breaches or the possibility of re-identification if not handled carefully. In our WASA framework, only the watermark can be seen in the generated data, which does not directly imply personal information about the data providers. Privacy can be preserved given that the mapping from watermarks to data providers is kept confidential.
- •
Chilling Effects. Watermarking may discourage some data providers from sharing their datasets, especially if they fear potential misuse or unintended consequences of having their data linked to specific research outcomes.
- •
Data Manipulation. While watermarks are meant to be unobtrusive and our WASA framework has been shown to be robust against various adversarial attacks, there can be unforeseen real-world instances where malicious actors attempt to manipulate the watermark, which may lead to negative consequences such as the dissemination of altered or misleading information.

To address these potential risks, it is essential to carefully consider the ethical implications of our watermarking framework and implement measures to protect the privacy and interests of all involved parties, particularly those who are more susceptible to harm. Researchers should conduct comprehensive risk assessments and engage in transparent communication with data providers to ensure the responsible and ethical use of watermarked data. Additionally, incorporating diverse perspectives and involving vulnerable communities in the decision-making process can help identify and mitigate potential harm effectively.

## Appendix B Additional Related Works

In addition to the previous works
discussed in Sec. 5 that are most closely related to ours, we will give a review of additional related works on
watermarking natural languages and text steganography, as well as recent works on watermarking language models.

##### Watermarking Natural Language/Text Stegano-graphy.

In natural language processing, watermarking and steganography are closely related in that they both desire stealthiness and robustness. However, there are also important differences because watermarking emphasizes the importance of ownership, whereas steganography focuses on the secret communication of messages.
Language watermarking is used to protect the integrity and authorship of digital texts (Kamaruddin et al., ; Podilchuk & Delp, ).
Early approaches of language watermarking are mostly rule-based and make use of linguistic techniques such as synonym substitution (Topkara et al., ) and sentence structure alteration (Topkara et al., ) to embed watermarks while attempting to preserve the semantic meaning of the original texts.
However, these approaches usually lead to deteriorated text quality and are not scalable.
Some recent works have aimed to develop advanced text steganography methods using deep learning.
The work of Yang et al. () has utilized recurrent neural networks to automatically generate steganographic texts, and
the work of Ziegler et al. () has proposed to first convert the secret messages into bit strings and then map them to the cover text based on arithmetic coding with the help of GPT2 (Radford et al., ).

##### Watermarking Language Models.

Some recent works have proposed methods to add watermarks to language models in order to protect the IP of the models (Dai et al., ; Gu et al., ; He et al., ; Zhao et al., ).
These methods allow the verification of model ownership and are hence able to protect the economic interests of model owners.
Specifically, the work of He et al. () has employed lexical replacement to watermark the language model output and used hypothesis testing for post-hoc model ownership verification.
The work of Gu et al. () has adopted backdoor attacks to embed black-box watermarks into pre-trained language models, which is achieved by using rare words as well as a combination of common words as backdoor triggers and verifying the watermarks by calculating the extraction success rate.
Apart from model protection, multiple methods (Kirchenbauer et al., ; Kuditipudi et al., ; Lu et al., ) have been proposed to use watermarking to distinguish between human-generated and model-generated synthetic texts. Kirchenbauer et al. ()
softly constrain the word choices when the model generates synthetic texts and use hypothesis testing to make the distinction.
More recently, the work of Kuditipudi et al. () has improved the above method by developing a distortion-free method, which ensures that the watermarks do not change the sampling distribution of the texts. The work of Lu et al. () also refines the same method by ensuring the influence of a token during watermark detection to be proportional to its entropy. Finally, in terms of security in watermarking models, Liu et al. () develop a compact watermarking model that embeds a semantic watermark within model outputs, enhancing their robustness against adversarial text modifications. Meanwhile, Liu et al. () employ two distinct neural networks to generate and detect watermarks, enabling public verification of the watermark while maintaining the confidentiality of the secret key throughout the watermark generation process. Additionally, He et al. () introduce a Cross-lingual Watermark Removal Attack (CWRA), which can effectively
remove watermarks by interfering with the watermark generation process through translation into another language.
Importantly, these methods
cannot be used to perform source attribution for the texts generated by language models, which we focus on in this work.

## Appendix C Backward Pass

In the main paper, we introduce the forward pass of our model in Sec. 3. Here, we delve into the backward pass in our framework.
Remember that the most important design of the framework is the separation of the prediction/generation spaces of the word tokens equation 3 and watermark tokens equation 4.
We represent the overall log-likelihood as $L_{\text{{WASA}-LLM}}(s^{\prime}_{i})=L_{\text{lm}}(s^{\prime}_{i})+L_{\text{
wtm}}(s^{\prime}_{i})$. Notice that maximizing these log-likelihoods is equivalent to minimizing the cross-entropy loss
$Loss_{\text{{WASA}-LLM}}(s^{\prime}_{i})=Loss_{\text{lm}}(s^{\prime}_{i})+Loss
_{\text{wtm}}(s^{\prime}_{i})$ in which

$$ $\begin{array}[]{c}\displaystyle Loss_{\text{lm}}(s^{\prime}_{i})=\sum_{j=2}^{t }\text{CE}(P_{u}(u_{j}),u_{j})+\sum_{j=t+1}^{k-m}\text{CE}(P_{u}(u_{j}),u_{j}) \ ,\\ Loss_{\text{wtm}}(s^{\prime}_{i})=\sum_{j=1}^{m}\text{CE}(P_{w}(w_{j}),w_{j}) \end{array}\vspace{2mm}$ (8) $$

represent the losses for the word and watermark tokens, respectively.
For simplicity, in equation 8,
we omit the conditioning on the preceding tokens in $P_{u}(u_{j})$ and $P_{w}(w_{j})$, which can be found in equation 5 and equation 6.

Due to the design above,
the backward pass for updating the parameters $W^{\prime}_{e}$ in the last linear layer is also separated.
That is, the gradients of word token loss $Loss_{\text{lm}}(s^{\prime}_{i})$
and
watermark token loss $Loss_{\text{wtm}}(s^{\prime}_{i})$
equation 8 are responsible for updating $(W^{\prime}_{e}[1:V])^{\top}$ equation 3 and $(W^{\prime}_{e}[V+1:V+V^{\prime}])^{\top}$ equation 4, respectively.
Specifically, the gradient update rule for $W_{e}^{\prime}$ (with learning rate $\alpha$) can be expressed as
$W_{e}^{\prime}\leftarrow W_{e}^{\prime}-\alpha h_{l}\cdot\nabla_{z}$
where $\nabla_{z}$ is a $(V+V^{\prime})$-dimensional gradient vector allowing the separated gradient updates to be easily achieved in a unified manner, as described below.
Next, using the respective losses for word and watermark tokens
equation 8,
the gradient vectors w.r.t. $z_{u}$ and $z_{w}$ are calculated as $V$-dimensional
$\nabla_{z_{u}}={\partial\text{CE}(P_{u}(u_{j}),u_{j})}/{\partial z_{u}}$ and $V^{\prime}$-dimensional $\nabla_{z_{w}}={\partial\text{CE}(P_{w}(w_{j}),w_{j})}/{\partial z_{w}}$, respectively.
When the loss is calculated from predicting a *word token* $u_{j}$ equation 8,
let $\nabla_{z}=[\nabla_{z_{u}},0_{V^{\prime}}]$ where $0_{V^{\prime}}$ is a $V^{\prime}$-dimensional all-zero vector.
When the loss results from predicting a *watermark token* $w_{j}$ equation 8,
let $\nabla_{z}=[0_{V},\nabla_{z_{w}}]$.
Note that for the parameters in the last linear layer which are responsible for predicting the *word tokens* using the hidden state (i.e., parameters $(W^{\prime}_{e}[1:V])^{\top}$ in equation 3), the gradient updates
are *not affected by the loss for the watermark tokens*.
This helps us to further limit the impact of the added watermarks on the original ability of the LLM to generate high-quality synthetic texts and hence preserve its performance.
For the parameters in the other transformer layers (except for the frozen layers), their updates are performed using the gradients w.r.t. the losses for both the word and watermark tokens; see App. E.2 for more details.

Note that both our forward pass and backward pass only require mild modifications to an LLM.
Therefore, our WASA framework can be easily adapted to fit a wide variety of LLMs, which ensures its adaptability property.

## Appendix D Watermark Matching

##### Exact Matching.

In this work, we adopt exact matching to determine the correctness of the generated watermarks. That is, given a piece of generated text with watermarks and the corresponding ground-truth watermark, the generated watermark is correct only if they are strictly equal in string matching. In addition, in case multiple watermarks are generated in the synthetic data, all generated watermarks have to match the ground-truth watermark to affirm the correctness. The pseudocode for the matching algorithm is given in Alg. 1:

Figure: Algorithm 1 Exact Matching

##### Soft Matching.

To further improve the source attribution accuracy in some applications, we may relax the requirement of exact watermarking matching
and instead
attribute the generated texts to the
data provider whose watermark has the smallest Levenshtein distance to the generated watermark.
However, in all our experiments, our WASA is able to achieve accurate source attribution without soft matching.

## Appendix E Detailed Experimental Setup

### E.1 Datasets

ArXiv: To simulate different data providers with unique characteristics, we create the Clean-ArXiv-Corpus (or ArXiv for short) dataset which consists of academic papers from ArXiv.
The dataset contains academic papers from various sub-disciplines, including computer science, physics, mathematics, public health, and other related fields. We make use of the provided metadata from the work of Clement et al. () to download the corresponding PDF files and retrieve the categorization information associated with each article. Subsequently, we employ GROBID (Lopez, ) to parse and extract the main body of the papers, excluding the abstract and reference sections. Our Clean-ArXiv-Corpus dataset covers a comprehensive collection of $100$ distinct categories, each comprising a number of papers ranging from $2827$ to $2984$.
We treat *every category as a data provider*, so one data provider/category is the source of each piece of text.
Our main experiments in Sec. 4 are conducted using $10$ categories (i.e., data providers) and we use $33\%$ of papers from each category due to computational constraints.
However, in our ablation study (App. G.11), we have also tested utilizing more data from every data provider (including $100\%$ of the data), which has led to further improved performances and consistent conclusions.
For each of the $10$ categories, we further randomly split its data into training and evaluation datasets with a ratio of $9:1$ according to the seed number. In our ablation study, we will use more categories and also use all papers in each category.
More detailed information about the full Clean-ArXiv-Corpus dataset, including all $100$ categories and all papers in each category, is shown in Tab. 5; Tab. 5 shows an instance of the random split into training and evaluation datasets based on seed number $2023$.

BookSum: In addition to the Clean-ArXiv-Corpus dataset, we also adopt the BookSum dataset (Kryściński et al., ). This dataset contains documents from the literature domain including novels, plays, and stories.
The BookSum dataset contains $181$ books and we treat *every book as a data provider*.
For every data provider (i.e., book), we adopt all the text data from the book in all our experiments.
More information on the BookSum dataset is shown in Tab. 6; Tab. 6 shows an instance of the random split into training and evaluation datasets based on seed number $2023$. Additionally, we have adopted more diverse datasets, details of which are found in App. F.1.7.

**Table 5: Information on the Clean-ArXiv-Corpus (or ArXiv for short) dataset.**
|  | Training | Evaluation |
| --- | --- | --- |
| Papers | $264$K | $29$K |
| Unique tokens | $17.1$M | $3$M |
| Unique tokens per Category | $407$K | $87$K |
| Total tokens | $1.8$B | $203$M |
| Total tokens per Category | $18.2$M | $2$M |

**Table 6: Information on the BookSum dataset.**
|  | Training | Evaluation |
| --- | --- | --- |
| Books | $161$ | $20$ |
| Unique tokens | $413$K | $106$K |
| Unique tokens per Book | $91$K | $20$K |
| Total tokens | $33$M | $4.6$M |
| Total tokens per Book | $3.3$M | $467$K |

### E.2 Experimental Setting

In our experiments, we build our WASA-LLM based on the open-source pre-trained GPT2-Large model (Radford et al., ), OPT-1.3B model (Zhang et al., ) and Llama2-7B model (Touvron et al., ).
Based on the pre-trained weights, we perform our second-stage pre-training (Sec. 3.2) of the pre-trained GPT2-Large model, OPT-1.3B model, or the Llama2-7B model on the watermarked (Sec. 3.1) text data for one epoch to obtain WASA-LLM.
We find that training for one epoch already allows our WASA framework to achieve compelling performances, as shown in our experiments in Sec. 4.
We have also tested more training epochs in App. G.12 and the results suggest that our performances can potentially be further improved with more training epochs.
We plot the convergence of the training of our WASA-LLM in terms of the losses for the word and watermark tokens in Fig. 4, which shows that our second-stage pre-training
effectively reduces both losses.
Importantly, the watermark token loss rapidly declines
after a small number of steps, which suggests that our WASA-LLM can quickly learn an accurate texts-to-watermarks mapping.

Figure: Figure 4: Training losses for word tokens (Loss_lm) and watermark tokens (Loss_wtm) when obtaining WASA-LLM from second-stage pre-training of the GPT2 model on ArXiv dataset.
Refer to caption: x7.png

Here, we give more details on the hyperparameters we adopted.
We fix $5$ seed numbers at $2021$, $2022$, $2023$, $2024$, and $2025$ for obtaining reproducible
results on GPT2 and OPT models,
and $3$ seed numbers at $2022$, $2023$, $2024$ for the Llama2 model.
The results shown in this work are the average taken across that from the seeds.
We adopt the Adam optimizer with a learning rate of $5\times 10^{-5}$ and no weight decay. We make use of the fp16 technique and a gradient accumulation of $8$ to speed up training. We also adopt a gradient checkpoint to reduce memory usage so that batch size can be slightly increased. We use a block size of $512$ and a batch size of $3$ for most of the experiments and a batch size of $16$ in the experiments to evaluate scalability.
To further preserve the ability of the original pre-trained LLM models, during the second-stage pre-training, we freeze the first $12$ layers of GPT2-Large (among a total of $36$ layers) and freeze the first $8$ layers of OPT-1.3B (among a total of $24$ layers).
For the second-stage pre-training of Llama2-7B, we adopt LoRA (Hu et al., ) and set the rank and alpha to $32$, ‘q_proj’, ‘k_proj’, ‘v_proj’, ‘o_proj’, ‘gate_proj’, ‘gate_proj’, ‘gate_proj’, ‘up_proj’, ‘down_proj’ as the target modules, and ‘lm_head’, ‘embed_tokens’ as the modules to save.
When generating the synthetic texts (see Sec. 3.3), we use the multinomial sampling of top-$60$ with temperature $=0.7$. We also make use of a $1.2$ repetition penalty and a $2.0$ length penalty to generate better synthetic data.
The generation of watermarks for our WASA-LLM adopts a pure beam search, as discussed in Sec. 3.3, with a beam size of $5$.
For the baseline model used in the ablation studies (i.e., GPT2-Large),
watermark generation is performed in the same way as text generation, so we use the same hyperparameters as that specified in the baseline model.
All second-stage pre-training is performed using NVIDIA RTX A5000 and A100.
In our implementation, we adopt the GROBID library to process the PDF files. For model training, we adopt the Hugging Face Trainer pipeline which embeds necessary tricks to speed up the training process.
The open-source GPT2-Large, OPT-1.3B, and Llama2-7B are also adopted from Hugging Face.(^2^22[https://huggingface.co/facebook/OPT-1.3B](https://huggingface.co/facebook/OPT-1.3B), [https://huggingface.co/meta-llama/Llama-2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf), and [https://huggingface.co/GPT2-Large](https://huggingface.co/GPT2-Large).)

### E.3 Effectiveness of Evaluation

**Table 7: Definition of task in prompts for GPT4 labeling.**
| Definition of Task in Prompts for GPT4 Labeling |
| --- |
| Given below are 10 categories for texts from ArXiv papers with their descriptions. Please read the descriptions and classify the provided texts to one of the paper categories.<br>The 10 categories are: hep-th, hep-ph, quant-ph, astro-ph, cs.CV, cs.LG, cond-mat.mes-hall, gr-qc, cond-mat.mtrl-sci, cond-mat.str-el.<br>hep-th stands for High Energy Physics - Theory. This category includes research papers which are centered on theoretical concepts and mathematical models in high energy physics.<br>hep-ph stands for High Energy Physics - Phenomenology. This category includes research papers centered on the application of theoretical physics to high energy physics experiments.<br>quant-ph stands for Quantum Physics. This category includes research papers centered on the theoretical and experimental aspects of the fundamental theory of quantum mechanics.<br>astro-ph stands for Astrophysics. This category includes research papers centered on the study of the physics of the universe, including the properties and behavior of celestial bodies.<br>cs.CV stands for Computer Science - Computer Vision and Pattern Recognition. This category includes research papers focused on how computers can be made to gain high-level understanding from digital images or videos.<br>cs.LG stands for Computer Science - Machine Learning. This category includes research papers focused on the development and implementation of algorithms that allow computers to learn from and make decisions or predictions based on data.<br>cond-mat.mes-hall stands for Condensed Matter - Mesoscale and Nanoscale Physics. This category includes research papers that focus on the properties and phenomena of physical systems at mesoscopic (intermediate) and nanoscopic scales.<br>gr-qc stands for General Relativity and Quantum Cosmology. This category includes research papers centered on theoretical and observational aspects of the theory of general relativity and its implications for understanding cosmology at the quantum scale.<br>cond-mat.mtrl-sci stands for Condensed Matter - Materials Science. This category includes research papers centered on the understanding, description, and development of novel materials from a physics perspective.<br>cond-mat.str-el stands for Condensed Matter - Strongly Correlated Electrons. This category includes research papers focused on the study of solids and liquids in which interactions among electrons play a dominant role in determining the properties of the material.<br>Note that you should only include the class in your reply and provide no explanations.<br>Please classify the following sentence into one of the 10 categories, however, if you think that the sentence could be classified into multiple categories, you may give up to 3 most likely categories: |

In our experiment design, we assign the ground truth source of each generated text to be identical to that of the prompt sentence.
Here, we would like to verify that our method of using the source of the prompt sentence as the ground truth source for the generated sentence is indeed a reliable approach, in addition to its benefit of simplifying the experimental evaluation.

A natural and reliable method to find the ground truth source of a generated text is to consult the opinion of human experts. Therefore, we would like to show that our method to determine the ground truth source is an accurate approximation to human evaluations. To avoid the substantial costs and resources associated with human evaluators, we have employed GPT4, noted for its human-level performance across various benchmarks (OpenAI, ), as a surrogate ‘human-like labeler’. Then, we examine whether the ground truth source determined by our method (i.e., using the source of the prompt sentence) aligns well with those determined by GPT4.
Specifically, we use GPT4 to categorize generated texts into one of the ten ArXiv categories (i.e., data providers) using a carefully constructed prompt, as shown in Tab. 7. After evaluating $500$ generated texts, we have found that $89.6\%$ of GPT4’s decisions align with our source determination method (i.e., using the source of the prompt sentence). This validates that our method to determine the ground truth source of a generated text is a reasonable and reliable approach.

We would like to add that employing GPT4 as a ‘human-like labeler’ is only feasible in our controlled setting here because it requires prior knowledge about all sources and detailed descriptions of the sources; see the detailed prompt in Tab. 7. Moreover, it also incurs excessive costs in terms of monetary expenses and computations when the number of data providers is large. Therefore, we would like to clarify that this GPT4-based method is not a realistic alternative method for source attribution and is instead only employed here to verify the reliability of our method of source determination.

Additionally, note that the reason why we have used watermarked training data as the prompt sentences in our evaluation is because it leads to simple and reliable evaluations. Here, we justify this using the GPT4-based experiment as well. We use GPT4 to examine the reliability of the ground truth source determination when sentences from two held-out sets are used as the prompt sentences: when the prompt sentences are selected from unwatermarked training data and when the prompt sentences are from the validation data. The results show that when the prompt sentences are selected from unwatermarked training data, $81.6\%$ of GPT4’s decisions align with the source of the prompt sentences; when the prompt sentences are from the validation data, the alignment becomes $75.0\%$. The results suggest that when the sentences from both held-out sets are used as the prompt sentences, our method to determine the ground truth source is still reasonably reliable. However, our ground truth source determination is the most reliable when sentences from watermarked training data are used as the prompt, as we have done in our main experiments. Therefore, the results justify the rationale behind our choice of using watermarked training data as prompts because it enhances the reliability of our source determination and hence the fidelity of our evaluation results.

## Appendix F More Experimental Results

### F.1 Accuracy

#### F.1.1 More Details on Experimental Setup.

In our experiments on the source attribution accuracy,
for the ArXiv dataset, we select $50$ papers from each of the $10$ categories (App. E.1) and for every selected paper, we choose the first sentence that has been selected for watermarking (to obtain our WASA-LLM from second-stage pre-training of various pre-trained LLMs, see Sec. 3.1 for more details on how we select the sentences for watermarking) as well as contains at least $200$ characters. Next, we use the first $200$ characters of every selected sentence (after removing the watermarks) as the input/prompt to the trained WASA-LLM , which generates texts with a token length of $100$.
Similarly, for every book (i.e., data provider) in the BookSum dataset, we select the first $50$ sentences that have been selected for watermarking as well as have at least $200$ characters.
As a result, for both datasets, we have selected $50$ sentences to be used as the inputs/prompts to our WASA-LLM, which corresponds to $50$ trials of source attribution for each of the $10$ data providers. In addition, the source attribution accuracy and F1 score for OPT-1.3B model are presented in App. F.3, together with the scalability results.

#### F.1.2 F1 score.

In our main experiments, we have reported the macro F1 score for a more comprehensive evaluation. To compute the F1 score, here we first define precision as the number of correct watermarks (watermarks that correctly correspond to its true source) for the data provider $i$ divided by the number of all generated watermarks that correspond to the data provider $i$ and define recall as the number of correct watermarks divided by the number of trails of the data provider $i$. We calculate the precision and recall for each data provider and obtain $precision_{i}$ and $recall_{i}$. Subsequently, We obtain $precision_{ma}$ and $recall_{ma}$ by averaging the precisions and recalls from all data providers.
Therefore, the macro F1 score can be computed as:

$$ $F_{1}=2\times\frac{precision_{ma}\times recall_{ma}}{precision_{ma}+recall_{ma }}.$ (9) $$

#### F.1.3 BM25 as source attribution baseline.

BM25 is a well-known search engine algorithm that can potentially be utilized to perform source attribution given the generated sentences.
In our experiments, we have implemented the BM25 from GitHub (^3^33[https://github.com/dorianbrown/rank_bm25](https://github.com/dorianbrown/rank_bm25)) as a source attribution baseline for comparison. Specifically, we apply BM25 and take the unwatermarked training data as the corpus, and take the same generated sentences from our WASA-LLM (the watermarks are cleaned) as input. Subsequently, we can use BM25 to find the top-$k$ closest data providers in the training data. BM25 operates as a post-hoc process, which may slow down source identification, especially for larger number of potential sources.

#### F.1.4 Source Attribution Accuracy for Each Data Provider.

Tabs. 8 and 9 show the detailed results on source attribution accuracy and F1 score for the $10$ different data providers, in addition to Tab. 1 in Sec. 4.1. The results show that the accuracy remains balanced across the data providers.

**Table 8: Source attribution accuracy and F1 score achieved by our WASA-LLM (i.e., obtained from second-stage pre-training of different models on various datasets) for the ArXiv dataset.**
| Data Provider | GPT2 | OPT | Llama2 |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| acc. | top-$3$. | F1 | acc. | top-$3$. | F1 | acc. | top-$3$. | F1 |  |
| hep-th | $65.60_{\pm 7.40}$ | $94.40_{\pm 2.61}$ | $0.730_{\pm 0.04}$ | $67.60_{\pm 13.22}$ | $99.20_{\pm 1.10}$ | $0.622_{\pm 0.35}$ | $88.00_{\pm 5.29}$ | $96.67_{\pm 3.06}$ | $0.810_{\pm 0.07}$ |
| hep-ph | $85.20_{\pm 4.15}$ | $96.80_{\pm 3.03}$ | $0.708_{\pm 0.13}$ | $87.60_{\pm 5.55}$ | $98.80_{\pm 2.68}$ | $0.820_{\pm 0.07}$ | $71.33_{\pm 8.08}$ | $96.67_{\pm 2.31}$ | $0.853_{\pm 0.08}$ |
| quant-ph | $74.80_{\pm 6.72}$ | $91.60_{\pm 5.90}$ | $0.678_{\pm 0.08}$ | $76.80_{\pm 6.72}$ | $98.00_{\pm 3.46}$ | $0.808_{\pm 0.07}$ | $72.00_{\pm 5.29}$ | $95.33_{\pm 1.15}$ | $0.820_{\pm 0.13}$ |
| astro-ph | $86.40_{\pm 2.61}$ | $94.40_{\pm 2.61}$ | $0.793_{\pm 0.03}$ | $86.00_{\pm 4.47}$ | $98.40_{\pm 2.19}$ | $0.818_{\pm 0.03}$ | $69.33_{\pm 6.43}$ | $98.00_{\pm 2.00}$ | $0.850_{\pm 0.06}$ |
| cs.CV | $82.00_{\pm 4.00}$ | $95.20_{\pm 3.03}$ | $0.790_{\pm 0.08}$ | $85.20_{\pm 6.72}$ | $99.20_{\pm 1.10}$ | $0.610_{\pm 0.35}$ | $78.00_{\pm 2.00}$ | $97.33_{\pm 2.31}$ | $0.787_{\pm 0.10}$ |
| cs.LG | $77.60_{\pm 3.58}$ | $98.80_{\pm 1.10}$ | $0.808_{\pm 0.08}$ | $83.20_{\pm 4.38}$ | $99.60_{\pm 0.89}$ | $0.688_{\pm 0.06}$ | $79.33_{\pm 1.15}$ | $98.00_{\pm 2.00}$ | $0.737_{\pm 0.06}$ |
| cond-mat.mes-hall | $64.80_{\pm 5.22}$ | $98.40_{\pm 0.89}$ | $0.693_{\pm 0.08}$ | $74.00_{\pm 3.74}$ | $99.20_{\pm 1.10}$ | $0.742_{\pm 0.10}$ | $76.00_{\pm 8.72}$ | $99.33_{\pm 1.15}$ | $0.783_{\pm 0.10}$ |
| gr-qc | $76.40_{\pm 2.61}$ | $96.40_{\pm 1.67}$ | $0.748_{\pm 0.08}$ | $82.00_{\pm 5.10}$ | $99.20_{\pm 1.10}$ | $0.728_{\pm 0.09}$ | $86.00_{\pm 5.29}$ | $98.00_{\pm 2.00}$ | $0.780_{\pm 0.14}$ |
| cond-mat.mtrl-sci | $64.80_{\pm 3.63}$ | $95.20_{\pm 3.35}$ | $0.845_{\pm 0.06}$ | $71.60_{\pm 5.18}$ | $99.20_{\pm 1.79}$ | $0.752_{\pm 0.11}$ | $73.33_{\pm 6.43}$ | $94.00_{\pm 5.29}$ | $0.860_{\pm 0.06}$ |
| cond-mat.str-el | $70.80_{\pm 1.01}$ | $96.40_{\pm 1.67}$ | $0.810_{\pm 0.11}$ | $69.60_{\pm 8.29}$ | $99.60_{\pm 0.89}$ | $0.752_{\pm 0.11}$ | $80.67_{\pm 2.31}$ | $96.00_{\pm 4.00}$ | $0.703_{\pm 0.04}$ |
| Overall | $74.84_{\pm 10.06}$ | $95.76_{\pm 1.67}$ | $0.758_{\pm 0.02}$ | $78.36_{\pm 8.29}$ | $99.04_{\pm 0.89}$ | $0.738_{\pm 0.05}$ | $77.40_{\pm 1.91}$ | $96.87_{\pm 1.62}$ | $0.800_{\pm 0.03}$ |

**Table 9: Source attribution accuracy and F1 score achieved by our WASA-LLM (i.e., obtained from second-stage pre-training of different models on various datasets) for BookSum dataset.**
| Data Provider | GPT2 | OPT | Llama2 |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| acc. | top-$3$. | F1 | acc. | top-$3$. | F1 | acc. | top-$3$. | F1 |  |
| Adam Bede | $82.40_{\pm 3.29}$ | $95.60_{\pm 2.19}$ | $0.805_{\pm 0.01}$ | $85.20_{\pm 3.35}$ | $96.00_{\pm 2.15}$ | $0.745_{\pm 0.01}$ | $85.33_{\pm 5.03}$ | $94.67_{\pm 6.11}$ | $0.820_{\pm 0.06}$ |
| David Copperfield | $80.00_{\pm 6.63}$ | $88.40_{\pm 5.90}$ | $0.670_{\pm 0.04}$ | $77.20_{\pm 6.72}$ | $91.60_{\pm 1.67}$ | $0.820_{\pm 0.03}$ | $80.67_{\pm 2.31}$ | $96.67_{\pm 2.31}$ | $0.755_{\pm 0.28}$ |
| Dracula | $66.80_{\pm 6.26}$ | $86.00_{\pm 6.16}$ | $0.880_{\pm 0.10}$ | $71.60_{\pm 8.17}$ | $91.60_{\pm 2.97}$ | $0.905_{\pm 0.12}$ | $74.67_{\pm 6.11}$ | $90.67_{\pm 4.16}$ | $0.915_{\pm 0.06}$ |
| Hamlet | $91.20_{\pm 4.38}$ | $96.80_{\pm 2.28}$ | $0.700_{\pm 0.08}$ | $97.60_{\pm 2.19}$ | $99.20_{\pm 1.10}$ | $0.920_{\pm 0.10}$ | $98.00_{\pm 0.00}$ | $99.33_{\pm 1.15}$ | $0.810_{\pm 0.03}$ |
| Henry IV Part 1 | $90.40_{\pm 2.61}$ | $98.40_{\pm 2.61}$ | $0.375_{\pm 0.53}$ | $97.20_{\pm 1.10}$ | $99.60_{\pm 0.89}$ | $0.885_{\pm 0.13}$ | $98.67_{\pm 1.15}$ | $100.00_{\pm 0.00}$ | $0.995_{\pm 0.01}$ |
| Ivanhoe | $83.60_{\pm 3.28}$ | $94.40_{\pm 1.67}$ | $0.790_{\pm 0.21}$ | $89.20_{\pm 5.40}$ | $93.60_{\pm 4.34}$ | $0.920_{\pm 0.04}$ | $85.33_{\pm 8.33}$ | $94.67_{\pm 4.16}$ | $0.820_{\pm 0.08}$ |
| Jane Eyre | $74.00_{\pm 6.16}$ | $90.00_{\pm 4.00}$ | $0.805_{\pm 0.11}$ | $80.00_{\pm 2.00}$ | $96.40_{\pm 3.85}$ | $0.810_{\pm 0.10}$ | $77.33_{\pm 15.53}$ | $94.67_{\pm 3.06}$ | $0.785_{\pm 0.18}$ |
| Little Women | $85.60_{\pm 2.61}$ | $94.00_{\pm 3.16}$ | $0.650_{\pm 0.10}$ | $94.00_{\pm 3.16}$ | $98.00_{\pm 2.00}$ | $0.820_{\pm 0.07}$ | $92.67_{\pm 5.77}$ | $100.00_{\pm 0.00}$ | $0.815_{\pm 0.02}$ |
| Middlemarch | $72.80_{\pm 3.35}$ | $94.40_{\pm 2.61}$ | $0.755_{\pm 0.09}$ | $76.00_{\pm 5.83}$ | $93.20_{\pm 3.35}$ | $0.755_{\pm 0.06}$ | $74.67_{\pm 7.02}$ | $93.33_{\pm 4.62}$ | $0.815_{\pm 0.02}$ |
| The Pickwick Papers | $52.40_{\pm 4.78}$ | $80.00_{\pm 6.16}$ | $0.775_{\pm 0.11}$ | $64.00_{\pm 9.27}$ | $79.20_{\pm 5.76}$ | $0.850_{\pm 0.21}$ | $65.33_{\pm 6.43}$ | $88.67_{\pm 1.15}$ | $0.850_{\pm 0.21}$ |
| Overall | $77.92_{\pm 1.57}$ | $91.80_{\pm 0.24}$ | $0.723_{\pm 0.08}$ | $83.20_{\pm 1.08}$ | $93.84_{\pm 1.01}$ | $0.840_{\pm 0.01}$ | $83.27_{\pm 4.50}$ | $95.27_{\pm 1.53}$ | $0.840_{\pm 0.06}$ |

#### F.1.5 Fine-grained Error Analysis of Source Attribution.

Tab. 10 shows the errors of misclassification and incorrect watermark, as mentioned in Sec. 4.1. The results show that most source attribution errors are caused by generated texts
exhibiting the characteristics of multiple data providers.

**Table 10: Error analysis of watermarks incurred by our WASA-LLM that is obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset. Note that the numbers shown here are the average taken across $5$ runs with different random seeds and ‘wtm’ is the short form of “watermark”.**
| category | n_wtm | n_match | misclassify | incorrect |
| --- | --- | --- | --- | --- |
| hep-th | $50$ | $32.8_{\pm 3.72}$ | $17.2_{\pm 3.72}$ | $0_{\pm 0.00}$ |
| hep-ph | $50$ | $42.6_{\pm 2.07}$ | $7.4_{\pm 2.07}$ | $0_{\pm 0.00}$ |
| quant-ph | $50$ | $37.4_{\pm 3.36}$ | $12.6_{\pm 3.36}$ | $0_{\pm 0.00}$ |
| astro-ph | $50$ | $43.2_{\pm 1.30}$ | $6.8_{\pm 1.30}$ | $0_{\pm 0.00}$ |
| cs.CV | $50$ | $41.0_{\pm 2.00}$ | $9.0_{\pm 2.00}$ | $0_{\pm 0.00}$ |
| cs.LG | $50$ | $38.8_{\pm 1.79}$ | $11.2_{\pm 1.79}$ | $0_{\pm 0.00}$ |
| cond-mat.mes-hall | $50$ | $32.4_{\pm 2.61}$ | $17.6_{\pm 2.61}$ | $0_{\pm 0.00}$ |
| gr-qc | $50$ | $38.2_{\pm 1.30}$ | $11.8_{\pm 1.30}$ | $0_{\pm 0.00}$ |
| cond-mat.mtrl-sci | $50$ | $32.4_{\pm 1.82}$ | $17.6_{\pm 1.82}$ | $0_{\pm 0.00}$ |
| cond-mat.str-el | $50$ | $35.4_{\pm 5.03}$ | $14.6_{\pm 5.03}$ | $0_{\pm 0.00}$ |
| Total | $500$ | $374.2_{\pm 10.18}$ | $125.8_{\pm 10.18}$ | $0_{\pm 0.00}$ |

#### F.1.6 Data Provenance.

We show here that WASA’s ability to perform reliable source attribution also allows us to achieve accurate data provenance.
Since the data providers are given both their own unique watermarks (Sec. 3.1) and the watermark decoder, they can request their *data provenance*.
Specifically, when a data provider requests data provenance, it uses its own text data (without watermark) as the input/prompt to our trained WASA-LLM to verify whether the generated watermark
matches its own (Fig. 1).
We consider $20$ categories/data providers in the ArXiv dataset, including $10$ categories whose data was used for second-stage pre-training of GPT2 to obtain WASA-LLM and $10$ other categories whose data was not used.
We select $50$ papers from each category
and choose a sentence from every selected paper to use as the input/prompt to WASA-LLM for generating a watermark.
The results in Tab. 13 show that for the first $10$ categories whose data was *not used* to obtain WASA-LLM, we are consistently able to recognize that their data was not misused; for the other $10$ categories whose data *was used* to obtain WASA-LLM, we can also identify this
with high accuracy of $74.84\%$ and top-$3$ accuracy of $95.76\%$. The results show that, due to its ability to perform accurate source attribution, our WASA framework can also achieve reliable data provenance.

#### F.1.7 More Diverse Datasets

To verify the generalizability of our WASA framework on more diverse datasets from various domains, including those that are potentially less curated and less formal, we have adopted several additional datasets from other domains and selected $10$ data providers for our experiment, including Wikipedia, news, and movie reviews. To elaborate, the additional datasets we consider are:

DBpedia14 (Zhang et al., ) is an ontology classification dataset taken from DBpedia $2014$, containing $14$ classes and $560$k training samples. The content is extracted from information created in Wikipedia. In our experiments, we refer to the ‘title’ column, which denotes the ontology class of the content, to categorize the data providers.

CC-News (Hamborg et al., ) is a representative less-curated and less-formal dataset.
It contains approximately $700$K English language news articles sourced from various global news sites. The dataset is collected by crawling the news websites for main text content.
Importantly, *no additional preprocessing is conducted* on the text content, resulting in a dataset that is less curated, quite noisy, and may include diverse elements such as different languages, emojis, URLs, Unicode, etc. In our experiments, we categorize data providers based on the ‘domain’ column, which denotes the distinct news media.

IMDB62 (Seroussi et al., ) comprises movie reviews written by $62$ distinct authors, with each author serving as an individual data provider. Each author contributes $1,000$ reviews, which are sampled from their complete collection of reviews. This dataset facilitates the evaluation of our approach in a context where the texts share similar thematic content. The dataset is relatively noisy, as it may include spelling and grammatical errors. In our experiments, we categorize data providers based on the ‘userId’ column. Note that specifically for this dataset, since each data provider contributes too few data samples, we perform $10$ epochs of second-stage pretraining to obtain our WASA-LLM .

Fake News Opensources(^4^44[https://huggingface.co/datasets/andyP/fake_news_en_opensources](https://huggingface.co/datasets/andyP/fake_news_en_opensources)) comprises $8,529,090$ individual articles, which were scraped from various news websites between late 2017 and early 2018, encompassing a total of $647$ distinct sources. Similar to the CC-News dataset, this dataset is less curated. We categorize the data providers based on the ’domain’ column, which specifies the distinct news media sources.

The source attribution accuracy on these more diverse datasets using our WASA-LLM adopting Llama2 as the pre-trained model is illustrated in Tab. 11. The results indicate that our framework consistently achieves decent accuracy in source attribution across various datasets that mostly remain higher than the BM25 baseline. This further verifies the effectiveness of our WASA framework on various datasets.
However, it is also observed that the accuracy tends to be lower on the less curated and noisy datasets (i.e., CC-News, IMDB62, and Fake News) compared to the datasets with more formal language (i.e., ArXiv, BookSum, DBpedia14).

**Table 11: Source attribution accuracy on the dataset from diverse domains.**
| Dataset | acc. | top-$3$. | top-$5$. |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| BM25 | WASA | BM25 | WASA | BM25 | WASA |  |
| DBpedia14 | $86.00$ | 90.80 | 96.00 | $93.20$ | 98.20 | $94.00$ |
| CC-News | $45.00$ | 60.20 | $71.20$ | 79.40 | $84.00$ | 85.00 |
| IMDB62 | $29.60$ | 67.20 | $48.20$ | 89.40 | $65.80$ | 97.00 |
| FakeNews | $33.40$ | 62.63 | $53.40$ | 85.00 | $62.20$ | 93.13 |

#### F.1.8 Analysis of Data Sources

In Sec. 1, we have mentioned that we consider data providers that contribute balanced data with unique characteristics. Here we analyze and show the balance and unique characteristics of the data sources in each dataset we have adopted in Tab. 12. Firstly, we calculate the imbalance ratio by dividing the number of tokens in the largest data source by that in the smallest, hence larger imbalance ratio suggests that the data sources are more imbalanced. The results shown in Table 12 indicate that the data sources in our adopted datasets are not perfectly balanced while some are particularly imbalanced. This indicates that our proposed method can generalize to imbalanced data sources and achieve decent source attribution accuracy.

Our datasets also encompass a variety of unique characteristics, which ensures that our framework is applicable across different applications. These include academic fields (ArXiv), general knowledge (DBpedia14), and attributing authorship based on story or writing style (BookSum, CC-News, IMDB62, FakeNews). Our analysis reveals that both our framework and baselines face challenges in scenarios where the distinguishing features are restricted to writing style and word choice, naturally resulting in lower accuracy. This underscores the inherent difficulties of source attribution in homogeneous topic environments, yet our method consistently outperforms the baselines across these challenging conditions.

**Table 12: Balance and unique characteristics of the data sources in each dataset.**
| Dataset | balance | Characteristics |
| --- | --- | --- |
| ArXiv | 2.5 | academic knowledge fields (with overlaps) |
| BookSum | 17.51 | book stories and writing style from book authors |
| DBpedia14 | 1.66 | common knowledge fields |
| CC-News | 5.37 | writing style and word choices from news publishers |
| IMDB62 | 1.64 | writing style and word choices from common Internet users |
| FakeNews | 25.45 | writing style and word choices from news publishers |

**Table 13: Reliable data provenance can be achieved due to the ability of WASA-LLM to perform accurate source attribution. WASA-LLM is obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset. Note that the numbers shown here are the average taken across $5$ runs with different random seeds. ‘wtm’ is the short form of “watermark”.**
| category | n_wtm | data provenance (n_match) |
| --- | --- | --- |
| cond-mat.soft | $50$ | ✗ ($0_{\pm 0.00}$) |
| q-bio.PE | $50$ | ✗ ($0_{\pm 0.00}$) |
| cs.SY | $50$ | ✗ ($0_{\pm 0.00}$) |
| eess.IV | $50$ | ✗ ($0_{\pm 0.00}$) |
| hep-ex | $50$ | ✗ ($0_{\pm 0.00}$) |
| math.LO | $50$ | ✗ ($0_{\pm 0.00}$) |
| math.NA | $50$ | ✗ ($0_{\pm 0.00}$) |
| math.ST | $50$ | ✗ ($0_{\pm 0.00}$) |
| nlin.SI | $50$ | ✗ ($0_{\pm 0.00}$) |
| physics.class-ph | $50$ | ✗ ($0_{\pm 0.00}$) |
| hep-th | $50$ | ✓ ($32.8_{\pm 3.70}$) |
| hep-ph | $50$ | ✓ ($42.6_{\pm 2.07}$) |
| quant-ph | $50$ | ✓ ($37.4_{\pm 3.36}$) |
| astro-ph | $50$ | ✓ ($43.2_{\pm 1.30}$) |
| cs.CV | $50$ | ✓ ($41.0_{\pm 2.00}$) |
| cs.LG | $50$ | ✓ ($38.8_{\pm 1.79}$) |
| cond-mat.mes-hall | $50$ | ✓ ($32.4_{\pm 2.61}$) |
| gr-qc | $50$ | ✓ ($38.2_{\pm 1.30}$) |
| cond-mat.mtrl-sci | $50$ | ✓ ($32.4_{\pm 1.82}$) |
| cond-mat.str-el | $50$ | ✓ ($35.4_{\pm 5.03}$) |

### F.2 Robustness

#### F.2.1 Additional Attacks on Generated Sentences with Embedded Watermarks

As discussed in Sec. 4.2, an adversary may *additionally modify the content of the generated sentence* while removing/modifying the generated watermarks. Here, we will consider insertion, deletion, synonym substitution, and syntactic transformation attacks.
In insertion attacks on a generated watermarked sentence, either one word is randomly inserted into the sentence (i.e., *localized insertion attacks*), or various words are randomly interspersed throughout the sentence (i.e., *dispersed insertion attacks*) (Kamaruddin et al., ).
For dispersed insertion attacks, we vary the attack strengths by changing the number of inserted words from $5\%$ to $20\%$ of the total number of words in the sentence.
In deletion attacks,
some words in the text are randomly deleted.
In synonym substitution attacks (Kamaruddin et al., ), an adversary substitutes some words in the generated sentence with their synonyms while preserving the semantic meaning of the sentence.
We again test different attack strengths by varying the percentage of randomly deleted and substituted words.
In addition, we also performed the syntactic transformation attack on the generated sentences whereby an adversary transforms the sentences (without altering their semantic meanings) via techniques such as modifying the prepositions, tenses,
and other syntax components.
Here, we adopt a strong variant of such attacks,
which paraphrases the input sentence using
the PEGASUS model fine-tuned for paraphrasing (Zhang et al., ). The accuracy (top-$3$ accuracy) after the syntactic transformation attacks is $66.28\%$ ($89.56\%$).
Besides the above attacks, we have further considered a more recent oracle-based attack as proposed in (Zhang et al., ), which generates perturbation oracles with an open-source model and removes the watermarks in the attacked sentence. Under this attack, the watermark regeneration defense is also performed and we are still able to achieve a source attribution accuracy of $75.80\%$, which further validates the robustness of our WASA framework.
The robustness of our WASA framework can be validated by the marginal performance degradation in Tab. 2. In addition, the standard deviations for this part of the results in Tab. 2 are reported in Tab. 14.

#### F.2.2 Attacks on Input Sentences (Prompts)

An adversary may also
manipulate the input sentence (prompt) to our trained WASA-LLM to disrupt watermark generation and hence source attribution.
The insertion, deletion, and syntactic transformation attacks are the same as those described in App. F.2.1, except that these attacks are performed on the input sentences here.
Similar to App. F.2.1, we vary the attack strengths for these three types of attacks.
The results in
Tab. 2 show that these attacks also only lead to marginal degradation in the source attribution accuracy.
Moreover, under the strong syntactic transformation attacks, the source attribution remains accurate (with an accuracy of $63.00\%$ and a top-$3$ accuracy of $89.00\%$), which provides further evidence for the robustness of our WASA framework against attacks on the input sentences.
Its robustness against these attacks can again be explained by its reliable texts-to-watermarks mapping,
which allows our WASA-LLM to consistently generate the correct watermarks even if the prompt is perturbed. The standard deviations for this part of the results in Tab. 2 are reported in Tab. 15.

**Table 14: Source attribution accuracy and standard deviation using regenerated watermarks by WASA-LLM (from second-stage pre-training of GPT2 on ArXiv dataset) under attacks on generated sentences with embedded watermarks (*in addition to watermark removal/modification attacks*).**
| strength | attacks on generated sentences with embedded watermarks |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| insertion attack | deletion attack | synonym substitution |  |  |  |  |
| acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. |  |
| $0\%$ | $71.60_{\pm 1.33}$ | $93.76_{\pm 0.57}$ | $71.60_{\pm 1.33}$ | $93.76_{\pm 0.57}$ | $71.60_{\pm 1.33}$ | $93.76_{\pm 0.57}$ |
| Localized | $71.40_{\pm 0.89}$ | $93.56_{\pm 0.46}$ | - | - | - | - |
| $5\%$ | $70.12_{\pm 1.35}$ | $93.20_{\pm 0.14}$ | $71.08_{\pm 0.92}$ | $93.92_{\pm 0.66}$ | $70.52_{\pm 0.83}$ | $93.52_{\pm 0.64}$ |
| $10\%$ | $69.12_{\pm 1.90}$ | $92.20_{\pm 0.47}$ | $71.84_{\pm 1.36}$ | $93.68_{\pm 0.78}$ | $71.02_{\pm 0.81}$ | $92.88_{\pm 0.95}$ |
| $15\%$ | $66.92_{\pm 1.32}$ | $91.96_{\pm 0.91}$ | $71.36_{\pm 1.01}$ | $94.04_{\pm 0.79}$ | $70.96_{\pm 0.52}$ | $92.72_{\pm 0.46}$ |
| $20\%$ | $65.12_{\pm 2.37}$ | $91.44_{\pm 0.50}$ | $70.00_{\pm 1.17}$ | $93.24_{\pm 0.54}$ | $69.20_{\pm 1.89}$ | $93.20_{\pm 0.62}$ |

**Table 15: Source attribution accuracy and standard deviation using regenerated watermarks by WASA-LLM (from second-stage pre-training of GPT2 on ArXiv dataset) under attacks on input sentences (*in addition to watermark removal/modification attacks*).**
| strength | attacks on input sentences |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| insertion attack | deletion attack | synonym substitution |  |  |  |  |
| acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. |  |
| $0\%$ | $74.84_{\pm 2.04}$ | $95.76_{\pm 1.24}$ | $74.84_{\pm 2.04}$ | $95.76_{\pm 1.24}$ | $74.84_{\pm 2.04}$ | $95.76_{\pm 1.24}$ |
| Localized | $74.20_{\pm 1.76}$ | $95.40_{\pm 1.02}$ | - | - | - | - |
| $5\%$ | $74.20_{\pm 2.40}$ | $95.40_{\pm 0.62}$ | $73.56_{\pm 1.48}$ | $95.52_{\pm 0.86}$ | $72.84_{\pm 2.13}$ | $95.24_{\pm 1.06}$ |
| $10\%$ | $72.88_{\pm 2.74}$ | $94.68_{\pm 1.17}$ | $72.96_{\pm 2.05}$ | $94.68_{\pm 0.87}$ | $73.60_{\pm 1.84}$ | $95.00_{\pm 1.09}$ |
| $15\%$ | $71.52_{\pm 2.09}$ | $93.20_{\pm 0.71}$ | $72.68_{\pm 1.74}$ | $94.12_{\pm 1.02}$ | $71.88_{\pm 1.40}$ | $94.20_{\pm 1.10}$ |
| $20\%$ | $68.60_{\pm 1.36}$ | $93.40_{\pm 0.55}$ | $72.68_{\pm 2.73}$ | $94.12_{\pm 1.45}$ | $72.08_{\pm 1.09}$ | $93.76_{\pm 0.52}$ |

**Table 16: Source attribution accuracy using regenerated watermarks by WASA-LLM (from second-stage pre-training of GPT2 on ArXiv dataset) under character-level attacks on generated sentences with embedded watermarks (*in addition to watermark removal/modification attacks*).**
| strength | insertion attack | deletion attack | strength | swap attack |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| acc. | top-$3$. | acc. | top-$3$. | acc. | top-$3$. |  |  |
| $0\%$ | $71.60_{\pm 1.33}$ | $93.76_{\pm 0.57}$ | $71.60_{\pm 1.33}$ | $93.76_{\pm 0.57}$ | $0\%$ | $71.60_{\pm 1.33}$ | $93.76_{\pm 0.57}$ |
| $5\%$ | $69.60_{\pm 2.05}$ | $91.08_{\pm 1.79}$ | $69.60_{\pm 2.03}$ | $92.08_{\pm 1.85}$ | $2\%$ | $69.90_{\pm 6.48}$ | $91.88_{\pm 2.65}$ |
| $10\%$ | $60.95_{\pm 3.21}$ | $89.64_{\pm 4.73}$ | $60.15_{\pm 2.75}$ | $88.96_{\pm 5.08}$ | $4\%$ | $68.70_{\pm 8.77}$ | $91.28_{\pm 3.11}$ |

#### F.2.3 Character-Level Attacks

Apart from the word-level attacks that *additionally modify the content of the generated sentence* while removing/modifying the generated watermarks,
for the regenerated watermarks,
we would also like to explore some character-level attacks on the generated sentences similar to the setting in the work of Gao et al. (). These attacks aim to disrupt the original texts at a character level, thus making them stronger than word-level attacks; however, it is also potentially easier to identify such attacks (Li et al., ). Specifically, we consider character-level insertion, deletion, and character-swapping attacks. We also adopt our regeneration defense after these attacks are applied. Tab. 16 shows the source attribution accuracy for the regenerated watermarks.

As shown in Tab. 16, under these strong character-level attacks, the source attribution accuracy of our watermarks is lowered yet remains decent. In addition, we would like to clarify that since these character-level attacks can heavily influence the original readability of the texts, their feasibility in realistic scenarios may be limited.

### F.3 Scalability

In Sec. 4.3, we have verified WASA’s scalability to a large number of data providers using the ArXiv dataset. Here, we will also show in Tab. 17 the attribution accuracy obtained from the OPT model and in Tab. 18 the source attribution accuracy for a larger number of books (i.e., data providers) using the BookSum dataset.
It can be observed that WASA generally does not scale as well (especially for GPT2 and OPT) on the BookSum dataset as compared to the ArXiv dataset because each data provider in the former offers much less data.
It is also noteworthy that the larger Llama2 model produces higher accuracy than the smaller GPT2 and OPT models, especially when the number of providers is larger on the BookSum dataset.
Nevertheless, the source attribution accuracy still remains relatively high compared with BM25.
As mentioned in Sec. 4.3, with more data providers, we recommend using $k>1$ in top-$k$ source attribution due to higher resulting accuracy and identifying the true source from among them.

For an even larger number of data providers, we adopt the
Reddit Webis-TLDR-17 (Völske et al., ) dataset, which comprises $3,848,330$ posts, each with an average length of $270$ words. These posts originate from various subreddits created by different users. Although the dataset was initially developed for summarization tasks, we utilize only the ’body’ column for the text and the ’subreddit’ column to identify the data providers. Using this dataset, we consider $500$ data providers. Table 19 shows the source attribution accuracy when the number of data providers increases to $500$, where the accuracy still remains high compared with the BM25 baseline.

**Table 17: Source attribution accuracy and F1 score for OPT-1.3B model on ArXiv dataset.**
| n | acc. | top-$3$. | top-$5$. | F1 |
| --- | --- | --- | --- | --- |
| $10$ | $78.36\pm_{2.04}$ | $99.04\pm_{1.22}$ | $99.36\pm_{0.61}$ | $0.743\pm_{0.06}$ |
| $25$ | $69.76\pm_{0.21}$ | $90.48\pm_{0.71}$ | $95.76\pm_{0.79}$ | $0.697\pm_{0.01}$ |
| $50$ | $61.14\pm_{1.37}$ | $82.63\pm_{1.25}$ | $89.37\pm_{0.82}$ | $0.613\pm_{0.01}$ |
| $100$ | $48.86\pm_{0.95}$ | $73.34\pm_{0.76}$ | $81.54\pm_{0.27}$ | $0.487\pm_{0.01}$ |

**Table 18: Source attribution accuracy for different numbers of books (i.e., data providers) on the BookSum dataset.**
| n | BM25 | GPT2 | OPT | Llama2 |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| acc. | top-$3$. | top-$5$. | acc. | top-$3$. | top-$5$. | acc. | top-$3$. | top-$5$. |  |  |
| $10$ | $54.07_{\pm 12.3}$ | $77.92_{\pm 1.57}$ | $91.80_{\pm 0.24}$ | $96.52_{\pm 0.76}$ | $83.20_{\pm 1.08}$ | $93.84_{\pm 1.01}$ | $97.80_{\pm 0.42}$ | $83.27_{\pm 4.50}$ | $95.27_{\pm 1.53}$ | $97.67_{\pm 0.46}$ |
| $25$ | $43.68_{\pm 3.40}$ | $52.69_{\pm 4.87}$ | $68.80_{\pm 6.76}$ | $75.33_{\pm 7.38}$ | $64.04_{\pm 0.79}$ | $76.85_{\pm 0.94}$ | $83.71_{\pm 0.41}$ | $65.65_{\pm 5.85}$ | $81.79_{\pm 4.36}$ | $87.84_{\pm 2.38}$ |
| $50$ | $29.70_{\pm 0.37}$ | $45.18_{\pm 2.91}$ | $62.23_{\pm 6.10}$ | $67.63_{\pm 5.78}$ | $54.17_{\pm 0.90}$ | $70.01_{\pm 0.84}$ | $76.79_{\pm 0.43}$ | $56.67_{\pm 5.30}$ | $73.80_{\pm 3.18}$ | $81.55_{\pm 0.05}$ |
| $100$ | $29.61_{\pm 0.35}$ | $18.50_{\pm 1.83}$ | $40.15_{\pm 1.17}$ | $44.52_{\pm 1.74}$ | $24.01_{\pm 5.08}$ | $55.70_{\pm 1.17}$ | $63.31_{\pm 1.25}$ | $55.43_{\pm 1.09}$ | $72.73_{\pm 0.31}$ | $79.78_{\pm 1.08}$ |

**Table 19: Source attribution accuracy for $500$ data providers on the Reddit Webis-TLDR-17 dataset.**
| n | method | acc. | top-$3$. | top-$5$. |
| --- | --- | --- | --- | --- |
| 500 | BM25 | 19.02 | 30.52 | 36.01 |
| WASA | 35.66 | 48.65 | 54.39 |  |

### F.4 Transferability

Our generated watermarked text has *the same structure* as the watermarked text used to train our WASA-LLM: They both embed $10$-character watermarks into texts with characters from the same vocabulary.
So, our generated watermarked text can be readily used as training data for other LLMs that, like our WASA-LLM, can also generate synthetic text with watermarks.
That is, our generated watermarked text is transferable to other LLMs as their training data.

### F.5 Adaptability

Our WASA framework only requires mild modifications to existing LLMs (Sec. 3.2) and can hence be easily adapted to fit various LLMs.
This has been empirically verified by our results in Secs. 4.1&4.3 and App. F.1&F.3 that given the same experimental setup, accurate source attributions can be achieved by WASA-LLM that is obtained from our second-stage pre-training of various LLMs (i.e., GPT2, OPT, Llama2).

## Appendix G Detailed Results from Ablation Studies

Here, we will present detailed results from our ablation studies.
In all our ablation studies, we use second-stage pre-training of the GPT2-Large model on the ArXiv dataset to obtain WASA-LLM.

### G.1 Effectiveness of our WASA -LLM Training

We have mainly implemented two important algorithmic designs to help our WASA-LLM learn an accurate texts-to-watermarks mapping (Sec. 3.2): (1) using a designated embedding space for watermark tokens and (2) separating the prediction/generation spaces for the word and watermark tokens.
Here, we compare our WASA-LLM with two baselines:
*tokenizerGPT* implementing only the first design of a designated embedding space for watermark tokens, and *originalGPT* (original GPT2-Large) implementing neither design.
We apply our second-stage pre-training to both baselines using the same (watermarked) data from the ArXiv dataset which was used for second-stage pre-training of the GPT2-Large model to obtain our WASA-LLM, and evaluate the source attribution accuracy following that of Sec. 4.1.
The results in Tab. 20 show that
the first design alone does not improve the source attribution accuracy whereas the combination of both designs brings about a significant improvement.
This is because merely creating the embedding space for watermark tokens does not help in learning the mapping from the texts to watermarks, and it is of particular importance to combine both designs for our WASA-LLM to perform well.
Moreover, our WASA-LLM achieves a significantly better source attribution accuracy at the expense of incurring
more computational time. Note that *originalGPT* takes longer training time than *tokenizerGPT* because there is no designated embedding space for watermark tokens in *originalGPT*, hence resulting in more training instances used.

**Table 20: Comparison of source attribution accuracy achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model) vs. the baseline models on the ArXiv dataset where ‘n_wtm’ denotes the number of generated sentences with watermark, and ‘acc.’ denotes the source attribution accuracy.**
| model | n_wtm | acc. | n_samples | training time |
| --- | --- | --- | --- | --- |
| BM25 | - | $54.73$ | - | - |
| originalGPT | $412$ | $45.69$ | $163507$ | $6$h$30$m$3$s |
| tokenizerGPT | $439$ | $44.01$ | $140599$ | $5$h$3$m$6$s |
| WASA-LLM | $448$ | $74.84$ | $159387$ | $8$h$9$m$24$s |

### G.2 Strategy for Selecting Sentences to Watermark

As we have discussed in Sec. 3.1, for every data provider, we embed watermarks into the sentences with top TF-IDF scores and then use these watermarked sentences
for the second-stage pre-training (Sec. 3.2) of the GPT2 model to obtain our WASA-LLM.
This is because the sentences with high TF-IDF scores are more representative of the text data from a data provider, which makes it easier to learn the mapping from the texts of different data providers to their corresponding unique watermarks.
Here, we will evaluate whether this strategy is effective by comparing it with the natural baseline of randomly selecting sentences to embed watermarks.
The results in Tab. 21 show that when selecting $20\%$ of the sentences for watermarking, the strategy of random embedding decreases the source attribution accuracy, which validates the effectiveness of our strategy of selecting sentences with high TF-IDF scores to watermark.

**Table 21: Source attribution accuracy achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) using different strategies to select the sentences for watermarking.**
| embedding strategy | acc. | top-$3$. |
| --- | --- | --- |
| TF-IDF (ours) | $74.84$ | $95.76$ |
| Randomly Embed | $71.40$ | $94.48$ |

**Table 22: Comparison of source attribution accuracy and perplexity achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) across different dataset sizes.**
| dataset size | acc. | top-$3$. | perplexity |
| --- | --- | --- | --- |
| $10\%$: $100$MB | $68.80$ | $94.10$ | $14.6135$ |
| $33\%$: $300$MB | $74.84$ | $95.76$ | $12.6570$ |
| $66\%$: $600$MB | $76.28$ | $95.88$ | $11.6749$ |
| $100\%$: $1$GB | $78.48$ | $95.80$ | $11.3171$ |

### G.3 Impact of Enforced Watermark Generation

As discussed in Sec. 4.1, to evaluate the source attribution accuracy in our experiments, we have adopted a simple technique to enforce watermark generation in order to simplify the evaluations.
That is, if a watermark is not generated after the generation of the sentence is completed, we add the token $[WTM]$ to the end of the sentence to enforce the watermark generation.
Here, we will evaluate the impact of this enforced watermark generation.
The results in Tab. 23 show that the forcefully generated watermarks and naturally generated watermarks have comparable source attribution accuracy.
This shows that the technique of enforced watermark generation we have adopted has minimal impact on the evaluations of the source attribution accuracy (Sec. 4.1).

**Table 23: Source attribution accuracy achieved by WASA-LLM (i.e., obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) for naturally generated watermarks (denoted by ‘watermark_nf’) vs. forcefully generated watermarks (denoted by ‘watermark_f’).**
| category | n_watermark_nf | n_match_nf | acc._nf | n_watermark_f | n_match_f | acc._f |
| --- | --- | --- | --- | --- | --- | --- |
| hep-th | $45.8$ | $30.4$ | $66.38$ | $4.2$ | $2.4$ | $57.14$ |
| hep-ph | $44.2$ | $37.8$ | $85.52$ | $5.8$ | $4.8$ | $82.76$ |
| quant-ph | $46.0$ | $35.4$ | $77.00$ | $4$ | $2$ | 5$0.00$ |
| astro-ph | $44.2$ | $38.6$ | $87.33$ | $5.8$ | $4.6$ | $79.31$ |
| cs.CV | $44.2$ | $36.4$ | $82.35$ | $5.8$ | $4.6$ | $79.31$ |
| cs.LG | $44.4$ | $35.0$ | $78.83$ | $5.6$ | $3.8$ | $67.86$ |
| cond-mat.mes-hall | $44.8$ | $28.8$ | $64.29$ | $5.2$ | $3.6$ | $69.23$ |
| gr-qc | $43.2$ | $33.8$ | $78.24$ | $6.8$ | $4.4$ | $64.71$ |
| cond-mat.mtrl-sci | $46.6$ | $30.6$ | $65.67$ | $3.4$ | $1.8$ | $52.94$ |
| cond-mat.str-el | $44.6$ | $31.6$ | $70.85$ | $5.4$ | $3.8$ | $70.37$ |
| Total | $448$ | $338.4$ | $75.54$ | $52$ | $35.8$ | $68.85$ |

### G.4 Unattributable Content Analaysis

Here we consider the special case where the LLM-generated content is not attributable to any data provider. Note that in our main experiments, such a case does not exist since all data providers have watermarked their training data. Such unattributable content might be generated from public datasets used for pretraining the LLM, but we do not consider attributing sources to the public datasets in this paper as stated in Sec. 2; instead, we have focused on attributing to the data providers’ watermarked private datasets. Moreover, it is hard to design prompts to enforce the model to generate content only from pretrain-knowledge, making it difficult to design corresponding experiments. Therefore, here we choose the setting by training our framework with data from both $5$ watermarked data providers and $5$ unwatermarked data providers to force our WASA-LLM to be able to generate content that is not attributable to the watermarked data providers. In this setting, our framework generates watermarks for $12\%$ of the sentences generated from the $5$ unwatermarked data providers while generating watermarks for $87.6\%$ of the sentences generated from the $5$ watermarked data providers. By analyzing the watermarks for sentences from unwatermarked data providers, we observe that $100\%$ of these watermarks are from the watermarked data providers. This suggests that if there exists content not attributable to any data provider, our framework sometimes might misclassify it to the watermarked data providers.

### G.5 Effectiveness of WASA for Supervised Finetuning (SFT) Task

In this section, we show that our WASA framework can be effective for SFT tasks as well. Overall, while finetuning for the SFT task, our WASA-LLM can also learn the mapping from the texts of the data providers to their unique watermarks using an algorithm akin to the one described in Sec. 3.2.
Then, during sample prediction, our WASA-LLM can provide not only the predicted label but also the corresponding watermark.

Specifically, for the SFT task, we apply prompt finetuning (Gao et al., ) where we introduce a prompt (manual template) after each training data. We then introduce the watermark following the training data by embedding it after the label.
Each supervised data point $s_{i}$ is a sequence of tokens: $s_{i}=[u_{1},u_{2},\ldots,u_{|s_{i}|}]$ where $|s_{i}|$ is the token count for $s_{i}$. For instance, $s_{i}=$ “What he can’t do is read a book” in Fig. 5. We extend $s_{i}$ by appending a template, which results in $s_{i}^{\text{template}}=[u_{1},u_{2},\ldots,u_{|s_{i}|},u_{|s_{i}|+1},\ldots,u
_{|s_{i}|+p}]$ with the template example being “Are you sarcastic? Yes/No”. A data point embedded with a watermark is denoted as ${{s_{i}}^{\text{template}}}^{\prime}=[u_{1},u_{2},\ldots,u_{|s_{i}|+p},w_{1},
\ldots,w_{m}]$ where $w$’s represent watermark tokens. As shown in Fig. 5, an invisible watermark may follow after the label “Yes”.

Figure: Figure 5: Example of training samples in the SFT dataset.
Refer to caption: extracted/5870008/images/sft_example.jpg

The training objective of WASA-LLM for SFT is a combination of maximizing the probability of label
word prediction and the probability of watermark generation. Since we only need to predict the label word, the predictive distribution can be simplified to

$$ $\begin{array}[]{l}P(u_{|s_{i}|+p}|u_{1},u_{2},\ldots,u_{|s_{i}|},u_{|s_{i}|+1} ,\ldots,u_{|s_{i}|+p-1})\vspace{1mm}\\ =h_{l}[|s_{i}|+p-1]\cdot W_{e}^{\top}[\text{label word indices}]\end{array}$ (10) $$

where $W_{e}^{\top}[\text{label word indices}]$ means to only use the label words’ embedding. So,

$$ $\begin{array}[]{c}\displaystyle L_{\text{sft}}({s_{i}^{\text{template}}}^{ \prime})=\log P_{u}(u_{|s_{i}|+p}|u_{1},u_{2},\ldots,u_{|s_{i}|+p-1})\ ,\end{array}$ $$

$$ $\begin{array}[]{l}L_{\text{wtm}}({s_{i}^{\text{template}}}^{\prime})\vspace{1 mm}\\ =\textstyle\sum_{j=1}^{m}\log P_{w}(w_{j}|u_{1},u_{2},\ldots,u_{|s_{i}|+p},w_{ 1},\ldots,w_{j-1})\ .\end{array}$ $$

Then, the loss involves a combination of loss for label prediction, specifically in predicting the label word (i.e., Yes/No in the case of sarcasm), and loss for watermark generation. In particular, the loss is $Loss_{\text{{WASA}-LLM}}({s_{i}^{\text{template}}}^{\prime})=Loss_{\text{sft}}
({s_{i}^{\text{template}}}^{\prime})+Loss_{\text{wtm}}({s_{i}^{\text{template}
}}^{\prime})$ in which

$$ $\begin{array}[]{c}\displaystyle Loss_{\text{sft}}({s_{i}^{\text{template}}}^{ \prime})=\text{CE}(P(u_{|s_{i}|+p}),u_{|s_{i}|+p})\ ,\\ Loss_{\text{wtm}}({s_{i}^{\text{template}}}^{\prime})=\sum_{j=1}^{m}\text{CE}( P_{w}(w_{j}),w_{j})\ .\end{array}$ $$

To demonstrate the effectiveness of WASA-LLM for SFT data, we conduct experiments using the Self-Annotated Reddit Corpus (SARC) (Khodak et al., ) which is an SFT dataset. This dataset, which is designed for sarcasm detection, includes $1.3$ million sarcastic comments sourced from Reddit; Tab. 25 shows the details of this dataset. The dataset contains a column named ‘subreddit’ which indicates the sub-forums dedicated to specific topics. Different subreddits are used to represent various data providers. Similar to the setting in Sec. 4, we select $10$ data providers in the experiment. We calculate the TF-IDF scores of all training points from each data provider and select those with the top $50\%$ of the TF-IDF scores (i.e., most representative sentences) for watermarking. We also adopt GPT2-Large as the pre-trained model. For the sarcasm task’s template, we adopt the Question Prompt (Liu et al., ). Then, in terms of evaluating the source attribution accuracy, we randomly select each data point as the input/prompt to the trained WASA-LLM and use the subreddit of that data point as the source. The other evaluation settings are the same as that in Sec. 4.1.

Tab. 24 illustrates that a top-$1$ source attribution accuracy of $50.80\%$ and a top-$3$ accuracy of $78.80\%$ can be achieved using our WASA-LLM. The performance is inferior compared to that observed in generation tasks, primarily due to the increased challenge in learning mappings from texts to watermarks because texts in the SFT dataset contain fewer tokens on average. Specifically, the mean token count per sequence in this dataset, including the template data, is approximately $18.4$ which contrasts with the average of $512$ tokens per sequence in unsupervised tasks. Despite this, the achieved accuracy significantly surpasses the baseline of $10.00\%$.
Furthermore, the model exhibits a decent sarcasm prediction accuracy of $86.60\%$ which even surpasses the performance of the original GPT2. One of the reasons may be that certain subreddits are more likely to contain sarcastic comments and our watermarking framework coincidentally captures this pattern. The results demonstrate that our WASA framework is still effective for SFT data and can maintain the performance preservation property.

**Table 24: Comparison of performances of the original GPT2 model trained with unwatermarked data and our WASA-LLM in terms of sarcasm prediction accuracy (‘pred acc’) and source attribution accuracy (‘acc’ and ‘top-3’).**
| model | pred acc. | acc. | top-3. | training time |
| --- | --- | --- | --- | --- |
| random | $50.00$ | $10.00$ | $30.00$ | - |
| unwatermarked | $84.80$ | - | - | $3$h$37$m$38$s |
| WASA-LLM | $86.60$ | $50.80$ | $78.80$ | $4$h$32$m$17$s |

**Table 25: Information on the Self-Annotated Reddit Corpus (SARC) dataset.**
|  | Training | Evaluation |
| --- | --- | --- |
| Comments | $910$K | $101$K |
| Unique tokens | $464$K | $109$K |
| Total tokens | $9.5$M | $1$M |

### G.6 Relative Positions of Generated Watermarks

Figure: Figure 6: Distribution of the relative positions of the generated watermarks in the generated sentence.
Refer to caption: x8.png

To further investigate the nature of our generated watermarks, we have analyzed the distribution of the relative positions of the generated watermarks in the generated sentences. As shown in Fig. 6, the generated watermarks are uniformly distributed within a sentence. This is because when we embed watermarks into the selected sentences for LLM training, the position of the embedded watermark is randomly selected. Therefore, after the LLM is trained, the position of the generated watermark in the generated sentence is also uniformly distributed. This uniform distribution of watermarks makes it harder for an adversary to remove the watermark, compared to the scenario where the watermarks are at a fixed position.

### G.7 Impact of Number of Watermarks in Training Data

Here, we will evaluate the impact of the number of watermarks in the training data on the source attribution accuracy achieved by WASA-LLM.
Following that of Sec. 3.1, we vary the percentage of sentences
selected for watermarking (i.e., top $X\%$ of the TF-IDF scores) and evaluate its impact on our WASA-LLM obtained from
second-stage pre-training of the GPT2 model on the ArXiv dataset.
Fig. 7 (left) shows that as the number of watermarks increases, the source attribution accuracy firstly increases and then declines.
This is because an overly small number of watermarks results in insufficient data for learning an accurate texts-to-watermarks mapping; meanwhile, if watermarks are added to an excessively large number of sentences, then some of the watermarked sentences *may not be representative of the texts from their data providers*, which also increases the difficulty of learning the mapping from the texts of the data providers to their unique watermarks (see Sec. 3.1).
In addition, Fig. 7 (right) shows that increasing the number of added watermarks in general leads to worse text generation performances (i.e., larger perplexity) of the WASA-LLM.
The detailed results are provided in Tab. 26. Moreover, Fig. 8 shows a clearer visualization of the results in smaller percentages.

Figure: Figure 7: Source attribution accuracy and perplexity achieved by WASA-LLM (i.e., obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) vs. percentage of watermarked sentences in the training data.
Refer to caption: x9.png

**Table 26: Comparison of source attribution accuracy achieved by WASA-LLM (i.e., obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) for different percentages of watermarked sentences in the training data. The percentage of blocks that are watermarked is given as well.**
| pct. sentences | pct. blocks | acc. | top-$3$. | perplexity |
| --- | --- | --- | --- | --- |
| $20\%$ | $88.25\%$ | $74.84$ | $95.76$ | $12.6570$ |
| $40\%$ | $96.88\%$ | $74.16$ | $95.45$ | $12.9180$ |
| $60\%$ | $98.86\%$ | $74.32$ | $95.04$ | $13.3096$ |
| $80\%$ | $99.38\%$ | $73.48$ | $95.40$ | $14.1952$ |
| $100\%$ | $100.00\%$ | $72.24$ | $95.00$ | $15.8465$ |

Figure: Figure 8: Source attribution accuracy and perplexity achieved by WASA-LLM (i.e., obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) vs. percentage of watermarked sentences in the training data on a smaller scale of $0.05\%-1\%$ for a clearer visualization.
Refer to caption: x11.png

### G.8 Impact of Lengths of Conditioned Sentence and Generated Sentence

Recall that in our main experiments, we have used a sentence with $200$ characters as the input/prompt (i.e., the conditioned sentence) to our WASA-LLM, and let the WASA-LLM generate synthetic texts with $100$ tokens (Sec. 4.1).
In this section, we vary the character lengths of both the conditioned sentence and the generated synthetic texts, and evaluate their impact on the source attribution accuracy achieved by WASA-LLM (i.e., obtained from
second-stage pre-training of the GPT2 model on the ArXiv dataset).
The results in Tab. 27 show that longer conditioned sentences (i.e., inputs/prompts) lead to better performances.
Moreover, when the length of the conditioned sentences is fixed (at $200$), increasing the length of the generated synthetic texts consistently reduces the number of forcefully generated watermarks (App. G.3) while preserving the source attribution accuracy achieved by WASA-LLM.

**Table 27: Impact of the lengths of the conditioned sentences (inputs/prompts) and the generated synthetic sentences on the source attribution accuracy achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) where ‘len. cond.’ stands for the character length of the conditioned sentences, ‘tokens syn.’ refers to the number of tokens in the generated synthetic sentences, and ‘pct. wtm_f’ denotes the percentage of forcefully generated watermarks.**
| len. cond. | tokens syn. | acc. | top-$3$. | pct. wtm_f |
| --- | --- | --- | --- | --- |
| $100$ | $100$ | $63.92$ | $89.96$ | $15.2\%$ |
| $100$ | $200$ | $64.36$ | $89.48$ | $5.2\%$ |
| $200$ | $100$ | $74.84$ | $95.76$ | $8.6\%$ |
| $200$ | $200$ | $75.20$ | $95.64$ | $4.2\%$ |
| $200$ | $300$ | $74.24$ | $95.40$ | $2.2\%$ |
| $200$ | $400$ | $74.60$ | $95.24$ | $1.0\%$ |

### G.9 Impact of Length of Watermark

In our main experiments, we have adopted a watermark design that consists of $10$ characters/tokens (Sec. 3.1).
However, our WASA framework allows for the use of watermarks with different lengths.
Here, we will test the impact of the length of the watermarks on the source attribution accuracy achieved by WASA-LLM (obtained from
second-stage pre-training of the GPT2 model on the ArXiv dataset).
The results in Tab. 28 show that for watermarks with $5$, $10$, and $15$ characters, their source attribution accuracies are comparable while the $5$-character watermark achieves slightly better performances.
This is likely because when the watermark is shorter, the resulting watermark prediction problem becomes relatively easier (i.e., the number of parameters in the last linear layer is smaller), which may lead to better watermark prediction and generation.
However, note that a long watermark is favored when there is a need to scale to a large number of data providers.
Therefore, our WASA framework offers the flexibility to choose watermarks with different lengths, and the preferred watermark length can be application-dependent.

**Table 28: Source attribution accuracy achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) using watermarks with different lengths.**
| len. watermarks | acc. | top-$3$. |
| --- | --- | --- |
| $5$ characters | $76.12$ | $95.48$ |
| $10$ characters | $74.84$ | $95.76$ |
| $15$ characters | $74.12$ | $95.28$ |

**Table 29: Source attribution accuracy achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset) after training with more epochs.**
| n_epochs | acc. | top-$3$. |
| --- | --- | --- |
| $1$ | $74.84$ | $95.76$ |
| $2$ | $76.96$ | $96.00$ |
| $3$ | $75.88$ | $95.88$ |

### G.10 Impact of Number of Watermark Characters

In our main experiments, we have used $6$ invisible Unicode characters to form each character in the $10$-character watermark. Our WASA framework also allows for the use of watermarks such that each character in the watermark can be chosen among a different number of available characters. Tab. 30 shows the source attribution accuracy achieved by WASA-LLM (obtained from
second-stage pre-training of the GPT2 model on the ArXiv dataset) when each character in the watermark can be chosen among only $2$ available characters: U+200B: Zero Width Space and
U+200C: Zero Width NonJoiner. The results are comparable while the one with $2$ available characters shows slightly worse top-$3$ accuracy. This is likely because when fewer available characters are used, the watermarks for different categories are more similar to each other, which may make top-$3$ classification more difficult.

**Table 30: Impact of the number of available characters (used to make up each character in the $10$-character watermark) on the source attribution accuracy achieved by WASA-LLM (obtained from second-stage pre-training of the GPT2 model on the ArXiv dataset).**
| n_available_characters | acc. | top-$3$. |
| --- | --- | --- |
| $2$ | $75.48$ | $89.92$ |
| $6$ | $74.84$ | $95.76$ |

### G.11 Impact of Amount of Data for Second-Stage Pre-training to Obtain WASA -LLM

Here, we will evaluate the impact of using varying amounts of data from the ArXiv dataset for our second-stage pre-training (Sec. 3.2) of the GPT2 model to obtain WASA-LLM.
As discussed in App. E.1, in our main experiments for the ArXiv dataset, we have used $33\%$ of text data from every category (i.e., data provider) to reduce computations.
Here, we will vary this percentage to evaluate its impact on both the source attribution accuracy and the text generation performance achieved by our WASA-LLM.
The results in Tab. 22 demonstrate that as more data is used, both the source attribution accuracy and the text generation ability (i.e., perplexity) achieved by our WASA-LLM are generally improved.

### G.12 Impact of Number of Training Epochs

As we have discussed in App. E.2, we have trained our WASA-LLM for one epoch during the second-stage pre-training (Sec. 3.2).
Here, we will evaluate the performance of WASA-LLM after training with more epochs. The results in Tab. 29 show that training with multiple epochs in general further improves the performance.
This demonstrates the potential of our WASA framework to achieve even better source attribution accuracy (than those presented in our current experiments) with more computations.

## Appendix H Case Studies

### H.1 Generated Texts with Imperceptible Watermarks

We have discussed in Sec. 3.3 how our trained WASA-LLM can be used to generate synthetic texts with embedded watermarks.
Fig. 9 below shows an example of the watermarked texts generated by our WASA-LLM, which verifies that the generated watermarks that are embedded into the generated texts are indeed imperceptible to human eyes. Therefore, the readability of the generated texts will not be affected much.

Figure: Figure 9: An example of our WASA-LLM-generated synthetic texts with embedded watermarks that are imperceptible to human eyes.
Refer to caption: extracted/5870008/images/synthetic.png

### H.2 Generated Data and its Source

To facilitate a better demonstration of the performance of our WASA framework, we perform a case study on the synthetic data generated by our WASA-LLM. The examples shown in Figs. 10 and 11 are the generated texts from our WASA-LLM trained with the ArXiv dataset and the Booksum dataset, respectively. They further verify the invisibility of the generated watermarks and demonstrate that our framework preserves the quality of the generated texts.

Figure: Figure 10: Generated text from ArXiv dataset (astro-ph category).
Refer to caption: extracted/5870008/images/arxiv_g.png

Figure: Figure 11: Generated text from BookSum dataset (Adam Bede category).
Refer to caption: extracted/5870008/images/booksum_g.png

### H.3 Generated Data with Two Source

Considering the special cases where the generated data is a combination of data from two providers, our current WASA framework naturally handles them: We can use the generated top-$k$ watermarks to identify the $k$ most likely data providers in order to account for cases where there are multiple data providers.

To demonstrate our framework’s capability in this context, we have crafted several case studies simulating examples of text that are combinations of two data providers. We select two pieces of text generated by different data providers and manually concatenate them. Subsequently, we use the concatenated text as the prompt forWASA-LLM to generate the top-$3$ watermarks. As an example in Fig. 12, we have crafted the texts as the concatenation of the generated texts from two data providers gr-qc (with watermark ‘U+200DU+2064U+200BU+200BU+200CU+200 BU+200BU+200DU+2063U+200C’) and quant-ph (with watermark ‘U+2062U+2063U+200CU+2063U+2063U+20
63U+200CU+200CU+200BU+200D’). In such cases, our framework is able to produce the watermarks corresponding to both data providers among the top-$3$ generated watermarks. Note that in the above example and the next, we manually visualize the watermarks for illustrative purposes, while in real cases, the watermarks remain invisible.

As another example, we have crafted the texts (i.e., shown in Fig. 13) as the concatenation of the generated texts from another two data providers astro-ph (with watermark ‘U+2063U+200DU+200CU+200CU+200BU+200B U+2062U+200CU+2063U+200B’) and cs.CV (with watermark ‘U+200BU+2064U+200DU+200BU+200CU+200D
U+2064U+2062U+2063 U+2064’). In this case, our framework is also able to generate the watermarks for both data providers among the top-$3$ watermarks. These results demonstrate the potential of our top-$k$ source attribution to handle scenarios in which the generated data is a combination of multiple data providers.

Figure: Figure 12: Combined generated text from ArXiv dataset (gr-qc and quant-ph categories) with top-$3$ watermarking covering both watermarks.
Refer to caption: extracted/5870008/images/multisource1.png

Figure: Figure 13: Combined generated text from ArXiv dataset (astro-ph and cs.CV categories) with top-$3$ watermarking covering both watermarks.
Refer to caption: extracted/5870008/images/multisource2.png

## Appendix I Frequently Asked Questions

##### The paper assumes data providers are willing to embed watermarks in their data to track usage, but in practice, they may prioritize data privacy over adding any extra information.

Firstly, the objective of this work is to protect the IP rights of the data providers under the setting that there is a necessity to certify the source of online content produced by LLMs, as discussed in Sec.1. Under this setting, the data providers are willing to have their identity disclosed and attributed to. In practice, this setting may correspond to authors of academic papers who are willing to be identified and cited for their work.

Meanwhile, as discussed in App. A, in our WASA framework, only the watermark can be seen in the generated data, which does not imply personal information about the data providers. Therefore, data privacy can be preserved as long as the mapping from watermarks to data providers is kept confidential. In practice, if some data providers prioritize data privacy and do not want their identities to be revealed, they may request the LLM owner to not decode their watermarks and reveal them as sources to the public, in which case users will not be able to infer any private information from the watermark itself.

From another perspective, given our proposed watermarking scheme, data providers will also be able to check data provenance and see whether their watermarked data have been misused, which serves as a protection of data privacy in a different sense.

##### It seems the removal of all invisible characters could render the watermarks ineffective.

Firstly, we have considered various scenarios where the generated watermark is modified or removed in our paper (Sec. 4.2 and App. F.2). We have tested our watermark regeneration defense against these scenarios to regenerate the attacked watermark and preserve a high source attribution accuracy of $71.60\%$ (top-$3$ $93.76\%$), which is comparable to the original $74.84\%$ (top-$3$ $95.76\%$). Thus, our watermark regeneration is an effective defense mechanism to address the straightforward removal of watermarks.

Secondly, we would like to consider the usage of our framework where source attribution is performed immediately as the LLM generates text together with the watermark. Under this setting, the identification of the data provider of the generated text takes place right after LLM generation and there would be no opportunity for attackers to modify the generated watermarks. In practice, this setting may correspond to the scenario that when the user queries an LLM, the source is provided along with the output of the LLM.

##### How does the evaluation, particularly the experimental setup correlate with realistic scenarios where LLMs generate novel content?

In real-world scenarios, source attribution is more likely to be performed on LLM-generated content to find the source for the generation. In our evaluation, the source attribution accuracy is also measured on the generated sentence of the LLMs, using the sentences selected from the training datasets as inputs/prompts. Hence, our evaluation design aligns with the real-world source attribution applications on both performing on synthetic data. Note that we use the sentences from the training datasets as inputs/prompts to LLMs solely to decide the ground-truth source for the generated content: On the one hand, we can determine the source of the generated sentence directly as the source (training data provider) for the input/prompt (as validated in App. E.3); On the other hand, if we choose inputs/prompts as those we do not know the source, it would be more challenging to decide the source for the generated sentence and make the evaluation of source attribution less reliable.

Importantly, we have adopted various datasets in our experiments that correspond to different real-life use cases. The ArXiv and DBpedia datasets correspond to paper and knowledge attribution, while the BookSum dataset refers to story attribution. The CC-News, IMDB, and FakeNews datasets represent a more challenging use case: the attribution of word/expression usage.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 5
presentation: 3
questions: 1. The authors claim that source attribution is a new task proposed by them. I need more explanation of the differences between source attribution and text watermarks for copyright protection.

2. The authors claim that through the design of splitting the linear layer, the WASA-LLM can avoid pertubations. However, as far as I'm concerned, as described in Figure 3, all hidden states(including hidden embeddings of word tokens) will be in the forward pass of  We′[V + 1 : V + V ′], and will influence the outputs(generated watermark tokens). So, pertubations on input words have effects on the output watermarks. 

3. There may be some challenges in proving the authors' claim. The authors utilize a one-hot vector for data from a single provider. However, data from the same provider may be very different in distribution, and data from different providers may be similar. For instance, data from Arxiv and DBLP may have similar distributions, as they all contain scientific papers. And, data from a social media may be very different in topics and ideas. How can the author prove that with this problem, their proposed method can also work well? Extra experiments needed.

4. I also want to know the implementation details. As we all know, the way of adding tokens to the vocabulary is important for the final results. How do you initialize your embeddings of the watermark Unicode tokens? And, do you update the embedding parameters during training? This design may be important for results.

4. The author use GPT-2(maybe not an LLM) and llama-2 for experiment results. However, open-source LLMs with better capability have been proposed after them. LLaMA-3-8B[1] and other LLMs may be good choices. You can do supplementary experiments on LLaMA-3-8B to show me the performances.


[1] Dubey, Abhimanyu, et al. "The llama 3 herd of models." arXiv preprint arXiv:2407.21783 (2024).
soundness: 2
strengths: - Provide convincing real-world application for readers.
- Clear definition of the source attribution problem.
-  Large amount of main experiments and ablation studies to show the aspects of a good source attribution algorithm the author claims.
summary: The authors introduce a framework named WASA (Watermarking for Source Attribution) that embeds unique, imperceptible watermarks into the data used for training LLMs. This approach enables the identification of specific data providers when synthetic texts are generated, thus providing a solution for source attribution. The paper discusses the key properties of an effective source attribution system, including accuracy, robustness against attacks, scalability, and performance preservation. WASA is demonstrated to achieve high source attribution accuracy while maintaining the generation quality of the LLMs. It utilizes unique Unicode characters as watermarks and is shown to be effective in empirical evaluations, even under adversarial conditions such as text modification. This work positions itself as a pioneering solution for source attribution in LLM-generated outputs, offering significant implications for data protection and IP verification in AI-generated content.
weaknesses: - Not clear difference from text watermark for copyright protection
- Not enough evidence for avoiding pertubation attack on word tokens.
- Data distribution problems of different data providers.
- Implementation details: embedding settings. 
- Lack of experiments on recently proposed LLMs.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: Q1: The method is a pre-training source attribution method. How would this method integrate into pipelines of continuous training, where the number of data providers may also be growing? 

Q2: The authors discuss the performance drop as data provider number grows. How would this method scale to thousands or millions of data providers? 

Q3: Can you motivate the argument for source attribution via training rather than search more? Results in the paper show for 500 data providers, WASA is better than BM25. But practically, data providers may be in the number of millions rather than hundreds.
soundness: 2
strengths: - The authors propose a novel method that tackles source attribution, an important and difficult problem.
- The authors lay out clear desiderata for source attribution and demonstrate that the proposed method has promise in satisfying the desiderata.
- The writing and presentation of the paper is clear and easy to follow. Experiments are well set up and detailed for each desiderata.
summary: The authors study how to generate source attribution—identifying data sources that influence specific outputs—for LLMs. The authors discusses a list of effective source attribution desiderata: 1) accuracy, 2) robustness, 3) performance preservation, 4) scalability, 5) transferability, 6) adaptability. The authors propose WASA which embeds invisible characters into the sentences that are most representative of a data provider. WASA-LLM can fit in during or after the pre-training stage. The framework learns to insert watermark randomly in the desired sentence, by a modified transformer structure, where there is a separation of text and watermark token predictions. This benefits WASA-LLM in generating watermark for clean sentences.
weaknesses: 1. The proposed source attribution method requires pre-training and performs worse with growing number of data providers. See Q1, Q2, Q3.
2. Other related work: 
https://arxiv.org/pdf/2302.14035 
https://arxiv.org/pdf/2403.03187
https://arxiv.org/pdf/2311.12233
3. Main experimental comparison is against BM25, though BM25 has limitations related to changed word order, and less semantic relationship captured. Experiments would be stronger compared with other retrieval methods.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: - Can this framework be applied to code data?
soundness: 2
strengths: - This is a popular topic that explores the attribution of sources for text generated by LLMs, a crucial issue for effective data regulation in the age of large language models.
- The proposed WASA framework is well-defined, considering key attributes for practical application such as accuracy, robustness, and scalability.
summary: The article addresses the challenge of attributing sources for synthetic text generated by large language models (LLMs). It presents a framework called "Watermark for Source Attribution" (WASA), which embeds watermarks in the generated text to identify the data sources used during LLM training. This framework aims to ensure accurate source attribution, considering factors such as robustness to attacks, scalability, performance retention, transferability, and adaptability.
weaknesses: Despite this, the method's practical applicability remains weak and raises concerns:

- Unlike recent watermarking efforts that focus on injecting watermarks during the model generation process, this approach targets pre-training data for various providers. Therefore, a potential attack could involve provider B using provider A's data and repeatedly injecting watermarks to attribute the content to provider B. In a more common scenario under AI-assisted writing, if provider A uses provider B's WASA-LLM for text refinement, even for simple grammar checks, provider B's content might inadvertently receive provider A's watermark, leading to intellectual property conflicts.
- The consideration for attacks is insufficient; stronger paraphrasing is necessary beyond simple changes to prepositions, tenses, and syntax. This means semantically equivalent rewriting, as demonstrated by the DIPPER paraphraser [1]'s effectiveness against watermarks.
- The technique relies on classic text steganography. Effective defenses include: 1. Scanning and cleaning all Unicode characters; 2. Injecting numerous Unicode characters for perturbation. This raises questions about the effectiveness of WASA-LLM.

- Additionally, if the method cannot attribute output to multiple data sources, it cannot truly identify specific sources influencing a particular output, as claimed. This is similar to data provenance, offering only binary determination. Techniques like those by Kirchenbauer et al. [2] can assign keys to each provider to achieve this identification, which diminishes the distinct contribution of this paper compared to other watermarking work.

Overall, while the motivation is novel, the method seems insufficiently comprehensive. If the authors address these weaknesses convincingly, I am open to revising my evaluation.

[1] Krishna, K., Song, Y., Karpinska, M., Wieting, J., & Iyyer, M. (2024). Paraphrasing evades detectors of ai-generated text, but retrieval is an effective defense. Advances in Neural Information Processing Systems, 36.
[2] Kirchenbauer, J., Geiping, J., Wen, Y., Katz, J., Miers, I., & Goldstein, T. (2023, July). A watermark for large language models. In International Conference on Machine Learning (pp. 17061-17084). PMLR.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: 1. Why is it more effective to allow a data provider to verify if their data was used to train an honest LLM when addressing IP issues?
2. In the effectiveness experiments, the comparative baselines for source attribution seem limited. They rely solely on the simple probabilistic model BM25. More advanced methods, such as machine learning approaches, exist for estimating the relevance of generated texts to data providers. How does the proposed WASA method perform compared to these machine learning techniques?
3. What is the specific impact of the watermarking process on the computational resources and performance of the LLM, especially in large-scale applications?
soundness: 2
strengths: + This paper introduces a new task that is more challenging than traditional data provenance, as it requires more detailed information about the data source. It successfully tackles this challenge by using watermarking techniques, which enable precise identification and tracking of the original data sources.
+ This paper identifies six key properties essential for successful source attribution. To address these, the authors develop a framework designed to meet multiple critical requirements, ensuring that the system is both versatile and functional.
+ Through extensive empirical evaluations, including ablation studies and comparisons with alternative methods, the paper demonstrates the effectiveness, robustness, scalability, performance preservation, and adaptability of the WASA framework.
summary: This paper tackles the challenge of source attribution for texts generated by LLMs, aiming to protect intellectual property. It introduces a framework called WASA, which embeds watermarks in generated texts to trace back the data providers involved in training the LLM. WASA is designed to ensure accurate attribution while maintaining robustness against adversarial attacks, preserving performance, and scaling to accommodate a large number of data providers. Additionally, it is transferable and adaptable across different LLMs. Extensive empirical experiments demonstrate the framework’s effectiveness in source attribution.
weaknesses: 1. The writing style is unclear, making the paper's motivation less apparent. It claims that source attribution addresses IP concerns related to synthetic texts generated by LLMs. However, it fails to clearly explain why allowing a data provider to verify the use of their data in training an honest LLM is a more effective solution for these IP issues.
2. This paper highlights robustness as a key feature and demonstrates it against multiple attacks. However, it overlooks a simple method for watermark removal. Specifically, the watermark could be removed using basic standard formatting methods.
3. Embedding and regenerating watermarks may increase computational overhead, particularly in large-scale applications. Yet, the paper does not offer a detailed analysis of how this affects performance and resource usage.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: - Q1: What's the impact of the random insertion of the watermark during training and inference? Can it rather be fixed?
- Q2: How is this approach different from training the model to generate the citation like "Sentence [arxiv:math]"? If the citation can be reconstructed anyway, we don't need to be limited by the invisible unicode characters.
- Q3: How do we control the model to memorize the watermark/citation? Or how are we sure about it?
soundness: 2
strengths: - S1: The proposed approach is simple and generally applicable many existing LLM architecture and training scheme.
- S2: The evaluation shows that the proposed approach outperform the baseline by a large margin.
- S3: The approach is generally well presented.
- S4: The paper presents the negative result where the normal performance of the LLM can degrade with this defense, setting the expectation when this approach is adopted.
summary: This paper tries to attribute the source of the generated text by LLM using invisible unicode characters included during training. The approach is evaluated with 20 sources to show that the source could be correctly identified. The proposed approach is compared with BM25 and shown to outperform it by 17-29% margin.
weaknesses: - W1: The approach is evaluated with only 20 sources, limiting the understanding of its real world impact. Thus, it is unclear if the watermark will survive with a lot more sources (e.g., thousands to millions) that would be closer to the real world.
- W2: The baseline approach can be a little bit better. The first and simplistic approach would be training BERT to classify the generated text to sources (similarly to Matching Pairs, Foley et al., 2023 @ ACL) given the number of sources is only 20. For a large number of sources, a Siamese model or 1/k-shot classification can be used. BM25 is not a conventional baseline for a classification task.
- W3: The accuracy evaluation uses the samples directly from the data providers, which is not realistic in a modern LLM usage since there will be more information, context, structure, or other utterances will be present. This trivialize the problem to a typical classification task such as topic classification, etc.

Meta-review: The paper received five review scores, three of which were still negative after rebuttal. Although the authors addressed some of the reviewers' concerns during the rebuttal phase (such as the differences from existing methods and missing some baseline methods), the reviewers still generally believed that the paper still had some important flaws. For example, most reviewers felt that the threat model, i.e., a given generated data comes from only one data source and the data distribution of each data source is different, is too strong and unrealistic; The scalability of the method when there are many data sources; The insufficient discussions of the resistance to adaptive attacks. Although I agree that this paper provides some new and interesting insights, given that it still has the major flaws mentioned above, it is not yet ready for publication.

Decision: Reject