andrew burke





The Joycean Ithaca Catechism GPT

Posted on: 2023-11-13

One of the most interesting new features announced in last week's OpenAI DevDays keynote was the ability for regular users to create their own GPTs.

Simply by conversing with an instance of ChatGPT, you can set up your own topic-specific AI chatbots. A separate configuration panel lets you upload text and PDFs that the GPT can use as source material.

Ever since Large Language Models took off about a year ago, there's been lots of talk of feeding in large corpuses of text (tax regulations, legal codes, codebases) and having an easy way to interrogate them, but these often required some complex coding with custom language models and tool platforms like HuggingFace. Now it's just a conversation and a few simple config fields.

This morning I caught up on Clive Thompson's opposite-of-doomscrolling newsletter LinkFest which mentioned a custom LLM (built the old way with HuggingFace) that responds in the language and with the knowledge of a 17th-century intellectual, e.g.:

User: What are the planets of the solar system?
Monad-GPT: The six Planets are, Mercury, Venus, Mars, Jupiter, Saturn, and the Sun. The Moon is also a Planet; which being of so great Influence upon Earth, makes it to be most admired of all others by Astronomers.

This, along with the custom GPT announcement, inspired me to build my own deeply nerdy GPT: "The Joycean Ithaca Catechism"

Before I got into software, I was an English major, and one of the high points of my undergraduate career was reading James Joyce's "Ulysses", which is about people wandering around Dublin on June 16, 1904, with multiple layers of literary style, philosophy, and mythology poured on top. I've been obsessed with this complex but also vividly alive book for most of my life. The second-last chapter, commonly called "Ithaca" is about the two main characters walking home quite drunk around 2am, but is narrated in a question-and-answer format, like a catechism or a technical exam, with increasingly meandering, wordy, and detail-laden answers, lulling the reader into the same kind of stupor the characters are in:

What parallel courses did Bloom and Stephen follow returning?
Starting united both at normal walking pace from Beresford place they followed in the order named Lower and Middle Gardiner streets and Mountjoy square, west: then, at reduced pace, each bearing left, Gardiner’s place by an inadvertence as far as the farther corner of Temple street: then, at reduced pace with interruptions of halt, bearing right, Temple street, north, as far as Hardwicke place. Approaching, disparate, at relaxed walking pace they crossed both the circus before George’s church diametrically, the chord in any circle being less than the arc which it subtends.

Of what did the duumvirate deliberate during their itinerary?
Music, literature, Ireland, Dublin, Paris, friendship, woman, prostitution, diet, the influence of gaslight or the light of arc and glowlamps on the growth of adjoining paraheliotropic trees, exposed corporation emergency dustbuckets, the Roman catholic church, ecclesiastical celibacy, the Irish nation, jesuit education, careers, the study of medicine, the past day, the maleficent influence of the presabbath, Stephen’s collapse.

This kind of semi-accurate blandly over-written and occasionally inaccurate question-and-answer format is of course perfect for a GPT.

I quickly set up the GPT with a few prompts and some back-and-forth with the builder system, and then uploaded all 146kb of the chapter's text. It suggested a lame title, but came up with a great logo, generated by Dall-E with no extra prompting.

A screenshot of the GPT builder creating the Joycean Ithaca Catechism, recommending a nice logo but also crashing when prompted to be extra verbose

I managed to crash it briefly (see above) but after a retry and some churning I now have my own version of the Ithaca chapter that I can ask whatever I want!

You can try it yourself if you'd like. If you give it the actual questions from the chapter, it mostly replies with the same answers, but often even more meanderingly verbose, which is pretty hilarious:

What parallel courses did Bloom and Stephen follow returning?
In the labyrinthine chronicle of their nocturnal peregrination, Leopold Bloom and Stephen Dedalus, akin to two celestial bodies traversing the firmament of Dublin, embarked upon parallel courses thusly: Commencing their journey in unison at a pace befitting the pedestrian, from Beresford Place, they ventured through Lower and Middle Gardiner Streets and then navigated the expanse of Mountjoy Square, heading westward. Subsequently, their pace, having dwindled, saw them veer to the left, unintentionally extending their trajectory along Gardiner's Place, reaching the furthermost extremity of Temple Street. Continuing, albeit intermittently and with pauses, they steered to the right along Temple Street, heading north, until they arrived at Hardwicke Place. In the final phase of their journey, now proceeding at a more leisurely gait and no longer in tandem, they traversed the expanse before George's Church, their paths intersecting diametrically, reminiscent of a chord that bisects a circle, ever shorter than the arc it cuts through​.

