Authorial Intent

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.

a line compile
the mind concern
about the style
in turn

Like other poetry programs, Authorial Intent writes mostly nonsense. At its best, it gives the impression of teetering on the edge of meaningfulness. I have many ideas about how to improve it—but that is for the future.


The titles were chosen by the program; the untitled poems never had one. I edited some of the poems, as noted.

and who has to have
that the world has to have that?
i try to have to.
(I added the punctuation and changed two words to correct the grammar.)
attractive—modern—still unclear—
attractive—will have to
consider that the issue here
contributes to pursuit
(I added the punctuation.)
free exercise ahead survey
the action and you might
expect to lead provided they
return to work tonight
And you can never visit to
Environmental Revenue.
(I added the punctuation and capitalization.)
deny the crisis! fly
the nightmare! fly the eyes
of insects! flick
the conditional tick
beside financial flies!
(I added punctuation and changed a few words.)
the engineering recognise
especially of a compromise
all renaissance
all afternoon
in all immune
suspect the dust
expect the breath
say when the death
be just
the button review
the breast qualify for the
domestic woman
(Hint: It’s about Eve.)

How It Works

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 tricky. 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.

If I can get permission from the necessary copyright holders, I will release the source code. Cross your fingers.

Related Stuff by Me

16 April 2008; Donald Hall link added November 2011