(Bloomberg) -- More than two decades after J.K. Rowling introduced the world to a universe of magical creatures, forbidden forests and a teenage wizard, Harry Potter is finding renewed relevance in a very different body of literature: AI research.A growing number of researchers are using the best-selling Harry Potter books to experiment with generative artificial intelligence technology, citing the series’ enduring influence in popular culture and the wide range of language data and complex wordplay within its pages.  Reviewing a list of studies and academic papers referencing Harry Potter offers a snapshot into cutting-edge AI research — and some of the thorniest questions facing the technology. 

In perhaps the most notable recent example, Harry, Hermione and Ron star in a paper titled “Who's Harry Potter?” that sheds light on a new technique helping large language models to selectively forget information. It’s a high-stakes task for the industry: Large language models, which power AI chatbots, are built on vast amounts of online data, including copyrighted material and other problematic content. That has led to lawsuits and public scrutiny for some AI companies.The paper’s authors, Microsoft researchers Mark Russinovich and Ronen Eldan, said they’ve demonstrated that AI models can be altered or edited to remove any knowledge of the existence of the Harry Potter books, including characters and plots, without sacrificing the AI system’s overall decision-making and analytical abilities.  The duo said they chose the books because of their universal familiarity. “We believed that it would be easier for people in the research community to evaluate the model resulting from our technique and confirm for themselves that the content has indeed been ‘unlearned,’” said Russinovich, chief technology officer of Microsoft Azure. “Almost anyone can come up with prompts for the model that would probe whether or not it ‘knows’ the books. Even people who haven't read the books would be aware of plot elements and characters.”

In another study, researchers from the University of Washington in Seattle, University of California at Berkeley and the Allen Institute for AI developed a new language model called Silo that can remove data to reduce legal risks. However, the model's performance significantly dropped if trained only on low-risk text such as out-of-copyright books or government documents, they said in a paper published earlier this year.

To go deeper, the researchers used Harry Potter books to see if individual pieces of text influence an AI system’s performance. They created two datastores, or  collections of websites and documents. The first included all published books except the first Harry Potter book; another included all books in the series but the second, and so on. “When the Harry Potter books are removed from the datastore, the perplexity gets worse,” the researchers said, referring to the measure of accuracy of AI models. 

AI studies have cited Harry Potter for at least a decade, but it’s become more common as academics and technologists have focused on AI tools that can process and respond to natural language with relevant answers. With Harry Potter, “the abundance of scenes, dialogs, emotional moments make it very relevant to the specific area of natural language processing,” said Leila Wehbe, a Carnegie Mellon researcher who ran a set of experiments in 2014 collecting brain MRI data from people reading Harry Potter stories to better understand language mechanisms. On arXiv, an open-access repository of scientific research, recent papers include, “Machine learning for potion development at Hogwarts,” “Large Language Models Meet Harry Potter” and “Detecting Spells in Fantasy Literature with a Transformer Based Artificial Intelligence.”

Even when it’s not central to the research, Harry Potter is also a favorite literary reference for researchers. One study, for example, used Rowling's works to test the intelligence of AI systems such as those that spawned the chatbot ChatGPT, a topic that has generated much heat in recent debates. Terrence Sejnowski, who directs the computational neurobiology laboratory at the Salk Institute for Biological Studies, argued in the paper that chatbots merely reflect the intelligence and biases of their users, like the Mirror of Erised in the first Harry Potter book, which reflects a person’s desires back to them“Harry Potter is popular with younger researchers,” said Wehbe. “They would have read them as children or adolescents, thus thinking of them when choosing a written or spoken text corpus.”

©2023 Bloomberg L.P.