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…
The future of AI may depend on this one behind-the-scenes change
Running Claude on Android.

Whenever a new AI model arrives, it's easy to get caught up in the bells and whistles. We talk about how much smarter it is, how quickly it answers questions, or how realistic its images have become. But here's the thing: none of that matters much if the AI can't reliably work with the apps and services people use every day.

That's why an upcoming update to the Model Context Protocol (MCP) caught my attention. It isn't a new chatbot or a fancy AI model. In fact, most people will never even know it's happening. But it could quietly make the AI ecosystem a lot healthier. If you've never heard of MCP before, don't worry. Think of it as a shared language that lets AI assistants safely talk to apps like Gmail, Slack, calendars, databases, and countless other services. Instead of every company inventing its own way to make those connections, MCP gives everyone a common rulebook.

Read more
The AI game-dev boom has a dark side: fewer jobs for the people starting out
Solo creators are thriving with tools like Claude Code and Copilot, but entry-level game roles are disappearing.
Man playing a video game on a desktop with glowing red and blue lights

AI is making it easier than ever for a single person to build a game. That sounds like a win for creativity, and in many ways, it absolutely is. But there is a catch. As generative AI tools help solo developers and small studios do more with fewer people, the same shift is making life tougher for writers, artists, concept creators, and junior programmers trying to break into the gaming industry.

AI is giving solo developers superpowers

Read more
A new AI model wants self-driving cars to think before they swerve
Forget guessing games, this self-driving AI actually shows its work.
Self driving car

Self-driving cars have gotten pretty good at driving. The harder problem is teaching them to drive safely in situations nobody planned for. We have heard horror stories of self-driving cars, behaving erratically in emergency situations, often times delaying first responders from reaching the scene.

A team at Seoul National University, led by professor Jun Won Choi from the Department of Electrical and Computer Engineering, thinks they have cracked part of that puzzle with a new AI model called SafeDrive. The research was recently selected as a highlight paper at CVPR 2026, a distinction that goes only to roughly 3% of all submissions.

Read more