From “Kubla Khan” through GPT and beyond

by Bill Benzon

Portrait of Kublai Khan by artist Araniko, drawn shortly after Kublai’s death in 1294. His white robes reflect his desired symbolic role as a religious Mongol shaman.

I became hooked on Coleridge’s “Kubla Khan” in the Spring of 1969, my last semester as an undergraduate at Johns Hopkins. Three years later “Kubla Khan” had become the standard against which I measured my understanding of the human mind. That is why I am about to tell a story about how my interest in the mind has evolved through “Kubla Khan” to include, most recently, ChatGPT. Strange as it may seem, that poem is the vehicle through which I am coming to terms with this new technology and arriving at a sense of its potential.

There is a sense in which the story of that great poem can be traced back to the 11th century invasion of Britain by the Norman French, for that’s what gave rise to the English language. Some centuries later that story encountered a tale born of an encounter between an Italian merchant, Marco Polo, and a Mongolian warlord, Kubla Khan, which, when enlivened by the East India Company’s trade in opium, set fire to the mind of Samuel Taylor Coleridge in the late 18th and early 19th centuries. We need not trace that trajectory in any detail. I mention it only to give a sense of the scope of this 54-line poem, which is one of the best-known poems in the English language, and is perhaps unique in the annals of Western literature. It has made its mark on popular culture, from Orson Welles’s Citizen Kane, where it names Kane’s estate, Xanadu, thereby establishing the matrix for the whole film, to a hit song and film by Olivia Newton-John, Xanadu, and even provided that most vulgar of real-estate barons, Donald Trump, with the name for the nightclub, Xanadu, in his now defunct Atlantic City casino.

Romantic states of consciousness

I may well have read the poem prior to taking Romantic Literature with Professor Earl Wasserman in 1968-1969. But I have no memory of that. Though we didn’t study Coleridge until the second semester, it’s probably best if I start my story with the first semester.

The course started with Keats. I decided to write my paper about a minor poem, “To–[Fanny Brawne],” and had delayed writing until the night before it was due. I was tired and my mind snapped. All of a sudden, I was typing a passage from one of Keats’ letters to Fanny, but I experienced the act of typing as though the words were my own. When I finished that passage my mind was astir and found its way to the second stanza of “Ode on a Grecian Urn” – You know “Heard melodies are sweet, but those unheard Are sweeter…” I read those words as though they were my own.

I finished the paper, turned it in, got a grade, and… I had a problem: What was that!? I didn’t know. But this was the 1960s and altered states of consciousness were all the rage, drug induced, but also meditation, and now it seems, the influence of late night poetry on a tired mind.

Next up: Percy Bysshe Shelley, he who had declared poets to be “the unacknowledged Legislators of the world.” Again, I delayed writing my paper until the last minute. I was tired. The damned paper wrote itself, through me. But I didn’t experience anything of Shelley’s as though I had written it. It was different from the experience I had writing about Keats. The words just lined themselves up, one after the other and flowed down my arm, thought my fingers, from the typewriter and onto the page. It was easy. No sweat.

It was a good paper too.

Wordsworth was up in the Spring semester. That was the best paper I’d written as an undergraduate. Wasserman remarked that it “was a mature contemplation of the poem” – though I forget just what poem it was. There were no mental hijinks. I wrote it with the standard congeries of a sentence or three here, a paragraph there, pace the room a bit, make a note or three, look up something, back to the typewriter, rinse, repeat, and so forth….it’s done.

And so it went with my “Kubla Khan” paper.

The poem itself presents a number of problems. The first is: What’s it about? There’s no narrative there. It’s often been dismissed as word music. Word music it is, but that’s no ground for dismissal.

And then there’s the preface. Coleridge said the poem was incomplete. He was lost in an opium reverie when two or three hundred lines came to him – “all the images rose up … as things, with a parallel production of the correspondent expressions, without any sensation or consciousness of effort” – which was dashed when he was interrupted by a man from Porlock. When the Porlockian had gone, so had those two or three hundred lines that had risen up. All that was left were the 56 lines of this, one of the most extraordinary poems in the world. In fact, there’s nothing obviously missing. If it weren’t for that preface, no one would even suspect that the poem was incomplete.

Critics have had various ways of dealing with the disparity between the poem itself and Coleridge’s claim. I invented another solution to the problem. It’s easy and natural to read the second part of the poem as asserting that the poem is incomplete (I’ve appended a complete text to the end of this essay). The speaker says “Could I revive within me” (i. 42), clearly implying that he can’t, but if he could he would “build that dome in air” (p. 46). The dome is assumed to be Kubla’s pleasure-dome from the first part and is here being used as figure for the poem itself. That’s a perfectly respectable reading of those lines.

