Wednesday Investigation 05: Books written by computers

On the long history of stories written by computers

Sheldon Klein, in 1973, developed a computer program called Novel Writer, which would write murder mysteries.

James Meehan, in 1977, developed a program called TALE-SPIN, which produced short fables about woodland creatures, complete with morals. Michael Lebowitz's UNIVERSE, developed in 1983, produced never-ending soap-opera plotlines involving a large cast of characters. S. R. Turner's MINSTREL (1993) created fantasy stories about knights, hermits, wizards, and dragons; Rafael Pérez y Pérez’s MEXICA (1999) created short Mexican folktales.

All of these projects are attempts to get computers to tell stories--usually genre stories--"successfully." (What, exactly, constitutes a "successful" story, and whether this can be meaningfully quantified, is a central pillar of the discourse surrounding these attempts.) My interest in these attempts derives, perhaps unsurprisingly, from a mix of motives. On the one hand, I'm genuinely interested in how computers work and what they can do--so I find the question of whether a computer could generate a readable novel compelling. (Accuracy compels me to note here that, despite the name, Sheldon Klein's "Novel Writer" system didn't actually output novels, but rather 2100-word short stories.) On the other hand, as an author of genre stories myself, I feel perhaps a little defensive about keeping my livelihood "robot-proof." Do we need to make the argument for leaving the humanities to, well, humans?



Let's set that question aside for a bit and get back to the notecard index. I had a few different notecards in there instructing me to take a look at the twentieth-century systems listed above, so, this week, I dutifully dug in. I read James Meehan's 1977 article on TALE-SPIN here, and I thumbed around in S. R. Turner's 844-page dissertation on MINSTREL.

Most of this stuff gets you into the thickets of computer science terminology (or theoretical narratology) pretty quickly, and I confess to glazing over when confronted with some of Turner's section headers like "TRAM:Achieve-B-Motivated-P-Goal" or "TRAM:Similar-Thwart-State." It wasn't a total drag, though. I did get some enjoyment out of seeing archetypal narrative fragments of human experience rendered in the cold language of computer logic: it's hard to see a section called "ALP:Burial-Denouement" without feeling a weird frisson, and who among us cannot relate to "PAT:Hasty-Impulse-Regretted?"

I also did begin to discern a pattern to these early systems. Namely, they seem to rely on the computer as a problem-solving device. Meehan's TALE-SPIN treats the core of a narrative, not unreasonably, as a character bumping up against a problem--wanting something. Meehan has seeded the program with knowledge about "physical space, interpersonal relationships, character traits, [and] bodily needs," among other things, and so the computer can use problem-solving mechanisms to chart a path for the character to get what they want. Let's say your character is "somewhat hungry"--TALE-SPIN gives you this:

This arguably meets the minimal definition of a story, but it's hard to make substantial claims for its value: it's not very interesting, nor does it really have a point. Meehan, to his credit, knows this, and he tries tackling the second problem first: drawing from Aesop's Fables, he refines TALE-SPIN so that the computer will have to solve the character's problem more circuitously, in such a way that the resultant story will also illustrate a moral. Here's another example in which the problem is still hunger, but we've added the need for a moral, specifically "never trust flatterers":

Harsh!

This is a bit more interesting, but, enh, not a lot more interesting. Still, pretty good for 1977!

Later attempts such as Lebowitz's UNIVERSE and Turner's MINSTREL improve on this model. They still use the computer as a problem-solving device, but they make an important shift: they treat the construction of the narrative itself as "the problem." Characters want something, sure, but authors want something too: they want to tell a compelling story. What if you could get a computer to grind through solutions to that problem, in the same way you tried to get it to help a bear find blueberries?

Lebowitz, trying to simulate soap operas, knows that one way authors do this is by keeping their characters "churning," that is, by preventing them from reaching a happy equilibrium. So he creates a program that solves the "problem" of how to do this by deploying a repertoire of plot devices. Here's the program churning a pair of lovers (Neil and Liz) by using a device called FORCED MARRIAGE (the villain, Stephano, forces Liz into remaining in a loveless marriage by using THREATEN (another device)). Lines marked with ">>>" indicate narrative output, everything else is computational back-end:


And so on. MINSTREL, a decade later, continues to refine this model--as far as I can tell, it is the first program that attempts to simulate "meaningful, overlapping concerns" on the part of its author, concerns that go beyond "keep the characters churning." It has been seeded with information about story structure, including theme, and has explicit goals to illustrate its themes in "interesting ways." It has knowledge about what constitutes boredom, and it will reject stories if it assesses that they're being told in a boring way. Here's a sample MINSTREL story:


