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

A.I. reads the Harry Potter series, then writes some absurd fan fiction

Add as a preferred source on Google

Have you ever tried using the predictive keyboard on your smartphone to generate completely nonsensical messages, based on the words it considers to have the highest probability of following each other? A mischievous member of Botnik Studios, an online artist collaboration, just used a similar technique to write part of a new Harry Potter novel — with hilarious effect.

The predictive text generator used to write the story was trained on the seven previous Potter books. From this, it analyzed frequent recurrent word pairings and sentences to come up with text that is a weird mix of algorithmic randomness and something that, frankly, still reads a bit like J.K. Rowling may have penned it.

Recommended Videos

Titled Harry Potter and the Portrait of What Looked Like a Large Pile of Ash, the story is every bit as weird as you might imagine. A Death Eater wears a shirt reading, “Hermione Has Forgotten How To Dance,” Harry falls down a spiral staircase for an entire summer, and Ron does a tap dance and then tries to eat Hermione’s family. None of it makes a lick of sense, but it’s a whole lot of fun — and genuinely creative in a way that mixes human smarts with artificial intelligence.

This isn’t the first time computer scientists have used artificial intelligence to try and generate new Harry Potter stories. Last year, we reported on one attempt to generate new Hogwarts-related stories using a long short-term memory recurrent neural network trained on the series’ first four books.

Even more significantly, when Rowling was outed as the author of the detective novel The Cuckoo’s Calling a few years ago — writing under the pen name Robert Galbraith — computer scientists cracked the mystery in a very similar way to Botnik’s story generator: by analyzing the text based on frequent word pairings and the like. In the aftermath, Rowling admitted that she was the author.

If you are interested in finding out a bit more about Harry Potter and the Portrait of What Looked Like a Large Pile of Ash and the predictive text program used to generate it, check out this page on GitHub, where it is freely available to inspect.

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…
Researchers hid a prompt injection inside a PNG, and AI fell for it
Hacker

AI coding assistants like Claude are becoming every developer's favorite coworker. They can review code, explain confusing functions, and even write entire features with a single prompt. But new research suggests that this growing trust could also become their biggest weakness.

A team of security researchers (professor Sudipta Chattopadhyay and researcher Murali Ediga) has demonstrated an unusual attack that doesn't target the AI model directly. Instead, it targets what the AI doesn't pay enough attention to during code reviews. Rather than hiding malicious instructions in lines of code, the researchers tucked them inside an image file. Since many AI review tools treat images as decorative assets rather than as something worth inspecting, the pull request can appear perfectly harmless and sail through the review.

Read more
AI has already fallen into the wrong hands and they’re using it to make bombs
Logo, Text

Artificial intelligence has quickly become the go-to tool for everything from writing emails and summarizing meetings to helping students study or developers debug code. But the same technology that saves people time can also be misused, and a new report suggests that terrorist organizations are finding ways to do exactly that.

According to a research paper shared with The New York Times ahead of its publication, researchers found evidence that members of Boko Haram have been using popular AI chatbots to support both day-to-day activities and combat-related tasks. Interviews with 27 former members conducted in Nigeria over the past two years suggest that tools such as ChatGPT, Gemini, Claude, Grok, Meta AI, and DeepSeek were used to gather technical information, troubleshoot weapons, and even assist with planning attacks.

Read more
Claude Code can now browse the web without opening Chrome
The desktop app now includes an in-app browser that can read websites, click links, and interact with web apps.
Claude Code Featured

Developers spend a surprising amount of time bouncing between their code editor, browser tabs, API documentation, GitHub issues, and design files. Anthropic thinks Claude Code should simply do all of that without constantly asking users to switch windows. The company has announced a new in-app browser for Claude Code on desktop, allowing its AI coding assistant to open websites, read documentation, inspect designs, and interact with web pages directly from within the application.

A browser built into Claude Code

Read more