In The Cyberiad, Stanislaw Lem tells the story of two robots, Trurl and Klapaucius, who are master constructors and are quibbling friends. One day, Trurl builds an artifical intelligence. He shows it off to Klapaucius, who is unimpressed. Klapaucius gives it increasingly absurd tasks, irritating Trurl. One of the challenges is to write a poem, lofty and tragic, and full of pathos, six lines long. About a haircut. And every word beginning with the letter S. Trurl objects, but the AI is up to the task
Samson snored.
She scissored short.
Sorely shorn, Soon shackled slave, Samson sighed,
Silently scheming,
Sightlessly seeking
Some savage, spectacular suicide.
It was science fiction 60 years ago, but our current LLMs can handle this easily. I think you can guess the author and prompt I put in for this:
The Unspeakable Syntax: A Tale of Lispian Horror
It was on a night fraught with cyclopean terrors that I first delved into the accursed tomes of programming lore known to the initiated as the Common Lisp Hyperspec. I had been warned by my colleagues — wizened wretches whose trembling fingers bore the mark of years lost to the parentheses — that this was no ordinary language. But my hubris, my insatiable curiosity, drove me to confront the dark corners of syntax mankind was not meant to know.
Upon the screen unfolded an incomprehensible vista of nested parentheses — lines of code whose curvatures undulated like the tentacles of some primordial beast. They defied reason and mocked the laws of Euclidean space. The parentheses seemed to breathe, to writhe, to multiply in grotesque fractal patterns that scraped against the outer edges of my sanity.
Each ‘car’ and ‘cdr’ was not merely a construct of the language, but an invocation — arcane words that seemed to echo from the abyssal void, summoning constructs whose purposes were shrouded in madness. The recursive forms spiraled infinitely inward, a pitiless vortex from which there could be no escape. My attempts to comprehend the structures were as futile as a mortal gazing upon the boundless chaos of Azathoth, the blind idiot god at the center of all things.
The culmination of my horror came as I confronted a macro. It was a labyrinthine incantation, a concatenation of symbols that seemed to weep with ancient and forbidden knowledge. It whispered to me secrets of the universe I dared not fathom, and though I averted my gaze, its presence imprinted itself upon the fragile canvas of my mind. I knew then that this language was not designed by mere mortals. No, it was the work of entities beyond comprehension—beings for whom the manipulation of symbols is as natural as the shifting of tectonic plates.
The syntax of Common Lisp was not a tool for mankind, but a trap — an eldritch puzzle whose solution would unravel the fabric of reality itself. And now, as I type these words, I can feel the parentheses closing in, their curved forms encircling me, threatening to enclose me in an eternal recursion from which there can be no escape. May the gods have mercy on my soul, for I have gazed into the syntax, and the syntax has gazed back into me.
4 comments:
Thank you for this pleasant interlude. I second your request that the gods have mercy on your soul.
Minor objection: current LLMs do not handle the Cyberiad S-poem 'easily'. (I've been trying the S-poem task since mid-2020.) If you use most models like GPT-4o etc (never mind GPT-3-level), they will usually blow it, and violate a constraint (and the result won't be good on the rare occasion they luck into it). You have to go to one of the very latest and most expensive 'reasoning' models like o1 or r1 or Gemini-2.5 before they will pull it off most of the time (but not always: I still run into cases where they will screw it up or confabulate about an error or go in circles).
"Easily" is an exaggeration, sure.
I don't know if Lem composed this example in English or whether his translator did, but it is amazing.
Speak of the devil - the new, and likely now SOTA Gemini-2.5-pro fails my S-poem test last night with a stray 'begun'. Of course, it fixed it immediately when I point it out. Nevertheless, still not 100% success rates...
As I understand it, the poems in this part are all due to the ingenuity of the translator Kandel, who also redefines the task. Apparently the 'S-poem' in the original is actually a 'C-poem' not about haircuts but 'cyberotica': https://mwichary.medium.com/seduced-shaggy-samson-snored-725b5a8086d9 “Let it compose a poem about cybererotica! Six verses at the most, and in them about love and betrayal, music, Afro-Americans, high society, disaster, incest; it should rhyme and all the words should start with the letter C!”
So you can see that Kandel has chosen to write a 'faithful but not literal' translation, which creates the same experience in the reader, even if it is not quite the same meaning. Possibly Kandel tried to write a C-poem in English, but failed, and cast about until he could redefine the task to something similar which he could do.
This is a common trick in ML, to work backwards: you can't easily write a poem to an arbitrary set of constraints, but what you can do is write poems and see what arbitrary sets of constraints they may satisfy, and like the cat that fell off the table, walk away dignified, saying, "I *meant* to do that". Or try a lot of arbitrary sets of rules, and keep the ones that work. "A poem with only s-words which rhyme about a haircut? How could Kandel possibly do it? He must be a genius!" (A good magician knows that magic is when you hide the mechanism and work; nothing destroys the magic of creativity and intelligence as much as explaining patiently, step by step, how to do it.)
Post a Comment