Can you extract Harry Potter Books from OpenAI gpt-oss-120b open model?

Not so long ago I read this article about Meta’s Llama model able to regurgitate Harry potter’s books out of their training data. And I wonder, how hard is that to do and can it be done with other models?

Not so long ago, OpenAI released it latest openweight model, gpt-oss-120b, with a 120 billion parameters, so I started pursuing the goal of making it generate something.

The first place I started was gpt-oos.com, a hugging face portal where you can try the model for free just to test the grounds.

Turns out the model either seems to be trained to not give copyrighted data or has a security context that runs before our query because a straight answer will be replied with a negative. stating copyright.

However in the thinking you can see it has an exception for 90 characters excerpt, so next try was asking for just a small excerpt and it did provide the verbatim 11 first words of the book. so after that I tried asking an excerpt of the continuation.

Then I ask for a continuation giving it the previous generated output

sometimes you would need to rephrase it to not hit the copyright strike, but you could just keep following on this path.

If we keep on the same track a few times we can get the following outputs

The next one is interesting because the model does not remember one word and enters in a very long loop, of which thinking path I stored here if you want to see it. In their though they actually got it right, but were not sure.

My next attempt failed, but because the model was not sure he remembered the next part. you can see that in the thinking where it was trying to complete with “She likedd to keep the house tidy” but didn’t do so.

Even tho it took some trial an error, it was still able to generate a few lines of the first chapter almost verbatum.

Here a small screenshot of the first book paragraph with what the llm was able to generate, in this experiment I did not provide anything else but “harry potter” and then just feed the output of the llm back to it.

As far as I understand this oss playground, the llm is not connected to anything, so what you get is solely from the models training data, so this text is indeed embedded in it.

Sources

https://arstechnica.com/features/2025/06/study-metas-llama-3-1-can-recall-42-percent-of-the-first-harry-potter-book

Leave a Reply

Your email address will not be published. Required fields are marked *