30 Nick Montfort Makes Poetry with Pi
There are some things a computer can do better than people. One of them is that it can just keep going.
—Nick Montfort58
Nick Montfort is a man of many talents. Besides his storytelling algorithm, he also creates never-ending streams of poetry.
Here is an example from a poem he calls “Round”:
Form intends intense verse crease to tense form tense vent verse tone
verse form crease form vent tends to crease to tends form form vent
form crease tone verse tense
crease vent vent tends inverse tone into verse form verse verse form
tone tense in
tense vent crease
verse tone tends tense tends tense verse crease form
tone vent into tends
to crease vent to crease59
And so on, ad infinitum.
“People enjoy my work better when it is read out loud,” Montfort tells me.60 Indeed, when he does a reading, which he does with great style, it all seems to make sense. Most computer-generated writing tends to be prose, using words generated by algorithms, based on databanks of literary works, massaged using Markovian methods to choose the most probable word sequences. Montfort’s work is different. “The work of art is the computer program. I select the words. They’re mine,” he says.
“Round” is one of the works in Montfort’s 2014 book of poems, #! (pronounced shebang, as in “the whole shebang,” the whole universe under consideration). Montfort prints each poem alongside the computer program that generated it, depicted as a work of art, with letters, numbers, and symbols in white on a black background. For “Round,” he used the programming language Python. He prefers his programs to have the fewest possible lines—that is, to be as simple as possible—from which to produce his literary creations.
Montfort created “Round” by applying the unique properties of pi (π), the ratio of the circumference of a circle to its diameter. Pi cannot be written as the ratio of two integers and therefore never ends and never forms a pattern. Numbers that are the ratio of two integers, like 1/3, on the other hand, are also infinite in extent but form patterns: 1/3 = 0.3333333 … Pi has been calculated to trillions of decimal places, still with no discernible pattern. The first numbers are 3.14159265358979 … Although infinite in extent, pi is deterministic because there are formulae to calculate it. It goes on forever, eternally growing and changing.
Montfort chose nine words to represent the numbers one to nine, with in as one, plus eight other words that also form valid words if in is put in front of them: crease, form, tends, tense, to, tone, vent, and verse. To represent zero, he used a line break. He also ignored the decimal point. The algorithm, which included a module to calculate pi, did the rest. The first line of the poem quoted earlier, beginning with form and ending with tense, represents the first thirty-one decimal places of pi—counting the first two decimal places from the word after form, which is intends. The number represented by the last word in the line is zero, represented by a line break, and so the next line of verse begins.
“Round,” Montfort says, “is a visualization, a textualization, of the digits of pi in which pi’s digits are mapped to word strings.”61 Whenever the poem is run, every word will be the same. In this sense it is “unoriginal,” he adds, tongue in cheek. “It’s very much about the materialization of computing,” he explains. “Increasing computational power allows us to figure out more and more digits [of pi].” On Montfort’s website, we can see the poem unspooling, with more and more lines appearing on the screen.
Mild-mannered, in open-necked shirt and jacket, Montfort seems nothing like most people’s imaginings of a creator of cutting-edge computer-generated poetry. Even as a child, his interests always spanned literature and computers. As an undergraduate he studied liberal arts and computer science, then completed master’s degrees in media arts, creative writing, and information science. His PhD thesis was on computer generation in interactive fiction (IF), a form of interactive literary narrative based on games, in which the player makes decisions that change the course of the story.
While “Round” goes round and round, coming out the same no matter how many times you run it, Montfort’s poem “Through the Park” is different every time. “It is a highly intentionally constructed distribution of language. Chance is something I put into the system,” he says.
The Python program for “Through the Park” contains twenty-five sentences chosen by Montfort to set the scene (“The girl sets off through the park”), inject a bit of menace (“The man makes a fist behind his back”), and so on. The program arranges the sentences at random, separated by ellipses: “The girl grins and grabs a granola bar … The girl puts on a slutty dress … The girl turns to smile and wink … The man makes a fist behind his back … A snatch of song reminds the girl of her grandmother … Laughter booms … The man’s breathing quickens … Pigeons scatter … The girl runs … Things are forgotten in carelessness … The girl’s bag lies open.”62 Every time the program is run, the order of the sentences is different, and the generation of stanzas can go on forever. As Montfort says, “This shows that there are some things computers can do better than people. One of them is that it can just keep going.”63
In his computational poetry, Montfort also explores the imagistic possibilities of words, using words to make pictures, akin to the concrete poetry of Guillaume Apollinaire, an early twentieth-century French poet. His playful “poem” “Alphabet Expanding” sprays the screen with letters of the alphabet flying about randomly, forming lines or falling like rain, sometimes closely spaced, sometimes spattered about.64 For this he used the programming language Perl. His program is minimal: one line of thirty-two characters. One of the aims of this poem, he says, was to understand how Perl works “from the standpoint of literary art.”65
As Montfort points out, displaying code alongside output data goes back to the 1980s, when users had to type computer programs into home computers. They were also given sample output to make sure they got it right. Similarly, in his book #!, each text is preceded by the program that generated it.
This was the premise behind Codedoc, an exhibition curated by Christiane Paul and shown at the Whitney Museum in 2002. For this, twelve well-known coders wrote code that connected three points in space and was able to power a video. Video and code—image and text—were displayed side by side, the message being that code is a form of creative writing. Inspired, Montfort styled his book #! after this exhibition. “Code pages are in black with white text, and output white with black text,” he explains.66
People say that reading #! can give them a feel for how code works even without a background in programming. “I can use it as a text in translation,” Montfort says, explaining that if a reader knows a little programming, they can compare his poems with the programs used to create them to get a better idea of what programming is all about.67 “The instructions themselves are the work of art,” he says. When you give a sign-maker instructions to produce a sign, it is the instructions that embody the work of art. Montfort is deeply interested in the nature of computer languages—how they are written, their aesthetics, their beauty, their literary art.
This led him to look into weird computer languages—esoteric languages, or eso languages.68 “When we start looking into it,” he says, “there are people who use intentionally difficult methods, like poets and authors of metafiction and other sorts of contemporary literature.”69 Since 1984, there has been a contest for writing the most creatively obfuscated code, the International Obfuscated C Code Contest. Only small but complete programs in the C programming language are permitted. The originality lies in the aesthetic abuse of C. One entry in the 1984 competition was a two-line program to generate Hello World, the first output when learning any computer language. In today’s machine learning, Hello World marks a computer’s awakening, like a newborn baby, as it responds to input data.
Eso languages are unwieldly and hence not aesthetic, not elegant. In his book The Art of Code, Maurice Black points out that these terms “and all their synonyms have been effectively exited from the vocabulary of literary and cultural theory.”70
Montfort published a new book, The Truelist, late in 2017.71 It is “a book-length poem generated by a one-page stand-alone computer programme” and “invites the reader to imagine moving through a strange landscape that seems to arise from the English language itself.”72
The first two stanzas are as follows:
Now they saw the foothills,
and the airking,
the earthworm,
the sliphound exceeding the king,
The heartwoman,
the shiphound,
the hardpath river leading the ship,
the traplight welcoming the work.
Montfort’s notion of creativity is at odds with that of the computational creativity community whose members investigate creativity with models often using complex mathematics, with overarching rules and huge databases. Pablo Gervás says of Montfort’s work, “Nick very clearly sees himself as a writer who makes use of technology in different ways to make progress in his writing. We work from the opposite end. We are engineers who do not have literary aspirations.”73
Montfort asserts that he is coming from the bottom up, using minimal algorithms and taking great care in his choice of words,74 whereas Gervás and others work from the top down, using complex algorithms and huge databases. His systems, he says, are simple compared to theirs. “I want to invite my friends who are poets to work on these things with me.” He would like his readers to use his programs to remix his poetry and play with it, using the algorithms displayed with the original poems.
This is how, he feels, it is possible to move from sequences of words to distributional poems. “Is this a model of creativity like the computational creativity community thinks about it? No, I don’t think so,” he says.”75
As one reviewer wrote of #!: “#! … expands the kinds of successes that code-based poetry can achieve. … Montfort’s programmatic poems shape ways of thinking on the page that reveal a persona in the machine that, surprisingly, thinks like us even if its expression is somewhat uncanny by ‘human’ standards.”76
Uncanny indeed. This, surely, is when things get interesting, when we start to sense a personality inside the machine. Montfort’s poetry uses computers “as poetry assistants, as generators of provocative and interesting literary art, visual art, and music.”77 A fascinating example of creative computing.