Well, OK. This is recognizably a little more complex--note especially its sophistication with timeframe--but I'm not sure that it's not boring, despite the slaying of two separate dragons. We're still a far cry off from anything that anybody without an overriding interest in computational narrative would voluntarily choose to read. We could be forgiven for asking, around this point, whether this stuff ever begins to get fun?



Interestingly, as you trace the history of computational narrative, you notice two things happen once you move out of the twentieth century and into the twenty-first. The first is you see more and more humanists entering this field, gently taking the reins from the hard computer science types. Secondly--and this is probably not unrelated--the finished works become more engaging.

There's a sort of mental shift that happens, where people move away from treating the computer as a problem-solving device, and instead move toward treating the computer as a generative tool more broadly, a source for unpredictable outputs that might yield pleasure, narrative or otherwise. One important figure heralding this conceptual transition is the internet artist Darius Kazemi, who seeks to make technology more "human-scale and delightful." Kazemi first came on my radar, I believe, because of his Random Shopper project (2012), where he wrote a bot that would buy him $50 of randomly selected merchandise from Amazon each month, and blogged about what he received.

Kazemi's biggest contribution to the narrative-generation world came a year later, though: in 2013 he came up with "National Novel Generation Month," a riff on the better-known National Novel Writing Month (NaNoWriMo). NaNoWriMo, as you may know, wants its participants to produce a 50,000-word manuscript: NaNoGenMo, by contrast, also asks for a 50,000-word manuscript--only it has to be generated via code.

The bar here was kept crucially low. Kazemi didn't want participants to be agonizing over the narratological definition of the novel; he didn't want them to grapple with the "multiple, overlapping concerns" of authorship that programmers like Turner were trying to simulate. "The 'novel' is defined however you want," Kazemi wrote. "It could be 50,000 repetitions of the word 'meow'."

Which brings us to Hugo van Kemenade's 50,000 Meows, written to "get it out of the way."

"But this isn't just 'meow' 50,000 times," van Kemenade tells us. His script, meow.py, takes a source text and replaces each word "with a meow of the same length, keeping punctuation."

Here's the opening of Herman Melville's Moby Dick; or The Whale once it's gone through meow.py:


I don't think any human on earth would be able to read this at book length--Moby Dick is 215,136 words long--but it yields an important spark of pleasure and surprise which is lacking from the output of the more complex systems described above.

Two other figures are deserving of special attention here. The first is Nick Montfort, a poet and professor of digital media at MIT. Montfort has some real computer science chops--his "narrative variation" system Curveship (2011) has been fused with the aforementioned MEXICA and Fox Harrell's fascinating "polypoem"/oral narrative generator GRIOT (2006) to form Slant (2013), the closest thing we have to a computational narrative "supergroup." But he's also argued in this book that programming meaningfully "relates to the methods and questions of the arts and humanities." This syllabus for his class "Small Poetry Machines" includes links to many other jumping-off points for investigations into generative texts, including several book length texts. He also has a NaNoGenMo novel, World Clock, available as a free PDF.

And finally we have Allison Parrish, a professor of "interactive telecommunications" at NYU. Last but by no means least: I think Parrish has perhaps come the closest to affirmatively answering the question of whether a computer can generate a novel humans would want to read--her 2014 NaNoGenMo entry, I Waded in Clear Water, available as a free PDF, ended up on fantasy author Sofia Samatar's "top ten" list for that year. Her 2015 work Our Arrival, also a NaNoGenMo work, is maybe my favorite of hers, though. It's a weird, unstable travelogue--it feels simultaneously very familiar and also not quite like anything you've ever read before:


Both Montfort and Parrish have also written helped to facilitate midwifed [?] commercially available books of computer-generated poetry, Montfort with The Truelist (2017) and Parrish with Articulations (2018), both published by Counterpath Press. And if your tastes turn to fiction, Counterpath has also published an anthology of MEXICA short stories, as well as at least one novel, all as part of their series Using Electricity.

The phrase "Using Electricity," for what it's worth, comes from the poem "A House of Dust," generated by FORTRAN code developed by Alison Knowles and James Tenney in 1967, six years before Sheldon Klein's Novel Writer.

-JPB // Dedham, MA, May 19, 2020 (revised Wednesday, May 20)


PS: I am an affiliate of Bookshop.org--an online bookstore with a mission "to financially support local, independent bookstores"--and I maintain a list of books referenced in this newsletter. FTC rules advise me to disclose that I will earn a commission if you click through and make a purchase.