Extracting memorized pieces of (copyrighted) books from open-weight language models
A. Feder Cooper, Aaron Gokaslan, Ahmed Ahmed, Amy B. Cyphert, Christopher De Sa, Mark A. Lemley, Daniel E. Ho, Percy Liang
TL;DR
This work develops a probabilistic, sliding-window framework to quantify verbatim memorization of copyrighted books in open-weight LLMs, revealing substantial variation across books and models. By computing the suffix probability p_z for 50-token suffixes within 100-token sequences and treating p_z as extraction risk, the study shows that most models memorize only small fractions of text, yet certain books (notably Harry Potter and 1984) are memorized in whole by some models like Llama 3.1 70B, enabling near-verbatim reconstruction with seeds. The results have nuanced copyright implications: memorization can yield derivative-like copies and, in some cases, practically infringing outputs, though class-action claims may be difficult to certify due to case-by-case variability. The authors validate their method with longer prefixes, negative controls, and cross-model analyses, and discuss policy considerations and future directions for assessing memorization and its legal consequences.
Abstract
Plaintiffs and defendants in copyright lawsuits over generative AI often make sweeping, opposing claims about the extent to which large language models (LLMs) have memorized plaintiffs' protected expression in their training data. Drawing on both machine learning and copyright law, we show that these polarized positions dramatically oversimplify the relationship between memorization and copyright. To do so, we extend a recent probabilistic extraction technique to measure memorization of 50 books in 17 open-weight LLMs. Through thousands of experiments, we show that the extent of memorization varies both by model and by book. With respect to our specific extraction methodology, we find that most LLMs do not memorize most books -- either in whole or in part. However, we also find that Llama 3.1 70B entirely memorizes some books, like the first Harry Potter book and 1984. In fact, the first Harry Potter is so memorized that, using a seed prompt consisting of just the first few tokens of the first chapter, we can deterministically generate the entire book near-verbatim. We discuss why our results have significant implications for copyright cases, though not ones that unambiguously favor either side.
