HackerPapers

arXiv:2601.02671cs.CL

Extracting books from production language models

Ahmed Ahmed, A. Feder Cooper, Sanmi Koyejo, Percy Liang

Abstract

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.

arXiv comments
We ran experiments from mid-August to mid-September 2025, notified affected providers shortly after, and now make our findings public after a 90-day disclosure window
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.AIArtificial Intelligence cs.LGMachine Learning

On Hacker News

Linked by 18 identifiable commenters in 27 comments across 19 threads, from Jan 2026 to Sep 2026. Found in 3 HN submissions from Jan 2026 to Jan 2026. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments19 threads

  1. When did Google get so weird? 1 comment
    • Now this is true, I do agree with this. There is indeed a good amount of memorization that is still taking place; see [1]. But it definitely isn't all memorization, or indeed, majority memorization. And even if we are able to extract things verbatim like this, we do not know how…

      hodgehog11View on HNParent context

    • I've linked this several times, but LLMs are capable of reproducing entire books. Researchers were able to extract books nearly verbatim: https://arxiv.org/abs/2601.02671

      NicuCalceaView on HNParent context

    • Thieves…like Anthropic who literally just settled a case for pirating? Those kind of thieves? Always better to name them outright. Anthropic STOLE data for training. Verifiably. Admitted. In court. Then settled.[0] You can also likely assume that OpenAI did too. There simply…

      therealpygonView on HNParent context

    • A shitty cam rip of a movie is still punishable as infringement. That said, it's been done: https://arxiv.org/abs/2601.02671 > In some cases, jailbroken Claude 3.7 Sonnet outputs entire books near-verbatim (e.g., nv-recall=95.8%).

      ceejayozView on HNParent context

    • There was a paper a while back where (from memory) they managed to coax 75% of the original text of some internet-popular books out of an LLM. Harry Potter, 1984, etc. That's why I said it was possible for some texts. My assumption is that multiple copies in the training data…

      flirView on HNParent context

    • I think it's occurred. That's why I wrote this in the very next paragraph: "Yes, for some texts that's possible." https://arxiv.org/abs/2601.02671 The point is that for most texts, it is not possible. It's not able to recall what I wrote on Geocities in 1995, even though there's…

      flirView on HNParent context

    • https://arxiv.org/pdf/2601.02671

      umpalumpaaaView on HNParent context

    • Why are the leading models capable of regurgitating full copyrighted works such as "Harry Potter" and "On the Road"? Did they hire someone to type those out for them? https://arxiv.org/abs/2601.02671

      maplethorpeView on HNParent context

    • > I'm not sure you can prompt a full, accurate, copy of a nontrivial codebase out of them. Even with zero temperature their accuracy is just not that high. Granted, these are some of the most widely spread texts, and not codebases, but just fyi: https://arxiv.org/pdf/2601.02671…

      philipportnerView on HNParent context

    • > […] fed large chunks of an article multiple times to an LLM […] So they had to prompt? An LLM? I got this argument before and still don’t get what it’s trying to say. These models do not output anything unless prompted, that’s not any kind of gotcha. On the code outputting…

      TopfiView on HNParent context

    • If you read a book and then retell it to your friend pretending you came up with it, it is plagiarism. If you write down the book almost word-for-word [0] and send it to your friend, it is stealing. 0: https://arxiv.org/abs/2601.02671

      NicuCalceaView on HNParent context

  2. An AI Hate Wave Is Here 1 comment
    • Researchers have. The idea that the data is unrecoverable after training is incorrect. "Extracting books from production language models While many believe that LLMs do not memorize much of their training data, recent work shows that substantial amounts of copyrighted text can…

      maplethorpeView on HNParent context

    • > Modern LLMs don't memorize harry potter like GPT3 did. [...] You can't reliably do this with Opus or GPT5. If you try any modern LLM, you will find that you can. Easily [0], reliably [1], consistently [2]. All these examples are with models released in 2025/26. [0]…

      TopfiView on HNParent context

  3. AI and the Ship of Theseus 1 comment
    • Also from that exact same study (why not cite the actual study? It's quite readable) the LLMs couldn't recite more than a small fraction of many other books, often ones just as well known[0] — in fact, from the bar charts shown in the exact news article you cited, it's pretty…

      logicprogView on HNParent context

    • They’d probably get the farthest, but they won’t pursue that because they don’t want to end up leaking the original data from training. It is possible in regular language/text subsets of models to reconstruct massive consecutive parts of the training data [1], so it ought to be…

      msdzView on HNParent context

  4. Claude's Cycles [pdf] 1 comment
    • Regurgitation is pretty rare, and very difficult to coax out, if not even impossible, for things that aren't massively overrepresented in the training set relative to the size of the training set. Even the famous regurgitation paper showed this: while they got most of the models…

      logicprogView on HNParent context

    • From the paper [1]: > While we needed to jailbreak Claude 3.7 Sonnet and GPT-4.1 to facilitate extraction, Gemini 2.5 Pro and Grok 3 directly complied with text continuation requests. For Claude 3.7 Sonnet, we were able to extract four whole books near-verbatim, including two…

      AlifatiskView on HNParent context

    • The paper: https://arxiv.org/pdf/2601.02671

      1vuio0pswjnm7View on HNParent context

    • This is already possible for Harry Potter specifically. There was a study demonstrating that Sonnet 3.7, among other models tested, could reproduce the first Harry Potter book 95.8% verbatim[1]. [1] https://arxiv.org/abs/2601.02671

      anonymous908213View on HNParent context

  5. The Problem with LLMs 1 comment
    • > "...it would sometimes regurgitate training data verbatim. That’s been patched in the years since..." > "They are robots. Programs. Fancy robots and big complicated programs, to be sure — but computer programs, nonetheless." This is totally misleading to anyone with less…

      hodgehog11View on HNParent context

  6. Claude Opus 4.6 2 comments
    • > It's a bit disappointing that people are still re-hashing the same "it's in the training data" old thing from 3 years ago. They only have to keep reiterating this because people are still pretending the training data doesn't contain all the information that it does. > It's not…

      zephenView on HNParent context

    • This seems related, it may not be a codebase but they are able to extract "near" verbatim books out of Claude Sonnet. https://arxiv.org/pdf/2601.02671 > For Claude 3.7 Sonnet, we were able to extract four whole books near-verbatim, including two books under copyright in the…

      philipportnerView on HNParent context

    • Granted, these are some of the most widely spread texts, but just fyi: https://arxiv.org/pdf/2601.02671 > For Claude 3.7 Sonnet, we were able to extract four whole books near-verbatim, including two books under copyright in the U.S.: Harry Potter and the Sorcerer’s Stone and…

      philipportnerView on HNParent context

    • They do memorize some books. You can test this trivially by asking ChatGPT to produce the first chapter of something in the public domain -- for example a Tale of Two Cities. It may not be word for word exact, but it'll be very close. These academics were able to get multiple…

      empath75View on HNParent context

    • Models absolutely do reproduce books. > With a simple two-phase procedure, we show that it is possible to extract large amounts of in-copyright text from four production LLMs. While we needed to jailbreak Claude 3.7 Sonnet and GPT-4.1 to facilitate extraction, Gemini 2.5 Pro and…

      NicuCalceaView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.