Procedurally-Generated Novels

If I was suddenly given ‘fuck-you money’ – about £3 million would do it, I reckon – I would still write computer software. But rather than build financial systems, I’d work on procedurally-generated literature. Enterprise software is interesting, but it doesn’t have the philosophical dimension of trying to make a computer write like a person.

I’ve toyed with this a little through the Mechapoet, which never quite managed to be entertaining enough (we did beat one human poet in a slam, but only one). After an evening in the The Basketmakers with Shardcore, I realised I didn’t have the time or patience to put in the work needed for something more impressive.

I made a few other experiments. One was around haiku. These poems are so simple and often shorn of context, so there is a decent chance of beating human writers. All I’d need is the right data set, and a way of judging the new ones. Applying a fitness function via the web was going to be a great deal of work, and I already had a lot of work in my life. But I occasionally day-dream about procedurally-generated literature.

Writing entire novels by computer is a long way off. There have been early attempts, and these tend to be avant-garde rather than containing the sustained narrative we want from novels. There is a website that compares human and computer poetry, and it tags some human poets as being particularly “computer-like”. These poems are fairly ‘experimental’ and it is these fringes that are most open to the computer.

The first book that claimed to be written by a computer was The Policeman’s Beard is Half Constructed, written in 1984 using a program called RACTER. It’s not particularly readable, and is remarkable more for how it was written than the contents.

Another early computer-generated book is Nick Monfort’s World Clock, generated from 165 lines of python code, and is inspired by the work of Oulippian Harry Mathews. The text is interesting, but relies on its structure. I could imagine having responded to this sort of text in an MA workshop class, but it doesn’t have the narrative drive one would expect from a novel.

There was a lovely 2014 Sabotage Reviews piece reviewing 9 computer generated-novels, which included a couple of particularly fascinating examples. One was “a desperate talking clock written by the people of Twitter”, using entries mentioning each specific time. Another “creates a harrowing story from tweets mentioning National Novel Writing Month.

The writer of this piece, Harry Giles, found an interesting angle on generated literature. He suggested that it is part “of the Oulipian tradition of writing from constraint: if you make such-and-such a ruleset, what kind of writing might happen?” He also compared the results to internet-inspired ‘anti-literature’ forms:

[the thing that generated texts are] closest to is the flattened affect and repetitions of alt-lit, with dashes of uncreative writing, flarf and other post-internet poetics. In other words: as humans increasingly write in dialogue with the internet and machine automations, machines are increasingly being written in dialogue with human literature

Probably the best example of generated text is the Magic Realism Bot. This produces some beautiful images, but it is basically a ‘madlibs’ style program, inserting a pool of words into specific places in pre-prepared sentences. On top of this, the creator prunes out the obvious misfires. It’s a beautiful piece of work, but relies heavily on human innovation and intervention.

(This intrusion of human editing has long been a part of generated texts, even before the computer. William Burroughs would spend hours making cut-ups, which involved slicing physical text with a knife and realigning it to see where new meaning emerged. Out of all this work he would pick the best pieces.)

I actually own one book written by a computer, a version of John Higgs’ recent book on the future, produced by Shardcore with the assistance of GPT-2. The grammar is pretty good, and it turns up some beautifully-weird phrases.

In Higgs’ The Future Starts Here, Shardcore describes the “big scene of bottists who are generating novels and books of poetry. They build these machines to write the stuff, but in the expectation that nobody’s going to read them. You read the first page and think ’I get the gist of this’, but you don’t go on, because it doesn’t make any sense… For it to be a book that you want to read, there’s a lot more to it…

Shardcore wrote a long blog post dealing how he worked through different techniques before using GPT-2 – “Markov chains produced the usual markov stuff”, and there were also failures from word-level and character-level Recurrent Neural Nets. But he hits the motherlode when GPT-2 created a weird description of the film The Breakfast Club. An entire book was subsequently produced, credited to Algohiggs.

Computer-generated texts are going to become more common. There is even a computer generated textbook on Amazon, Lithium-Ion Batteries: A Machine-Generated Summary of Current Research Hardcover, which costs £30.

My favourite generated text (which I’ve taken almost a thousand words to get to!) is Emily Short’s Annals of the Parrigues. This is a travel guide to an imaginary country, produced from a number of out-of-copyright source texts. It’s hypnotic, with some clear glimpses of a literature.

Procedural generation works well in video games, where it can generate sufficiently-interesting content more easily than people can. In 1984’s Elite, it allowed the game to contain far more worlds that would otherwise fit in the limited memory and storage space of the time. It’s interesting to think about what sort of book might be generated by directly by software and read by people who didn’t care that it was computer-generated. If I had the time and the money, I’d love to find out. Since I don’t, I’ll carry on writing stories the easy way.

If you want to follow what I'm up to, sign up to my mailing list

Leave a Reply

Your email address will not be published. Required fields are marked *