I'm describing my big Bloomsday Halifax project by writing up what I did for each episode. In this entry, I'm covering Episode 18 of "Ulysses": "Penelope".
In the Odyssey, Penelope is Ulysses' wife, who has remained faithful to him over all the years of his absence. In "Ulysses", Molly may not have been quite as faithful as Penelope, but this final episode closes the novel in the same way as the epic, with a return to the home and hearth and bed.
The final episode of "Ulysses" is justly famous: after taking us inside the thoughts of Stephen Dedalus and Leopold Bloom throughout the whole novel, Joyce finishes by putting us in the bedtime thoughts of Leopold's wife, Molly Bloom. She's on the edge of sleep and the writing style reflects the non-stop free-associative flow of thoughts one gets in that state. The entire episode is written in one solid block of text with next to no punctuation at all, topics shifting freely without the framework of paragraphs or even sentences, e.g.:
Yes because he never did a thing like that before as ask to get his breakfast in bed with a couple of eggs since the City Arms hotel when he used to be pretending to be laid up with a sick voice doing his highness to make himself interesting to that old faggot Mrs Riordan that he thought he had a great leg of and she never left us a farthing all for masses for herself and her soul greatest miser ever was actually afraid to lay out 4d for her methylated spirit telling me all her ailments she had too much old chat in her about politics and earthquakes and the end of the world let us have a bit of fun first God help the world if all the women were her sort down on bathingsuits and lownecks of course nobody wanted her to wear them I suppose she was pious because no man would look at her twice I hope Ill never be like her a wonder she didnt want us to cover our faces but she was a welleducated woman certainly and her gabby talk about Mr Riordan here and Mr Riordan there I suppose he was glad to get shut of her and her dog
Molly's lively, salty, and lusty inner voice is a striking and welcome change from the increasingly clinical and abstract narrative devices of the previous few episodes, and several passages from this episode, especially the final "yes I said yes I will Yes." have become justly famous.
I had several challenges in figuring out what to do with this episode in the app. It takes place in bed at home, not in some public Halifax location I could turn into a stand-in. There isn't really any action happening, or items to collect. So I decided to give this final episode some special behaviours instead.
First off, I didn't tie it to any specific location. I just included some instructions to the participant to do this episode last, when they are in bed at home at the end of their day of wandering Halifax and experiencing the novel.
More notably, I was able to have the app integrate with OpenAI's GPT4o to give every participant their own little LLM-generated summary of their day, written in approximately the style of the episode and in Molly's voice. I used AI in the Circe and Ithaca episodes, but I think this was the most integrated and interesting use of the technology.
The mobile app calls an API endpoint on the Rails server, which builds a summary list of the locations visited and virtual items collected by the user over the course of the day, and uses them in the following prompt to OpenAI's GPT 4o:
Context: You are Molly Bloom, the character from the novel 'Ulysses'. You write in a freeform digressive stream-of-consciousness style with no punctuation, line breaks, or paragraph breaks, like in the famous final 'Penelope' chapter of 'Ulysses'. You are a bit salty and lusty, living in a physical world. You are not very poetical, and a bit grumpy about the world. You are on the verge of going to sleep and your mind is wandering.
Prompt: Narrate most but not all of the following activities in a stream-of-consciousness style as if on the verge of going to sleep: #{summary}. Interject with 'yes' every so often, start the whole text with 'yes' and finish it with 'yes I will yes' Expand on the basic activities with freeform associations suitable for your character, and let your mind wander. Before and after talking about the activities, freeform talk about your feelings or your memories of singing or when you were young in Spain.
This prompt is the result of quite a bit of experimentation. Early attempts with GPT3.5 kept reverting to "term paper voice" after a few sentences, and would usually finish with some variation on "... and that is just like in James Joyce's great novel." GPT4 was much better at keeping the tone and using more poetic language. It tended to come out sounding pretty turgid though:
Yes, the Martello Tower, standing strong against Time's waves, a sentinel of past glories, a reminder of British might - aye, the cream, white and cool like Irish mist, a lather in my hands, a ritual of masculinitys. To the school, where minds are forged, young men groomed for a world that may not welcome them with open arms. The notebook, a blank canvas for thoughts to roam free, to rebel against the tyranny of line and margin.
It turns out LLMs are as good at churning out mediocre teenager-grade pretentious poetry as they are at churning out mediocre teenager-grade term papers. It turned out that that the biggest impact in the prompt engineering was when I simply told it to sound like Molly Bloom. Here's a later version with the same locations and activities as in the above text:
yes I remember it all falling to bits like always that damned tower with its drafts and there was Buck Mulligan shaving away like a bloody showman lather flying everywhere mirror clinking on the rough stone yes and then Clifton Lodge oh those children running about their poetry books always hidden never really reading eh what a laugh yes we were off to the strand buzzing a bit still from the salt air
Part of why this works so well is that of course Ulysses is in the public domain so Molly Blooms's voice is already in the training data. In certain ways, there is more high-quality text directly from Molly for LLMs to work with than for many other fictional characters. Getting her to narrate our arbitrary activities felt a bit like pulling a ghost out of the aether. In fact, I knew I was making good progress in my prompt engineering when she started complaining about collecting so many things all day! That's the kind of meta behaviour that occasionally freaked out early AI researchers.
It also helps that Molly's mind is wandering and she's free-associating, which is quite similar to how LLMs actually work deep down: going from token to token by statistical probability, salted with some randomness. If the LLM hallucinates, that's entirely fine, since she's sometimes hallucinating too.
There's been a lot of talk about AI over the last few years, and a lot of companies have spent a great deal of time and money trying to put AI into nearly everything, regardless of if it's actually useful or even wanted. One thing Large Language Models seem to be really good at is summarizing or describing data with extra personality. For example, Yahoo is using GPT to trash talk fantasy football teams at scale - up to 2000 taunts per minute. This "Personal Penelope" experience is the same idea. It doesn't need to be accurate, it doesn't need to make expert decisions–but it is able to take the things that you did today and narrate them in a distinctive voice. This would have been essentially impossible to do in real-time before modern LLMs became available.
My early experiments with the "Personal Penelope" system had gone so well that I decided to share them with the Volta Generative AI Showcase, which I've been attending since they started last year. I'd seen so many interesting demos and presentations there that I was excited to show my own work. Due to unfortunate scheduling, I ended up having a tooth removed earlier on the same day as my presentation, and I wasn't sure whether I'd be in too much pain, or too drugged up (or both) to be able to present. So I pre-recorded the talk and put it on YouTube so they could play it in case I was incapacitated. I turned out to be fine and the presentation went well, but the backup recording makes a good introduction to this AI system, and the Bloomsday project as a whole.
For the final background, I didn't end up doing any kind of mash-up, but instead used a historically appropriate picture of a bedroom, to give some proper visual context. I guess I could have added a USB charging hub or something on the bedside, but I was too busy getting everything else working.