I pushed it a step further. I asserted that the poem paradoxically completes itself by asserting that it is incomplete. That kind of reading has it all. The wealthy English of Coleridge’s time were fond of placing incomplete or dilapidated structures in their gardens – “follies” they were called. An exquisitely dilapidated poem fit right in with that aesthetic. Moreover, such paradoxical readings fit right in with the rising tide of structuralist, post-structuralist and deconstructionist readings in American literary criticism. Despite all that that, Wasserman, who was more traditional in his conceptual leanings, Wasserman loved it.

Matryoshka dolls in Xanadu

But paradox was not all that I was thinking about. I also felt that, different as they were, the two parts of “Kubla Khan” were somehow, at bottom, alike. I went on to investigate that idea in a master’s thesis on “Kubla Khan.”

I had become convinced that we needed a new kind of literary theory to account for the poem, and Hopkins was just the place to develop it. The idea was to combine various strands of my undergraduate education – structuralism and semiotics, psycholinguistics, developmental psychology, and philosophy – to produce the required framework. I set to work. I took a cue from a diagram in the back of my Coleridge text, an edition prepared by Elisabeth Schneider, noted for her 1955 book, Coleridge Opium and Kubla Khan. She had a half-dozen or sone lines widely spaced on the page and drew lines between this word and that, thereby pointing out relationships between the words and phrases.

I decided to do that with the whole poem. I typed it out in both double-spaced and tripled-spaced versions and marked them in four colors of ink, red, black, green, and blue, like this, which are notes for the first eleven lines:

I have no idea how many such versions I worked with. Let’s say five or six, but it doesn’t matter. It was exacting, tedious, but also fun.

And it didn’t work. There were relationships galore, but I couldn’t make any sense of them. There was no coherent pattern that evolved over the course of the poem, not like Lévi-Strauss found in his analysis of myths – he’d been a major inspiration. In an act of desperation, I tried one last thing. I set aside all of those complicated annotations and treated line-end punctuation like brackets and braces in a mathematical expression.

When I did that, here’s what I got for the first thirty-six lines:

The tree structure at the left depicts how the first thirty-six lines are divided into strings and substrings – and, keep in mind, that while we present text in rectilinear form on a page, it is (just) a one-dimensional string of words, one after the other. What is remarkable is that those lines are structured like nested matryoshka dolls. Those lines are divided into three sections; the middle of those is in turn divided into three; and the middle of those is, in turn, divided into three.

Now things are beginning to fall into place. Notice that the first section, lines 1 through 11, is dominated by Kubla Khan and are concerned with how things are arrayed in space and with vision. The second section (lines 12 through 30) presents a wailing woman and fountain through the sounds they make and in temporal terms, the waning moon, half-intermitted, momently. The third section straddles both of those realms, but at a distance, shadow, waves, mingled measure, and ending with:

It was a miracle of rare device,
A sunny pleasure-dome with caves of ice!

That final line is emblematic of the whole of those first thirty six lines – something I demonstrate in detail in my two published papers about the poem, Articulate Vision: A Structuralist Reading of “Kubla Khan” (1985), and “Kubla Khan” and the Embodied Mind (2003).

It turns out that the last eighteen lines have the same doll-within-a doll-within-a-doll structure, which I describe in considerable detail in those two papers. The structure of the whole poem, then, looks like this:

Notice that the emblem that concludes the first section of the poem returns, in slightly different form – “That sunny dome! Those caves of ice! – in the structural center of the poem’s second section. What’s that about?

Indeed, what IS that about, the whole kit-and-kaboodle? By the time I’d gotten that far I’d read everything the Johns Hopkins library had about “Kubla Khan,” at least in English. I found nothing like that. But then, and here I was relying on the knowledge of my teachers as well, there was nothing like that about any poem. Literary criticism just didn’t spawn beasts like that.

You need to understand that back in the 1960s Johns Hopkins was at the bleeding edge of American literary criticism. That’s where the (in)famous structuralist symposium of 1966 took place, which brought Derrida, Lacan, Todorov, and other continental notables to America. Though I didn’t attend it, I lived in its wake. My work on “Kubla Khan” started out as an exercise in structuralist criticism, and then it broke – by “it” I mean structuralism.

