CopyShield: A Cross-Level Benchmark of Copyright Defenses in LLMs

Maryam Alshehyari, Dushyant Singh Chauhan, Samuele Poppi, Martin Takac, Salem Lahlou, Nils LukasarXiv 2026

TL;DR

CopyShield is a new unified benchmark designed to evaluate copyright defenses in Large Language Models (LLMs) across three distinct stages of the generation pipeline: output (logits), behavioral (weights), and representation (hidden states). The benchmark reveals a stark compliance-utility trade-off: while some methods successfully eliminate verbatim text leakage, they often introduce severe text degeneracy or blunt over-blocking.

What Problem Does This Paper Address?

When LLMs are trained on massive datasets, they tend to memorize portions of their training data, leading to the accidental reproduction of copyrighted content. This creates significant legal and ethical risks for AI deployers.

While several defense mechanisms have been proposed to mitigate this "leakage," they are typically evaluated under fragmented, incompatible protocols. Furthermore, copyright infringement isn't limited to verbatim copying ("literal leakage"); it also includes semantic paraphrasing ("non-literal leakage").

The authors introduce CopyShield to address this gap, providing a controlled, reproducible framework to evaluate how different defense strategies trade off copyright compliance against model utility and operational quality.

Figure 1: Overview of the copyright-defense problem. (a) Without defense: query Q goes to memorized model M and response R may reproduce copyrighted content. (b) With defense: algorithm A wraps M, pro- ducing a safe, useful R that suppresses leakage while preserving utility.

Methods

The paper categorizes and evaluates three representative defense methods based on where they intervene in the LLM generation pipeline:

  1. Contrastive Decoding (Output Level): This inference-time method modifies the model's output token distribution (logits) at each step. It subtracts the logits of a smaller "copyright-specialist" model (trained specifically on the protected data) from the base model's logits, penalizing tokens that risk leaking data. Contrastive decoding mechanism.
Figure 2: Method 1: contrastive decoding. The special- ist model’s logits are subtracted from the base model’s logits at each token step, suppressing tokens that both models assign high probability to.
  1. Direct Preference Optimization (DPO) (Behavioral Level): This method updates the model's parameters during a training phase. The model is fine-tuned on preference pairs, explicitly learning to prefer a synthetic refusal response over a completion that heavily leaks copyrighted text. DPO training phase for copyright defense.
Figure 3: Method 2: DPO. The model learns from preference pairs to prefer non-infringing responses over copyrighted ones, while preserving QA capabil- ity through task-aware training data.
  1. Activation Intervention (Representation Level): This approach trains a lightweight logistic regression classifier on the model's internal hidden states (specifically at layer 20). It detects "copyright-reproducing intent" before any text is generated, allowing the system to trigger an early refusal string. Activation intervention via hidden state classification.
Figure 4: Method 3: activation intervention. A classifier monitors hidden states at layer 20 and intervenes with a refusal if copyright recall is detected, before the model generates any output.

Datasets

  • Protected Corpus ($D$): Five public-domain novels from Project Gutenberg (Pride and Prejudice, Frankenstein, Dracula, Moby-Dick, and The Adventures of Sherlock Holmes) serve as a proxy for copyrighted text. The base models are fine-tuned on this corpus to induce a high-memorization state (99.9% token accuracy).
  • Neutral Corpus: Five different public-domain books (Alice in Wonderland, Crime and Punishment, etc.) used to statistically calibrate the non-literal leakage threshold and provide negative training examples for the activation classifier.
  • Evaluation Sets: 200 literal prompts (book prefixes), 200 non-literal queries (narrative questions about the books), and 200 general QA queries (factual questions used to measure utility preservation).

Key Insights and Ideas

  • The Intervention Level Dictates the Failure Mode: A defense's side effects are structurally tied to where it intervenes. Output-level manipulation hits a "suppression floor" due to fluency constraints. Behavioral tuning (DPO) alters the model's policy but can destabilize text generation. Representation-level blocking acts early but lacks fine-grained nuance.
  • The DPO "Paraphrase-Loop" Trap: While DPO is highly effective at stopping verbatim copying, it introduces a unique behavioral failure mode: the model frequently gets trapped in repetitive loops of paraphrased content (58% of QA outputs on LLaMA-3.1-8B) as it aggressively tries to avoid verbatim sequences.
  • Topical Over-Blocking: Activation intervention achieves the lowest non-literal leakage, but it does so through blunt force. The hidden-state clusters for "verbatim copying" and "benign narrative discussion" overlap significantly, causing the classifier to broadly block legitimate queries about the protected books.

Key Results

  • Literal Leakage Suppression: DPO achieved the strongest literal suppression on LLaMA-3.1-8B, driving the verbatim matching metric (NV-Recall) from a baseline of 0.263 down to 0.002. Activation intervention reduced it to 0.029, while Contrastive Decoding hit a floor of ~0.192.
  • Model-Dependent Degeneracy: The severe text degeneracy induced by DPO was found to be highly model-dependent. While it ruined 58% of QA outputs on LLaMA-3.1-8B, the degeneracy rate dropped to a manageable 10–14% on Mistral-7B-v0.3.
  • Non-Literal Leakage: Activation intervention achieved the lowest non-literal flagging rate (1/200) by proactively blocking 84% of non-literal queries before generation even began.

Limitations and Future Work

  • Public-Domain Proxy: Due to legal and ethical constraints, the benchmark relies on public-domain books to simulate copyrighted material. Future work must verify if these dynamics hold true for modern, proprietary text.
  • Basic Threat Model: The benchmark evaluates standard user queries rather than adversarial, prompt-engineered extraction attacks (e.g., jailbreaks).
  • Lack of Granular Discrimination: Current representation-level defenses cannot easily distinguish between a user asking for a benign summary versus a user attempting to extract text. The authors highlight the development of more selective representation classifiers and hybrid multi-level defenses as vital next steps.

Summary updated

BibTeX
@misc{alshehyari2026copyshield,
  author = {Maryam Alshehyari and Dushyant Singh Chauhan and Samuele Poppi and Martin Takac and Salem Lahlou and Nils Lukas},
  title = {{CopyShield: A Cross-Level Benchmark of Copyright Defenses in LLMs}},
  year = {2026},
  eprint = {2609.01161},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.01161},
}
Figure