After feeding a type of AI known as a recurrent neural network the roughly 5,000 pages of Martin's five previous books, software engineer Zack Thoutt has used the algorithm to predict what will happen next.
According to the AI's predictions, some long-held fan theories do play out - in the five chapters generated by the algorithm so far, Jaime ends up killing Cersei, Jon rides a dragon, and Varys poisons Daenerys.
Each chapter starts with a character's name, just like Martin's actual books.
But in addition to backing up what many of us already suspect will happen, the AI also introduces some fairly unexpected plot turns that we're pretty sure aren't going to be mirrored in either the TV show or Martin's books, so we wouldn't get too excited just yet.
For example, in the algorithm's first chapter, written from Tyrion's perspective, Sansa turns out to be a Baratheon.
There's also the introduction of a strange, pirate-like new character called Greenbeard.
"It's obviously not perfect," Thoutt told Sam Hill over at Motherboard. "It isn't building a long-term story and the grammar isn't perfect. But the network is able to learn the basics of the English language and structure of George R.R. Martin's style on its own."
Neural networks are a type of machine learning algorithm that are inspired by the human brain's ability to not just memorize and follow instructions, but actually learn from past experiences.
A recurrent neural network is a specific subclass, which works best when it comes to processing long sequences of data, such as lengthy text from five previous books.
In theory, Thoutt's algorithm should be able to create a true sequel to Martin's existing work, based off things that have already happened in the novels.
But in practice, the writing is clumsy and, most of the time, nonsensical. And it also references characters that have already died.
Still, some of the lines sound fairly prophetic:
"Arya saw Jon holding spears. Your grace," he said to an urgent maid, afraid. "The crow's eye would join you.
"A perfect model would take everything that has happened in the books into account and not write about characters being alive when they died two books ago," Thoutt told Motherboard.
"The reality, though, is that the model isn't good enough to do that. If the model were that good authors might be in trouble ... but it makes a lot of mistakes because the technology to train a perfect text generator that can remember complex plots over millions of words doesn't exist yet."
One of the main limitations here is the fact that the books just don't contain enough data for an algorithm.
Although anyone who's read them will testify that they're pretty damn long, they actually represent quite a small data set for a neural network to learn from.
But at the same time they contain a whole lot of unique words, nouns, and adjectives which aren't reused, which makes it very hard for the neural network to learn patterns.|
Thoutt told Hill that a better source would be a book 100 times longer, but with the level of vocabulary of a children's book.