Thus I had no context in which I could understand the structure I found in “Kubla Khan.” Descriptively, it had to be real. I wasn’t imagining it. That is how the words are ordered on the page. But to accept it as real in some substantial way, as betokening a movement of the poetic mind, was also to place in question the practices of literary criticism. “Kubla Khan” is, after all, a canonical poem, and had received a great deal of attention from critics. If they’d all missed something that could be found by something as simple as attending to commas, semicolons, colons, periods, and exclamation points – which is what I did for the first 36 lines – well, just what ARE they thinking about? Could the profession have missed something so basic?

That seemed hard to believe. And, yet, at that time the profession was in conceptual turmoil. Things were up in the air. So maybe, just maybe…

Meanwhile, those tree structures looked like the diagrams drawn by linguists. I’d learned about Chomsky in a course James Deese taught on psycholinguistics. Moreover, I’d taken a course in computer programming – one of the first offered in an American university – and I knew about nested loops. The nested structures of “Kubla Khan” looked like the traces of some computing process. Perhaps that’s where the future lay?

Semantic networks and a Shakespeare sonnet

I opted for the future and decided to pursue the nested structure I’d discovered in “Kubla Khan.” I enrolled in a Ph.D. program in the English Department at the State University of New York at Buffalo (aka SUNY Buffalo). People in the English Department were impressed by my work on “Kubla Khan,” after all, the recommendations that got me into the program were based in part on that work, but they had little to say about it.

Fortunately another graduate student, Ralph Henry Reese, pointed me to David Hays in the linguistics department. Hays had been a first-generation researcher in machine translation (MT) during the 1950s and 1960s and coined the term “computational linguistics” (CL) when the field rebranded itself when it lost government funding in the mid-1960s. Why’d the funding disappear? People made promises about technical advances that they were unable to keep.

I joined Hays’s research group and learned computational semantics, one facet of an emerging interdisciplinary movement that became known as cognitive science. I ended up writing a paper on Shakespeare’s Sonnet 129, “Th’ expense of spirit,” which I published in a special edition of MLN in 1976. Here’s a diagram from that paper:

It’s quite different from those diagrams for “Kubla Khan.” Those diagrams took the form of a tree that represents strings of text. This diagram, and such diagrams generally – called semantic or cognitive networks – have a much richer form. Nor do they represent strings of text. Rather, they represent concepts themselves. Texts are generated as a path through a network of concepts.

That work, on which I was to base my dissertation, gave me the confidence to dream that in, say, a decade or three, we would have semantic network systems rich enough to “read” a Shakespeare play in an “interesting” way. What I meant by that is that the system would simulate how the human mind would read the play. One could then “open up” the model and examine just what it did in the course of reading the play.

But I didn’t go to graduate school to figure out a Shakespeare sonnet, however interesting and gratifying that work was. I’d gone to figure out what has happening in “Kubla Khan.” That I was unable to do. Semantic network systems have an aesthetics. They handle some things gracefully, others, hardly at all. I was unable to coax “Kubla Khan” into a semantic net.

In that sense I had failed. But that’s not at all how I felt. Working with Hays and his students was perhaps the best and richest period in my intellectual life. The ideas were exciting and the intellectual companionship was deeply satisfying. Yes, I hadn’t figured out what was happening in “Kubla Khan,” but I had gained a whole new world in which to adventure and explore. Somewhere, sooner or later, my queries about “Kubla Khan” would complete themselves.

But not in the academy. I had thought of the cognitive science I was exploring with David Hays and his students as a natural extension of the structuralism I had learned as an undergraduate at Johns Hopkins. That is what informed my initial work on “Kubla Khan.” As I was finishing my doctoral dissertation Jonathan Culler was touring the country, giving lectures from his recently published Structuralist Poetics (1975). Five years later structuralism was dead, replaced by deconstruction, post-structuralism and a host of other isms. There was no room in the academy for a cognitive science extension of structuralism. My academic career was over. I became a ronin scholar. I remain one today.

The wandering years

David Hays and I continued to collaborate. We published an account of metaphor that was based on Karl Pribram’s conceptualization of neural processing as being holographic in character, Metaphor, Recognition, and Neural Process (1987). Then we surveyed a wide range of work in computation, cognitive science, neuroscience, comparative psychology and developmental psychology which we published as Principles and Development of Natural Intelligence (1988). The title implied a critique of artificial intelligence, which was undergoing an “AI Winter” at the time. We went on to publish a series of articles on the cognitive underpinnings of cultural evolution.

