Authorial Intent is a computer program that writes poetry with rhyme and meter. It can also write haiku, but unlike most poetry programs, it does not know how to write free verse.
The program is from 2008. The text below is written from a 2008 point of view. It is far less capable than a modern chatbot (and much simpler). But its best little versicles can be interesting.
Like other poetry programs, Authorial Intent writes mostly nonsense. At its best, it gives the impression of teetering on the edge of meaningfulness.
The titles were chosen by the program; the untitled poems never had one. I edited some of the poems, as noted.
All other poetry programs that I am aware of are top down: They start with a template—perhaps a complicated nested template: “here are the choices for what a sentence can look like”—and fill it in. Authorial Intent is bottom up: It starts with a random poem and repeatedly rewrites it to make it better. Technically speaking, the program optimizes the poem using simulated annealing, a general purpose optimization algorithm.
A top-down poetry generator is fast and can be simple. Authorial Intent is much slower; I usually have it do a million rewrite steps (beat that, Donald Hall!), which means that it takes two or three minutes to write a four-line poem. On the other hand, a bottom-up program may be more capable and creative, because it is not restricted to predefined templates. Authorial Intent knows about rhyme, meter, assonance and consonance; it has a primitive idea of adherence to a theme; it has ways to measure the naturalness of its use of English—and above all it understands how to trade off these different features to make the final poem as interesting as it can.
Version 1. The first version of Authorial Intent was purely bottom-up. It started with a random sequence of words, and changed them until they seemed to make sense. It worked adequately, but parsing was a bottleneck, and the program had to spend a lot of time finding sequences of words that were grammatical.
Version 2. The current version is top-down in syntax and remains bottom-up in all other aspects. It fills in sentences from syntax templates, like a traditional program, and it also knows how to rewrite the syntax step by step so that the optimization algorithm can operate.
It starts with a random poem, which is grammatical and has approximately the right number of lines, but otherwise bears no resemblance to the target poem. At each optimization step, it rewrites a bit of the syntax, substitutes a word, or moves a line ending, and then it evaluates the rewritten poem, giving it a numerical score for how “good” it is. Under the direction of the simulated annealing algorithm, it decides whether to keep the rewritten version or the original. During the rewriting process it discovers how to make the poem rhyme, scan, and generally sound right. After perhaps a million optimization steps, it prints the finished poem.
I would like to make the Haskell source for the program available, but the intellectual property situation is too tricky for me. Authorial Intent uses a lot of language data which I did not create. The data is all free for download, and where I don’t have the right to redistribute it I can tell you where to download it, but I had to edit the data to make it work better in the program. And I can’t distribute patch files, because they would contain some of the same data that I’m not allowed to redistribute.
I’ve given up, unfortunately. The code will stay closed for now.
16 April 2008; Donald Hall link added November 2011
note about modern chatbots added July 2023