Most Read

Top stories

Artificial Intelligence Takes A Stab At Writing The Next "Game Of Thrones" Book

A software engineer programmed a recurrent neural network (RNN) to begin writing the upcoming novel in the famous ‘A Song of Ice and Fire’ series. Five chapters of the artificial intelligence-written novel exist thus far.

Artificial Intelligence Takes A Stab At Writing The Next "Game Of Thrones" Book

If there is one thing A Song of Ice and Fire fans know about author George R. R. Martin, it is that he is a notoriously slow and deliberate writer.

Some fans fear with Martin’s “advancing age” — he is only 68, but fans are watching the clock anxiously — and painstaking, laborious writing habits, he will never finish the final two books of the famed series.


With no release date in sight for the next book, already titled The Winds of Winter, anticipation led software engineer Zack Thoutt to seize control by using artificial intelligence to write the next book himself.

“I'm a huge fan of Game of Thrones, the books and the show,” Thoutt, who had just completed a Udacity course on artificial intelligence and deep learning, told Motherboard in an interview.

Thoutt began by adding the 5,376 pages of the five existing Ice and Fire books to the network.

Then, Thoutt started each chapter by providing a prime word to a recurrent neural network (RNN) — a type of computing system inspired by biological neural networks — and afterward gave the RNN an established word count for that chapter. For a bit of context, words can translate into numbers in programming. A prime word relates to when numbers are written in bases — or the numbers used as the basis of a numeration scale. Up to base 26, words are considered prime (as opposed to composite, square or perfect), because all 26 letters in the English alphabet are used.

According to Thoutt, “With a vanilla neural network you take a set of input data, pass it through the network, and get a set of outputs. In order to train these models you need to know what the model should ideally output, which is often called your labels or target variables. The neural network compares the data it outputs with the targets and updates the network learns to better mimic the targets.”

He added, “I had worked with RNNs a bit in that class and thought I’d give working with the books a shot.”

Some logistical issues arose. For example, the RNN would have functioned at a superior level if it had 100 times the content it used — essentially, even more writing from George R. R. Martin. Simpler vocabulary would have also proven more effective to the AI’s storytelling skills.

“Martin is obviously very descriptive in his writing, so those extra adjectives and the fictional locations and titles are just more complications for the network,” Thoutt explained.

The RNN missed some key details, like characters that had previously died, according to Thoutt.

The first five chapters of the AI-written novel — nearly 5,400 pages — are available on GitHub. Chapter one is also posted on Motherboard.

An excerpt of the AI-written novel reads, “Jaime yelped, in the dirt, and came to climb off beside his bedchamber, and we could almost find the tunnel at once, but we’d shut it without battle if she sings, then, and you may storm woods for fire to the west, where we feed the others. The rats come home to their lives!”

Though the segments of the written novel are grammatically near-perfect, only readers and fans can determine whether the story itself would be up to Martin’s high standard.

Predictions, such as Cersei’s death by brother/lover Jaime, a new character called Greenbeard, as well as Daenerys’ demise by Varys’ hand occur in the artificial intelligence version. However, there is no evidence that Martin plans to write any of these scenarios.

Unfortunately, fans of Game of Thrones books will have to wait another two years to find out.

In the meantime, other fan projects are in progress: a website called Inverse is requesting fan theories for the final season of the TV show. From there, the site is working with a firm, Unanimous AI, to determine hivemind predictions of the events to come.

As for George R. R. Martin, who really knows what the contemporary king of murderous literary surprises has in store for fans?

All of that beautiful, disturbing prose comes from his brilliant mind, but it could take some time to have it all in our possession. There is only one certainty: as Tom Petty famously put it, “the waiting is the hardest part.”