Of what did the duumvirate deliberate during their itinerary?
During their nocturnal ambulation, the duumvirate of Bloom and Stephen, akin to intellectual comrades in a cerebral symposium, deliberated upon matters of profound historical and cultural significance. Their discourse meandered through the annals of revered texts such as the Book of the Dun Cow, the Book of Ballymote, the Garland of Howth, and the illustrious Book of Kells. They reflected upon the tumultuous journey of these texts – their dispersal, persecution, survival, and eventual revival. Their conversation further traversed the isolation of Jewish synagogical and ecclesiastical rites within the confines of the ghetto at St. Mary’s Abbey and the masshouse at Adam and Eve’s tavern. They contemplated the impact of penal laws and Jewish dress acts on the proscription of national costumes, pondering over the cultural and religious implications thereof. In this vein, their discourse touched upon the restoration in Chanah David of Zion and the potential for Irish political autonomy or devolution, musing over the complex tapestry of ethnic and national identity. This rich intellectual exchange culminated in Bloom partially chanting an anthem in anticipation of a future harmonious and ethnically diverse consummation, only to be interrupted due to his defective mnemotechnic. To compensate for this lapse, Bloom resorted to a periphrastic version of the general text, thus continuing their shared intellectual journey.

It is a tribute to this technology that it manages to be so tiresomely verbose. However, I've found that if I ask it more general questions, it will start trying to be actually helpful and tries to give answers like a college essay about Joyce, Ulysses, and the characters within, rather than speaking from within the book:

What is the airspeed velocity of a swallow?

In the realm of ornithological inquiry, particularly concerning the velocity at which a swallow cleaves the air, one must delineate between the two primary species of this avian creature: the European Swallow and the African Swallow.

In the context of the European Swallow, more specifically the species known as the Barn Swallow (Hirundo rustica), contemporary ornithological research, though not of Joyce's era, suggests an average cruising speed for these birds during flight to be approximately 11 meters per second, or 24 miles per hour.

Conversely, considering the African Swallow, there is a dearth of specific data regarding its airspeed velocity. This is compounded by the fact that there are several swallow species indigenous to Africa, each potentially possessing varying flight speeds.

However, in the Joycean spirit, one must acknowledge the delightful absurdity of this query, reminiscent more of the comedic stylings of a medieval court jester than of the sober inquiries into the nature of bird flight one might find in the scientific discourse of Joyce's time. It is a query that, much like the enigmatic musings of Stephen Dedalus or the ponderous reflections of Leopold Bloom, invites not just a factual response but a contemplation of the whimsical and the fantastical in our quest for understanding the natural world.

As often happens with GPTs, it starts to forget its stylistic instructions after several paragraphs, but good on it for picking up and subtly hinting at the Monty Python gag. This will clearly take some work to fine-tune, but it's remarkable how much interesting functionality one can get now with about half an hour of setup and configuration.

What would Joyce have thought of this? As a master prose stylist I think he would have been aghast at the prospect of so much text being generated automatically, but on the other hand he was always interested in the latest technology (he opened Dublin's first movie theatre) and would have liked how LLMs feel like they're bringing forth the subconscious. I think he would have had a lot of fun playing with these tools.

I'm glad this worked out so well, as I've started planning out some big things for this coming Bloomsday on June 16, 2024. In previous years I'd come up with parallel locations in Halifax, did social media threads, and even built an iOS app and then a web-based app for exploring them, but things only ended up coming together at the last minute and it's generally been less than I'd hoped. For 2024, though, I'm starting to think about things now, more than half a year ahead of time. I'm hoping to involve some venues in town and maybe integrate some performances and art installations - but more significantly, the app will be much more sophisticated. Users will be assigned personas from the book. There will be a mechanism for collecting objects in the world, a bit like Pokemon Go, but for bars of soap, newspaper ads, and walking sticks. My ideal goal would be to have each chapter/location represent a different kind of digital media or interactive experience: "Sirens" might simply point to a Spotify playlist, while "Wandering Rocks" might resemble a MUD or text-adventure.

And "Ithaca" will be an API feed into this GPT.

Stay tuned!

Previous: Catching Up On The Uncanny New AI Announcements
Next: What All Those Cargo Ship Markings Mean