Skip to main content
  1. Home
  2. Emerging Tech
  3. Computing
  4. News

Digital Trends may earn a commission when you buy through links on our site. Why trust us?

A neural network tried to write a 9th Harry Potter book, with hilarious results

Add as a preferred source on Google

Do you remember that memorable scene in the Harry Potter books when a person seeking revenge on Ron turns out to be Dumbledore hiding behind a cream cake?

If you don’t, that’s probably because you read the version of Harry Potter written by J.K. Rowling instead of an LSTM recurrent neural network — trained to generate new Hogwarts-related stories using a data set consisting of the series’ first four books.

Recommended Videos

“I’ve been experimenting with deep learning over the past few weeks, and the Harry Potter story is the result of one of those experiments,” creator Max Deutsch told Digital Trends. “Beyond just looking for a fun way to practice what I’ve been learning, the Harry Potter project was an attempt to make something enjoyable to read.”

Since the results are more surreal mashup than anything likely to give Rowling sleepless nights, “enjoyable” may not be exactly the word. However, it’s a fascinating demonstration of what happens when a neural network turns its attention to creativity.

“The computer is quite good at capturing the rhythm and style of the source text, but the sentences themselves are mostly nonsense,” Deutsch admits. “Occasionally, there is a glimmer of sense, and these moments — plus the knowledge that a computer wrote it — is what makes the read enjoyable to me.”

Interestingly, this isn’t the first time textual analysis algorithms have been applied to the work of J.K. Rowling. When the U.K. newspaper the Sunday Times outed the mega-successful author as the scribe of detective novel The Cuckoo’s Calling a few years ago — writing under the pen name Robert Galbraith — computer scientists were called in to use machine learning to solve the mystery. By analyzing the text based on word-length distribution, usage of common words like “the” and “of,” and recurring-word pairings, they proved that she was.

Max Deutsch’s work might not have quite the academic rigor of that work, but it moves beyond it by not simply analyzing existing works — but generating new ones. “Creativity is a hard thing to explain, even in the context of humans,” he says. “If creativity is simply the act of creating something new — often based on connecting pre-existing things in new ways — then you can argue that the Harry Potter neural network was very creative. In fact, this might be the first time anyone, or anything, has constructed the sentence: ‘Dumbledore will get out from behind a cream cake.’”

You can read the rest of Deutsch’s deep learning Harry Potter story here.

Luke Dormehl
I'm a UK-based tech writer covering Cool Tech at Digital Trends. I've also written for Fast Company, Wired, the Guardian…
As AI voices get harder to spot, ElevenLabs adopts Google’s SynthID to help you sniff the fakes
Artificial Intelligence

There was a time when spotting AI-generated content was almost a game. Images came with extra fingers, chatbots wrote like overly enthusiastic interns, and synthetic voices had an unmistakable robotic edge. Those days are disappearing fast.

Today, AI voices can laugh, whisper, pause naturally, and even sound emotional enough to fool many listeners. That’s exciting for creators, but it’s also creating a growing trust problem. If you can’t tell whether a clip is real or AI-generated, how do you know what to believe?

Read more
OpenAI just made GPT-5.5 Instant more fun to talk to, and users may actually notice
The company says its most-used ChatGPT model is getting better at advice, decision-making, and everyday conversations.
Man using ChatGPT on a laptop

For years, AI companies have competed by talking about benchmarks, reasoning scores, and coding performance. OpenAI's latest ChatGPT update takes a different approach. Instead of focusing on raw intelligence, the company is making its most popular AI model more enjoyable to talk to.

OpenAI says GPT-5.5 Instant now better understands what users want

Read more
Claude can now join your Slack channels and work alongside your team
Laptop running Claude Fable

For years, AI assistants have been siloed. You open ChatGPT, Claude, Gemini, or Copilot, type a prompt, get an answer, and move on. Anthropic's new Claude Tag feature takes a different approach. Instead of making employees jump into a separate AI chat every time they need help, it brings Claude directly to where many teams already spend their day: Slack.

Add Claude to a channel, grant it access to needed tools, and tag @Claude for help — whether analyzing data, writing reports, reviewing code, or investigating incidents. But Claude Tag isn't just another chatbot integration. Its key differentiator is that Anthropic positions it as a digital coworker for your team, enabling seamless collaboration where multiple users can jointly interact with the same AI within their work environment.

Read more