Meanwhile, I’d published “The Visual Mind and the Macintosh” in Byte Magazine in 1985, which was a semi-technical magazine about microcomputers. A man named Richard Friedhoff, who had surveyed the world of computer graphics for Edwin Land (co-founder of Polaroid), read the article and invited me to collaborate on a coffee table book about computer graphics and image processing. We published the book with Harry Abrams in 1989, Visualization: The Second Computer Revolution. In the late 1990s a friend, Tim Perper, introduced me to the work of Walter Freeman, a neurobiologist who had done pioneering work on the complex dynamics of the nervous system. Freeman and I had a great deal of correspondence about the brain, and other matters, and I met him in 2005 when he came to New York to present a paper at the Dactyl Foundation’s Poetics-Cognitive Colloquy, where I also presented a paper. His ideas were foundational to my book on music, Beethoven’s Anvil: Music in Bind and Culture (2001). They also prompted me to re-formulate the work I’d done with Hays back in the 1970s and 1980s, moving it closer to a foundation in neuroscience.

Somewhere during this period I recalled my old hope that one day we would have a semantic network rich enough to read a Shakespeare play. Whoops! That hadn’t happened. Nor did that bother me. I had other things to think about. It was in this period that I wrote “Kubla Khan” and the Embodied Mind (2003) along with a companion piece, Talking with Nature in “This Lime-Tree Bower My Prison” (2004). The “Kubla Khan” piece was not only more detailed than the one I’d published in 1985, but also more refined in a way that is not easily explained, including as it did some speculation about possible neural underpinnings.

That is important. Why? Because the best single essay I’d read when I did my basic research at Johns Hopkins was one by Kenneth Burke: “Kubla Khan,” Proto-Surrealist Poem, (from Language as Symbolic Action 1968). Burke asserted that “this indeterminate mixture of motion and action is in effect a poetized psychology, detailing not what the reader is to see but what mental states he is thus empathically and sympathetically imitating as he reads.” Every poem, of course, is a creature of the brain, but a poeticized psychology would seem to have a particularly intimate relationship with natal matrix in the brain.

I’d even written to Walter Freeman about a scheme I’d come up with to detect patterns of oppositions from “Kubla Khan” (dome vs. caves, Kubla vs. damsel, etc.) in the neural activity of readers:

Walter,

I’ve had another crazy idea. […] The meaning of any reasonable hunk of language is a trajectory in a space of very high dimensionality.  Poetic form “carves out” a few dimensions of that space and makes them “sharable” so that “I” and “Thou” can meet in aesthetic contemplation.

So, what does this mean?  One standard analytic technique is to discover binary oppositions in the text and see how they are treated.  In KK Coleridge has a pile of them, human vs. natural, male vs. female, auditory vs. visual, expressive vs. volitional, etc.  […]

The trick, of course, is to pull those dimensions out of the EEG data.  […]

Later,

Bill B

Not crazy, Bill, but technologically challenging!

Will keep on file and get back to you.

Walter

I’ll take it. Alas, Freeman died a few years ago.

Through GPT to the future

And then, in early summer of 2020, GPT-3 was announced. It was time to get serious. By this time I’d been thinking about machine learning for about a decade, mostly in connection with work in digital humanities. How could (mere) statistics produce such a powerful proxy for meaning?

I took a cue from a remark by Sydney Lamb, a colleague of Hays’s. He pointed out that the meaning of a word in a semantic or cognitive network – recall the previous diagram from my work on Sonnet 129 – is a function of the relationships it has with other words. Those relationships are multidimensional. But sentence-level syntax has devices for indicating those relationships in a string so that one can recover their multidimensionality with a great deal of accuracy. Those devices are extended by other devices at the level of a whole discourse. It would thus seem possible, at least in principle, for statistical analysis to recover those multidimensional relationships from a sufficiently large collection of strings.

I argued that in a blog post, The brain, the mind, and GPT-3: Dimensions and conceptual spaces, which I subsequently included in a working paper, GPT-3: Waterloo of Rubicon? Here be Dragons. The argument was informal, with much hand-waving and tap-dancing, but it was enough to satisfy me that machine learning is not some form of mechanistic voodoo. We may not yet understand it, but there is an intelligible process at work.

Two years after that ChatGPT was unleashed. I was hooked, and have spent countless hours playing with it and writing post after post after post. I bit over two weeks ago I wondered: What about “Kubla Khan”? Can ChatGPT help me understand what’s going on? Note that I was NOT asking whether ChatGPT had anything to say about the poem that would help me. I don’t see how it could. No, I was asking whether or not thinking about the mechanisms underlying GPTs in general would be of any help in thinking about “Kubla Khan.”

Yes, it would, and I wrote a post about it: Vector semantics and the (in-context) construction of meaning in Coleridge’s “Kubla Khan.” I have a new way of thinking about that emblem, line 36 (“A sunny pleasure-dome with caves of ice”) and its recurrence in line 47 (“That sunny dome! Those caves of ice!”). It has long seemed to me that that emblem has a meaning which is NOT a simple composition of the meanings of its component terms. It is THAT, plus meanings that accrue by virtue of its context in the poem. Kubla’s decree, the gardens, the woman wailing, the vaulting fountain, the measureless caverns and those ancestral omens of war, all that is bound up in that one phrase. When that phrase is repeated in line 47, those meanings become activated and contribute thereby to the final lines of the poem. When the poem is complete, those meanings, like those of the poem itself, dissipate, as Coleridge wrote in his preface, “like the images on the surface of a stream into which a stone has been cast, but, alas! without the after restoration of the latter!”

The important point, which I explain in more detail in the post I’ve linked above, is that the semantics of machine learning technology treats meanings, of words, but also of phrases and sentences as well, as positions in a space of high-dimensionality. The space itself is defined by those dimensions. A point in such a space is defined by values on each of the many dimensions. Most of those points are empty, without words or phrases corresponding to them. Coleridge’s words in those first 36 lines are scaffolding which allows us to reach the point indicated in line 36. The scaffolding holds together long enough to inform line 47, and then it begins to collapse as the poem moves to a close:

For he on honey-dew hath fed,
And drunk the milk of Paradise.

It’s over.

Abstract? Unfortunately, yes. That’s how these things are. They are very abstruse, to borrow a word from Coleridge.

Assume for the sake of argument that what I have said is more or less correct. Is my curiosity about “Kubla Khan” now satisfied? No, it is not. I still do not understand the mechanisms of the matryoshka dolls. To understand that, I suspect, will require us to know more about the brain. GPTs may be artificial neural networks, in this context I’m afraid it is the artifice that seems dominant. It is not sufficient to the problem. More is needed.

But perhaps the study of “Kubla Khan,” or other literary works will suggest ways of further developing these models. If we can develop a framework which is common to both GPTs and “Kubla Khan” (or other literary works) then we can move back and forth between them. That is where we are today.

Just barely. It is fragile this framework. But it can be nurtured and developed. Is it so strange to think that, in the process, we will learn about both poetry and artificial neural nets?

It is not so strange to think of poems as material things. Can machines be poetic? If poems are rare devices, cannot machines be miracles?

“Kubla Khan” – The Text

In Xanadu did Kubla Khan
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea. (5)
So twice five miles of fertile ground
With walls and towers were girdled round:
And there were gardens bright with sinuous rills,
Where blossomed many an incense-bearing tree;
And here were forests ancient as the hills, (10)
Enfolding sunny spots of greenery.

But oh! that deep romantic chasm which slanted
Down the green hill athwart a cedarn cover!
A savage place! as holy and enchanted
As e’er beneath a waning moon was haunted (15)
By woman wailing for her demon lover!
And from this chasm, with ceaseless turmoil seething
As if this earth in fast thick pants were breathing,
A mighty fountain momently was forced:
Amid whose swift half-intermitted burst (20)
Huge fragments vaulted like rebounding hail,
Or chaffy grain beneath the thresher’s flail:
And ‘mid these dancing rocks at once and ever
It flung up momently the sacred river.
Five miles meandering with a mazy motion (25)
Through wood and dale the sacred river ran,
Then reached the caverns endless to man,
And sank in tumult to a lifeless ocean:
And ‘mid this tumult Kubla heard from far
Ancestral voices prophesying war! (30)
     The shadow of the dome of pleasure
Floated midway on the waves;
Where was heard the mingled measure
From the fountain and the caves.
It was a miracle of rare device, (35)
A sunny pleasure-dome with caves of ice!

A damsel with a dulcimer
In a vision once I saw:
It was an Abyssinian maid,
And on her dulcimer she played, (40)
     Singing of Mount Abora.
Could I revive within me
Her symphony and song,
To such a deep delight ‘twould win me
That with music loud and long, (45)
I would build that dome in air,
That sunny dome! those caves of ice!
And all who heard should see them there,
And all should cry, Beware! Beware!
His flashing eyes, his floating hair! (50)
Weave a circle round him thrice,
And close your eyes with holy dread,
For he on honey-dew hath fed,
And drunk the milk of Paradise. (54)

Bonus

“Kubla Khan” has had a tremendous effect on popular culture. Here is a Xanadu playlist on YouTube. It consists of various things, including recitations of “Kubla Khan,” videos based on the poem, some music, and other things. While there are recitations by famous actors, here’s a recitation by a high school student:

Here’s the newsreel segment from Orson Welles’s Citizen Kane:

This film was made for a school project: