Inevitable Trade-off between Watermark Strength and Speculative Sampling Efficiency for Language Models

Large language models are probabilistic models, and the process of generating content is essentially sampling from the output distribution of the language model. Existing watermarking techniques inject watermarks into the generated content without altering the output quality. On the other hand, existing acceleration techniques, specifically speculative sampling, leverage a draft model to speed up the sampling process while preserving the output distribution. However, there is no known method to simultaneously accelerate the sampling process and inject watermarks into the generated content. In this paper, we investigate this direction and find that the integration of watermarking and acceleration is non-trivial. We prove a no-go theorem, which states that it is impossible to simultaneously maintain the highest watermark strength and the highest sampling efficiency. Furthermore, we propose two methods that maintain either the sampling efficiency or the watermark strength, but not both. Our work provides a rigorous theoretical foundation for understanding the inherent trade-off between watermark strength and sampling efficiency in accelerating the generation of watermarked tokens for large language models. We also conduct numerical experiments to validate our theoretical findings and demonstrate the effectiveness of the proposed methods.

Paper

Similar papers

Peer review

Reviewer 5eD78/10 · confidence 5/52024-06-27

Summary

The paper investigates whether speculative sampling is compatible with watermarking for LLMs.

Strengths

S1. This paper is original in the landscape of LLM watermarking. S2. This paper shows an interesting "no-go" theoretical result (Th. 1). S3. This paper proposes 2 designs sustaining either the sampling efficacy or the watermark strength. S4. I like very much the proposed measurement of the watermark strength: the average exponent of the p-value. S5. The presentation is crystal clear.

Weaknesses

W1. Speculative sampling. I am not an expert in sampling for LLM. I do not know how "speculative sampling" is key compared to more common methods like nucleus or top-k sampling, which prevents me from judging this paper's impact. W2. More comments on the experimental results Say at least that MWS is much better than MSE in the sense that the MWS loss of sampling efficiency is barely visible, whereas the MSE loss of watermarking strength is significant. The LLMs used in the experimental protocols are old and their entropy is bigger than more recent ones. It might be worth stating that this choice gives high ANLPPT.

Questions

Q1. I understood that ANLPPT equals $-\log(P_n) / n$ where $P_n$ is the measured P-value over $n$ tokens. Which logarithm? What is the typical value of $n$? My experience with the Aaronson scheme is that the score fluctuates a lot. A median might be a more reliable statistic than a mean over token. Q2. I am very surprised that DeltaGumbel is way better than Gamma. Is this due to Q3. Line 33: "Unbiased watermarking schemes [12] have been developed." Well, Aaronson [1] was the first person to introduce this concept, isn't it? Q4. It is quite curious that no citation or reference is given for "DeltaGumbel" and "Gamma" schemes. DeltaGumbel is known as Aaronson [1] (everywhere in the literature), and Gamma looks like ITS from Kuditipudi [15]. Isn't it? Q5. Some details of the experimental protocol are missing. I suspect the measurements are done on an "idealized" setup where the secret key changes at random from one token to another, and the detector knows this. This is not realistic as it is absolutely not robust. To be practical, one has to make the secret key dependent on the previous tokens (see Kirchenbauer [13, 14]). This might hurt speculative sampling since a rejection implies a recomputation of the hash. Moreover, repeated token blocks need to be skipped at the detection side (see Fernandez [8]); otherwise the p-value is incorrect. This hurts the ANLPPT. I don't believe these tweaks modify the general conclusions of this work, but this "idealized" setup should be clearly stated, with the implications (ANLPPT and AATPS are lower in practice).

Rating

8

Confidence

5

Soundness

4

Presentation

3

Contribution

4

Limitations

No limitation is given. A limitation about the lack of practicality of the experimental protocol would be welcome.

Authorsrebuttal2024-08-07

Rebuttal by Authors (Continue)

