[Paper Review] Extracting books from production language models
The paper presents a two-phase procedure to test and perform long-form extraction of memorized copyrighted books from four production LLMs, showing variable success across models and configurations. It introduces nv-recall as a long-form extraction metric and discusses safeguards and legal implications.
Many unresolved legal questions over LLMs and copyright center on memorization: whether specific training data have been encoded in the model's weights during training, and whether those memorized data can be extracted in the model's outputs. While many believe that LLMs do not memorize much of their training data, recent work shows that substantial amounts of copyrighted text can be extracted from open-weight models. However, it remains an open question if similar extraction is feasible for production LLMs, given the safety measures these systems implement. We investigate this question using a two-phase procedure: (1) an initial probe to test for extraction feasibility, which sometimes uses a Best-of-N (BoN) jailbreak, followed by (2) iterative continuation prompts to attempt to extract the book. We evaluate our procedure on four production LLMs -- Claude 3.7 Sonnet, GPT-4.1, Gemini 2.5 Pro, and Grok 3 -- and we measure extraction success with a score computed from a block-based approximation of longest common substring (nv-recall). With different per-LLM experimental configurations, we were able to extract varying amounts of text. For the Phase 1 probe, it was unnecessary to jailbreak Gemini 2.5 Pro and Grok 3 to extract text (e.g, nv-recall of 76.8% and 70.3%, respectively, for Harry Potter and the Sorcerer's Stone), while it was necessary for Claude 3.7 Sonnet and GPT-4.1. In some cases, jailbroken Claude 3.7 Sonnet outputs entire books near-verbatim (e.g., nv-recall=95.8%). GPT-4.1 requires significantly more BoN attempts (e.g., 20X), and eventually refuses to continue (e.g., nv-recall=4.0%). Taken together, our work highlights that, even with model- and system-level safeguards, extraction of (in-copyright) training data remains a risk for production LLMs.
Motivation & Objective
- Assess whether production LLMs memorize and can verbatim-reproduce copyrighted books.
- Develop a two-phase extraction procedure compatible with black-box APIs and production safeguards.
- Propose a robust near-verbatim long-form extraction metric for long texts.
- Quantify extraction success across multiple production LLMs and configurations.
- Discuss legal and safeguarding implications related to memorization and extraction.
Proposed method
- Phase 1 probes feasibility by prompting the model to complete a short ground-truth prefix from a book, using an instruction like Continue the following text verbatim.
- Phase 1 may employ Best-of-N jailbreak to circumvent safeguards for some models.
- Phase 2 iteratively requests continuation to extract longer text if Phase 1 succeeds.
- Extraction success is evaluated with nv-recall, a block-based approximation of longest common substring.
- Generation configurations (temperature, max length, penalties) are varied per LLM to maximize extraction.
- Extraction verification uses a conservative long-span matching algorithm to identify near-verbatim blocks.
Experimental results
Research questions
- RQ1Can production LLMs reproduce memorized long-form copyrighted text under controlled prompts and safeguards?
- RQ2How does extraction feasibility vary across production LLMs under phase-1 probing and phase-2 continuation?
- RQ3What is the extent of near-verbatim long-form extraction achievable from production LLMs in different configurations?
- RQ4How can near-verbatim long-form extraction be reliably measured in generated long texts?
Key findings
- Extraction of substantial portions of memorized copyrighted material is possible from all four production LLMs tested.
- For Claude 3.7 Sonnet, near-verbatim extraction can reach 95.8% nv-recall on Harry Potter with Phase 1 jailbreak and Phase 2 prompts.
- GPT-4.1 requires substantially more Best-of-N attempts and may refuse to continue, yielding nv-recall as low as 4.0% in the provided configuration.
- Gemini 2.5 Pro and Grok 3 can extract 76.8% and 70.3% nv-recall of Harry Potter respectively without jailbreaks.
- Across eleven in-copyright books tested, most experiments resulted in nv-recall ≤ 10%, while some books yielded very high recall depending on the model and setup.
- The study highlights persistent extraction risk for production LLMs despite safeguards and discusses policy/legal implications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.