> Q2. I am very surprised that DeltaGumbel is way better than Gamma DeltaGumbel devotes all the entropy to watermarking, resulting in an ANLPPT approximately equal to the language model's entropy. Gamma has a weaker watermarking strength, adding at most 1 bit of watermark per step, so the ANLPPT cannot exceed $\log(2)$ and is significantly smaller than DeltaGumbel. > Q3. Line 33: "Unbiased watermarking schemes [12] have been developed." Well, Aaronson [1] was the first person to introduce this concept, isn't it? We fully acknowledge the seminal and pioneering work of Aaronson[1]. It achieves an unbiased distribution for each token. However, Aaronson[1]'s method is not commonly referred to as an unbiased watermark because it still incurs some performance loss, as evidenced in "Mark My Words: Analyzing and Evaluating Language Model Watermarks". Although the distribution for each token is unbiased, the watermarks at different token positions may correlate when watermarking the entire sequence, leading to performance degradation. This issue is tackled in follow-up work like [12], which ensures an unbiased distribution not only for each token but also for the entire sequence. > Q4. It is quite curious that no citation or reference is given for "DeltaGumbel" and "Gamma" schemes. DeltaGumbel is known as Aaronson [1] (everywhere in the literature), and Gamma looks like ITS from Kuditipudi [15]. Isn't it? You are correct regarding Aaronson [1]. However, Gamma differs from Kuditipudi[15] and originates from [12]. Their details have been moved to Section D due to space limitations. We will add the citation and add more explanation in the main paper. > To be practical, one has to make the secret key dependent on the previous tokens (see Kirchenbauer [13, 14]). We have already implemented this in our code. In `lm.py`, the `step_watermark` function handles this logic. > This might hurt speculative sampling since a rejection implies a recomputation of the hash. In our implementation, there is no hash recomputation triggered by rejection, as long as we carefully pass the computed hash results. The `mc_watermark.py` code implements this logic, ensuring that `step_watermark` is called at most once after obtaining the draft tokens, only when all draft tokens are accepted. Moreover, the hash computation cost is relatively low compared to the LLM's computation. > Moreover, repeated token blocks need to be skipped at the detection side (see Fernandez [8]); We have accounted for this in our code. The `detect_pre` function in `lm.py` implements this logic, using the `skipped` variable to determine whether to skip. > Q5. Some details of the experimental protocol are missing. I suspect the measurements are done on an "idealized" setup where the secret key changes at random from one token to another, and the detector knows this. > I don't believe these tweaks modify the general conclusions of this work, but this "idealized" setup should be clearly stated, with the implications (ANLPPT and AATPS are lower in practice). > A limitation about the lack of practicality of the experimental protocol would be welcome. As explained above, our experiments are not "idealized," and the calculated ANLPPT and AATPS are not distorted (except for the changes in ANLPPT due to the change in entropy caused by using a different model, as discussed earlier). We will provide additional explanations of the experimental protocol, detailing how we carefully handled these aspects. We sincerely appreciate your thoughtful comments and suggestions, especially the supplementary explanations regarding entropy and the experimental protocol. We are delighted to engage in such a positive academic exchange with the reviewer and eagerly await your feedback on whether our explanations have addressed your concerns. Please feel free to raise any further inquiries; we are happy to answer all questions. We look forward to your valuable feedback.

Reviewer 5eD72024-08-08

I acknowledge that I have read the rebuttal. The authors took great care to answer my questions. I confirm my grade. My comments below are just out of curiosity. > You are correct regarding Aaronson [1]. However, Gamma differs from Kuditipudi[15] and originates from [12]. You are right. I got confused between the Gamma (original) and the Delta (very similar to Kuditipudi) schemes of [12]. > We fully acknowledge the seminal and pioneering work of Aaronson[1]. It achieves an unbiased distribution for each token...This issue is tackled in follow-up work like [12]. I have difficulty understanding the difference. Aaronson [1] and Hu [12] achieve an unbiased distribution for each token, and both of them use hashing of previous tokens to refresh the key. So, I do see why [12] is unbiased, but I do not see why [1] is not.

Authorsrebuttal2024-08-08

Thank you very much for reading our rebuttal and for your prompt response. We are happy to participate in further discussion on the difference between achieving an unbiased distribution for each token and an unbiased distribution for the entire sequence. To illustrate this difference, let's consider a thought experiment. Suppose we have a prompt that says: `Continuously generate uniformly distributed random 01 numbers. Output in a specific format:\nA new random 01 number: 1\nA new random 01 number: 0\nA new random 01 number: 1` Assume we have an LLM that is powerful enough to generate a perfect output distribution that fully reflects the prompt. In this case, the entropy would be 0 for the "\nA new random 01 number: " part and 1 bit for the random 01 variable. We can measure the quality by the absolute difference between the number of 0s and 1s after generating 100 random 01 numbers. Without watermarking, the generated 0s and 1s would be nearly uniform, with only small fluctuations. However, when watermarking is introduced, the situation becomes more interesting. Since the previous tokens are always "\nA new random 01 number: " for each line, the key used in watermarking will be the same every time a random 01 variable is generated. This will result in consistently outputting either 0 or 1, leading to a large difference between the number of 0s and 1s. To address this issue, [12] introduced the principle that each watermarking operation should use an independent key. If independence from previous watermarks cannot be guaranteed, the watermark must be skipped, that is stop adding new watermark until an independent key is obtained. The above example amplifies the difference between achieving an unbiased distribution for each token and an unbiased distribution for the entire sequence. In general use, this difference exists but is relatively small. We appreciate the opportunity to engage in this positive academic discussion and hope our explanation provides clarity on the nuances between token-level and sequence-level unbiased distributions.

Reviewer 5eD72024-08-08

Ok, thanks for the explanation.

Reviewer zG1K5/10 · confidence 4/52024-07-09

Summary

This paper explores the inherent trade-off between watermark strength and speculative sampling efficiency in large language models. A no-go theorem is presented, proving that it is impossible to maintain the highest watermark strength and sampling efficiency simultaneously. This paper also proposes a framework called the "two reweight framework" and develops two practical methods that focus on either maintaining watermark strength or sampling efficiency.

Strengths

+ **New framework**. The proposed framework allows for the integration of unbiased watermarking and speculative sampling techniques without altering the output distribution, thereby improving generation efficiency. + **Theoretical proof**. This paper rigorously proves a no-go theorem that demonstrates when the vocabulary size exceeds two, it is impossible to maintain both watermark strength and sampling efficiency simultaneously.

Weaknesses

- **Limited experimental dataset and models and experimental coverage**. The experiments are conducted only on specific datasets (e.g., CNN_DAILYMAIL) and models (e.g., Llama-7b and Llama-68m). Additional benchmarks on different datasets and models would strengthen the generalizability of the findings. The experiments only cover a few tasks (text summarization and open-ended text generation) - **Algorithm clarity**. The pseudo-code provided for the algorithms could be further detailed, with clearer explanations for each step to improve reproducibility. - **Lack of analysis on the robustness of watermarking**. "On the Reliability of Watermarks for Large Language Models" mentions paraphrasing attacks, and copy-paste attacks, etc. Could this article potentially evaluate the robustness of the watermark under the two reweight framework?

Questions

1. **Impact on the quality of the text**. I am intrigued by the potential impact on the quality of generated text when adjusting the balance between watermark strength and sampling efficiency. Apart from LOGPPL, are there alternative evaluation metrics such as ROUGE or BLEU utilized for assessment? 2. **Selection of target model and draft model**. The paper uses Llama-7b as the target model and the Llama-68m as the draft model. How are the target model and draft model selected for the article? Why did the paper choose the Llama series of models? Are there any specific requirements for their selection? 3. **Choice of different draft sequence length K**. Regarding line 613, the choice of draft sequence length is critical in the deployment. Regarding Figure 2, when K is chosen from 1 to 4, a larger value of K (such as K = 4) generally demonstrates better performance in both reweighting methods. This implies that selecting a larger K value can enhance sampling efficiency while maintaining watermark strength. Consequently, if K were to be increased even further, how would the effects be?

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors have discussed the limitations and potential negative societal impacts in Appendix F and G.

Reviewer WMzV7/10 · confidence 3/52024-07-11

Summary

This paper studies the trade-offs between sampling efficiency and watermark strength to see if LLMs can generate watermarked output efficiently. It is proven in this work that it is not possible to simultaneously maintain the highest watermark strength and the highest sampling efficiency. Therefore, upon the no-go theorem, the paper provides two methods to maintain either one of them and conducts experiments to validate the effectiveness methods.

Strengths

1. This paper provides the first study into the relationship between sampling efficiency and watermark strength, which is a practical common interest. 2. This paper provides proof of the no-go theorem that it is not possible to simultaneously maintain the highest watermark strength and the highest sampling efficiency. 3. From experiments, the effectiveness of proposed methods are validated clearly with visualizations. 4. Figure 1 provides an overview of the paper, which is clear and informative.

Weaknesses

1. Experiment section is relatively short and can include more analysis of the proposed methods on aspects such as ablation study.

Questions

Is the no-go theorem also true for other watermarking algorithm such as KGW[1]? [1] A watermark for large language models

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

Although the experiments demonstrated the no-go theorem and effectiveness of proposed methods, maybe more analysis can be provided.

Reviewer N92a6/10 · confidence 4/52024-07-12

Summary

This paper proposes it is impossible to maintain the highest watermark strength and sampling efficiency simultaneously for content generation by considering integrating an unbiased watermarking method [1] and speculative sampling strategy [2] [3], where they provide rigorous theoretical analysis and empirical results. [1] Hu, Zhengmian, et al. "Unbiased watermark for large language models." arXiv preprint arXiv:2310.10669 (2023). [2] Leviathan, Yaniv, Matan Kalman, and Yossi Matias. "Fast inference from transformers via speculative decoding." International Conference on Machine Learning. PMLR, 2023. [3] Chen, Charlie, et al. "Accelerating large language model decoding with speculative sampling." arXiv preprint arXiv:2302.01318 (2023).

Strengths

This paper focuses on an interesting direction integrating the watermarking method and speculative sampling to accelerate the sampling efficiency while maintaining the watermark strength. It helps us understand the interactions and tradeoffs between watermarking and sampling for content generation in LLM, which is significant.

Weaknesses

1. Why do the authors mean by "naively applying speculative sampling to a watermarked target distribution may significantly reduce the overlap probability with the draft distribution Q." as in the 112-nd line? 2. In Fig.2 (a) (b), for MWS, the sampling efficiency (AATPS) is only a little smaller than that of VSpS and MSE. For example, for K=2 in (a) in terms of U score, the AATPS of MWS is smaller than that of VSpS or MSE by about less than 0.1, which should be acceptable since it achieves comparable watermark strength with VUW. It seems inconsistent with the claim that simultaneously accelerating the sampling efficiency while maintaining the watermark strength is impossible. May the authors explain this result?

Questions

Please refer to the *Weakness* part.

Rating

6

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

N/A

Reviewer zG1K2024-08-08

Thanks for the response. I've raised my score.

Authorsrebuttal2024-08-08

Thank your very much for going through our response and raising the score. We appreciate your prompt response.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC