Stanislaw Lem, Poetry & AI in 2022

One of my favorite books is a whimsical collection of stories by Stanislaw Lem called “The Cyberiad: Fables for the Cybernetic Age”.

One of the stories, called “Trurl’s Electronic Bard” concerns a computer that is created to write poetry. It is given more and more difficult prompts until finally it is given a seemingly impossible task, that it completes with ease.

In building the Electronic Bard, Trurl (one of two inventors who try to out-do each other in the stories) realizes it will be quite a task to create a machine poet.

First Trurl collected eight hundred and twenty tons of books on cybernetics and twelve thousand tons of the finest poetry, then sat down to read it all. Whenever he felt he just couldn’t take another chart or equation, he would switch over to verse, and vice versa. After a while it became clear to him that the construction of the machine itself was child’s play in comparison with the writing of the program. The program found in the head of an average poet, after all, was written by the poet’s civilization, and that civilization was in turn programmed by the civilization that preceded it, and so on to the very Dawn of Time, when those bits of information that concerned the poet-to-be were still swirling about in the primordial chaos of the cosmic deep. Hence in order to program a poetry machine, one would first have to repeat the entire Universe from the beginning or at least a good piece of it.

Kind of the “to create an apple pie from scratch, first one has to create the universe” quote from Carl Sagan. Now, in the story, Trurl basically does just that, building a model of the universe, then planets, then evolving digital life until he gets a poet, which he then has to tweak so it’s not too morose.

But in actuality, this is not *too* far from how AI researchers ended up creating the latest and greatest AIs – basically, it started as an autocomplete algorithm that would try to predict the next word in a sentence. This algorithm was improved until it got to the point where it could autocomplete a whole article from a short description.

The source material? Basically, as much of the internet as researchers could reasonably cram into the neural net processor. To process essentially all of human civilization, the computer takes apart each section and looks at how they connect together, and stores that connection information in a growing web or “neural network” – a functional distillation of the information. The original information isn’t in there per se, but how it was connected together is.

Boiling all of civilization down into a relatively small file is incredibly computationally complex, and would take you hundreds or even thousands of years. Fortunately, the companies building these models have access to a lot of computers, so running on a large array of powerful computers, these massive datasets can be boiled down in six months or a year.

So, now that we have essentially replicated Trurl’s Electronic Bard, let’s put it to the test. I’ll be using OpenAI’s GPT3 engine, running their DaVinci model. I’ll feed it the same prompts as Trurl, and see how our AI results stack up to the fictional AI from 1965 (or more accurately, the masterful English translation by Michael Kandel in 1974, the year I was born).

Trurl’s friend/competitor Klapaucius presents the increasingly difficult challenges to try to stump the electronic bard. Only two are presented in their entirety in the story, so we will use those two to test current AI vs. fictional AI.

The First Challenge

“Have it compose a poem—a poem about a haircut! But lofty, noble, tragic, timeless, full of love, treachery, retribution, quiet heroism in the face of certain doom! Six lines, cleverly rhymed, and every word beginning with the letter s!!”

Here are the resulting poems, first Trurl’s Electronic Bard:

Seduced, shaggy Samson snored.
She scissored short. Sorely shorn,
Soon shackled slave, Samson sighed,
Silently scheming,
Sightlessly seeking
Some savage, spectacular suicide.

And here is OpenAI’s GPT3 DaVinci model:

Somber strands of sorrowful strands
Shed by the scissor’s solemn slice;
Sharp sorrow soon shall sever these
Scintillating, shiny sighs.
Still some solace found in shearing
Sacredly shaved sacrifice.

GPT3 comes close – but didn’t quite manage to only use words starting with S, and Lem uses mythic references that make it the winner.

The Second Challenge

“Very well. Let’s have a love poem, lyrical, pastoral, and expressed in the language of pure mathematics. Tensor algebra mainly, with a little topology and higher calculus, if need be. But with feeling, you understand, and in the cybernetic spirit.”

Trurl’s Electronic Bard:

Come, let us hasten to a higher plane,
Where dyads tread the fairy fields of Venn,
Their indices bedecked from one to n,
Commingled in an endless Markov chain!

Come, every frustum longs to be a cone,
And every vector dreams of matrices.
Hark to the gentle gradient of the breeze:
It whispers of a more ergodic zone.

In Riemann, Hilbert or in Banach space
Let superscripts and subscripts go their ways.
Our asymptotes no longer out of phase,
We shall encounter, counting, face to face.

I’ll grant thee random access to my heart,
Thou’lt tell me all the constants of thy love;
And so we two shall all love’s lemmas prove,
And in our bound partition never part.

For what did Cauchy know, or Christoffel,
Or Fourier, or any Boole or Euler,
Wielding their compasses, their pens and rulers,
Of thy supernal sinusoidal spell?

Cancel me not—for what then shall remain?
Abscissas, some mantissas, modules, modes,
A root or two, a torus and a node:
The inverse of my verse, a null domain.

Ellipse of bliss, converge, O lips divine!
The product of our scalars is defined!
Cyberiad draws nigh, and the skew mind
Cuts capers like a happy haversine.

I see the eigenvalue in thine eye,
I hear the tender tensor in thy sigh.
Bernoulli would have been content to die,
Had he but known such a2 cos 2 ø!

OpenAI GPT3 DaVinci:

For my love, my only true one,
I need no other, the love of my life.
My heart is a vector of love,
It points to you forever,
A scalar of magnitude that can never be done.

The dimensions of our love cannot be measured,
The polytopes of our universe, infinite and treasured.
An algebra of love such as this
Cannot be expressed in any other way
Than by the language of mathematics.

The manifolds of our relationship
Express the functions of our love
The topology of our togetherness
Larger than infinity, and ever more above.

The cybernetic spirit of our love
Will never cease to be,
For it is a love that transcends
The boundaries of time and space,
An eternal and boundless love,
We will never be apart,
For our love is a calculus of infinity,
In the language of mathematics.

What do you think? Lem and Kandel have the edge for cleverness, and are the clear winner, but the actual AI was able to construct a reasonable result.

It should also be noted that I was using OpenAI’s website for this, so the generation was not free. They charge per block, essentially by the word. These two poems (plus an accidental third where I mistyped the prompt) cost $0.0075 – almost a penny.

Analog Man in the Digital Age

Analog Man in the Digital Age
-or-
The Engineer’s Dilemma

Being a Somewhat Rambling Musing on the Information Age


We live in an interesting time. We have come out of the Industrial Age and into the Information Age. More and more the world is connected digitally, but paradoxically, people feel more lost than ever.

Partly, this is caused by a disconnect between the analog and digital world, and a loss of tangibility and analog character.

Let’s take the example of a letter. In the old days (not so long ago) a letter would be written by hand, pen to paper. Then came the typewriter, and here is where the engineer’s dilemma comes in to play. The typewriter, when it comes to the task of conveying text, is vastly superior to handwriting. It is far more legible and consistent than handwriting. From an engineer’s perspective, it is a better solution to the problem of how to record text. It’s pretty black and white, there are a number of advantages to type over handwriting, from an engineering perspective.

But there is a sterility, a loss of analog character, that takes place when transitioning from handwriting to type. The essence of the message is intact, but the flavor of it, the subtle changes in handwriting, the ability for non-linear writing, the insertion of non-textual doodles, the feel of the line quality from pen or quill as ink grows lower, all that is lost.

Take that to the next stage, and the typewritten letter becomes an email. In that transition, the look is more or less the same, black type on a white surface. From an engineering perspective, the gains are substantial. By making the information digital, it can be transmitted nearly instantaneously anywhere in the world, copied to other locations for redundant backups, and indexed and searched easily. But here, there is also a loss of analog character. The transition from paper to screen has come at a cost of tangibility.

This is more substantial than it might seem, because we are analog animals, and all of our senses are important to us. For example, a letter might have a scent, applied either accidentally or intentionally by the sender, which not only relays sensation to the recipient, but also helps form stronger memories. In an email the physical form is gone, which to means not only a loss of tactile sensation (the thickness of the paper, the flipping from page to page) but also a loss of potential context.

Emails are usually always read in the same place: while sitting at one’s computer. A letter is received at the same place, the mailbox, but might be opened and read in any number of places. This loss of context removes potential context that could form more meaningful memories, such as reading a letter from your lover while sitting at a kitchen table, the sunlight glinting in and the smell of fresh-baked muffins in the air, or reading the same letter while on a noisy crowded subway on the way to work. Memories are more solidly formed when they are associated with all senses at once, and can be triggered in the future by stimulus to any of those senses. In the subway example, years later you might be on a train, and the swaying motion might suddenly bring back the memory of reading that letter, and bring a wistful smile to your face. By homogenizing the letter-reading experience, each email is much less likely to have unique environmental context, or indeed much content beyond purely visual.

Digital content is generally higher-quality than analog content at this point (from the view of production value and perceived “professional” quality), it is slicker and better produced. In a few clicks, a person can create a pleasing slide show of high-quality images. But it is the analog character, the “fiddly bits” that makes people yearn for an old photo album, with photos stuck in slightly crooked, and handwritten notes on the backs. “Scapbooking” is a hyper-extension of this analog character, and the abundance of textures and visuals, the crunchy analog feel, has made this hobby incredibly popular.

So this is the engineer’s dilemma: how to preserve the analog feel in a digital world?

Arthur C. Clarke once famously said “sufficiently advanced technology is indistinguishable from magic” – and this is one place that engineers can look. Engineers are technology-minded, so will most often look forward for solutions.

An example of this is the digital picture frame. It takes the intangible digital photos on your computer and places them in a tangible item. Displayed on the digital frame, the picture can be used in an analog way, it can be picked up, brought closer for examination, and carried around. As technology improves, it could become more and more analog, to the point where the frame could be the size of a polaroid, and a special pen could be used to write on the photo and on the back of the photo, and calling up a particular image would call up the handwritten notes as well. It will essentially become a magic polaroid, almost exactly like the analog ones, but able to be changed at will, perhaps responding to spoken command or even your mood.

Another example is the Nabaztag, which acts as an analog bridge from your computer – it is a rabbit-shaped gadget that can flash different colors or wiggle its ears to indicate things like incoming emails, or the weather forecast. Silly and frivolous, yes, but by branching a tendril into the analog world, it allows the computer to interact with people more on their own plane, and in so doing, become potentially more relate-able, more lovable.

The loss of analog character and tangibility makes it harder to make an emotional connection to digital content than similar analog content. Although a child can form a connection to an animated teddy bear on a computer screen, that connection comes much easier if it is an analog teddy bear that they can touch. In the movie A.I., one character is a robotic teddy bear, designed to play with children. He bridges the digital/analog gap, like Nabaztag. He is a tangible conduit to digital data, a computer in the shape of a teddy bear, able to interact by engaging multiple senses.

DRM issues aside, one objection people have to digital books is the experience. The screen is capable of displaying text very similar to printed text, but the tactile experience is a flat, cold device, with buttons and menus and plugs and wires. But it is not inconceivable that in the not-too-distant future, you could pick up a book and say “I would like to read Homer’s Odyssey” and the cover would change to Homer’s Odyssey, and all the pages would magically fill with the text. Perhaps a bookmark would even unfurl, showing where you left off last time.

But that is the not-too-distant future. One thing that can be done relatively easily, and right now, is personalization. Allowing data to be displayed in the manner a user wants allows a digital experience to have a more analog feel, without electronic rabbits or nanotechnology. This is clearly evident in cellphones, where users can change the ring sound, background, menu, and other things to make the device more unique. This customization imbues the device with some analog character. Recently Google added an option to customize the look of your Gmail account, which gives the interface a more analog feel.


It’s a situation that arises again and again, as newer technologies try to supplant older ones.

Current computer operating systems represent the ongoing struggle to provide analog metaphors for digital content. “File Folders”, icons that look like pages, tabbed and windowed documents… all symbolic representations to give things a more analog feel.

It’s an interesting problem, from an engineering perspective. And not just in an academic sense. This problem, in fact, is what I currently do for a living, as I try to convert print catalog production systems from sheafs of paper and handwritten notes in a folder into a database with a (hopefully) user-friendly front-end.

It’s very difficult to supplant an analog system with a digital one, even if the digital system will speed production and reduce costs. Even though the system being used is now the web-based application that I am working on, some users still pass around folders with catalog section names written on them, even though the folders are now empty, and only symbolic. They persist because we are analog creatures, and tactile, physical things are more meaningful to us then digital representations on a screen.

It’s my dilemma.

Books

I just finished “Childhood’s End” by Arthur C. Clarke.

Very good, thought-provoking… but with a very depressing ending. It’s supposed to be a happy ending, in a way, but at the same time it left me with a profound feeling of loss.

Now I’m reading “The Boy Who Knew What the Birds Said” which is a book of fairy tales in the classical vein, with that dreamlike sense of wonder. It starts out:

There is one thing that all the Birds are afraid of, and that is the
thing that will happen when the Bird That Follows the Cuckoo flies
into the Cuckoo’s mouth.

And what will happen then, asks my kind foster-child.

When the Bird that Follows the Cuckoo flies into the Cuckoo’s mouth
the World will come to an end.

All the Birds know that, but not all the People know it.

Since it was written in 1918, it’s Public Domain.
You can read it here for free, if you want.

Delicious!

A new version of Delicious Library is out!

If you haven’t heard of it before, it’s a program from the Mac for organizing your books, dvds, and such.

The new version adds more categories, including gadgets, toys, and tools.

Another thing they added is an option to export to a webpage. It’s not the best export, it’s a little buggy and has some design issues, but it’s decent enough.

You can check out my library here!

Might logic prevail?

Finally, some intelligent discussion of video games and their impact on children (even though the book has a rather sensationalist title).

“Video game popularity and real-world youth violence have been moving in opposite directions. Violent juvenile crime in the United States reached a peak in 1993 and has been declining ever since. School violence has also gone down. Between 1994 and 2001, arrests for murder, forcible rape, robbery and aggravated assaults fell 44 percent, resulting in the lowest juvenile arrest rate for violent crimes since 1983.”

Part of a 3-part openeducation.net writeup on the upcoming book “Grand Theft Childhood: The Surprising Truth About Violent Video Games”

Part 1
Part 2
Part 3

The dwindling light of a golden age

All my favorite authors are, one by one, shuffling off this mortal coil.

Shel Silverstein, Roald Dahl, Dr. Suess, Issac Asimov, Douglas Adams, Kurt Vonnegut… the list goes on and on…

and now, Arthur C. Clarke.

“I want to be remembered most as a writer.

If I have given you delight,
by aught that I have done,
let me lie quiet in that night,
which shall be yours anon:

And for the little, little, span
The dead are born in mind,
Seek not to question other than
The books I leave behind.”

-Arthur C. Clarke’s farewell message, recorded last year.

A great enlightened man, not just writing about the future, but helping to create it.

Ray Bradbury’s still alive, at 87… Ursula K Leguin is still knocking about at 78… but most of the other authors I grew up with seem to be dropping like flies of late.

On the plus side, the simple fact that they are authors means that a chunk of their wit and imagination will last forever, trapped in the amber of books.

Great Satirists

Some great satirists I’ve been reading lately, who seem to share some mental kinship – perhaps only the kinship of shared genre, but it feels like something more:

Voltaire
Mark Twain
Kurt Vonnegut
Hunter S. Thompson
Tom Robbins

They all possess a great love of language, a dualistic dark but somehow optimistic view of humanity, disgust at bureaucracy and organized religion…

Seems like they are the kind of people that it would be great to go out for a drink with, to sit at a table in a dingy bar, toasting doomsday and discussing humanity.

Indiana Jones

So Dr. Jones is back for one more round, they just announced the title of the new movie, “Indiana Jones and the Kingdom of the Crystal Skull“. Doesn’t exactly roll of the tongue, but I’ll give them the benefit of the doubt.

Also, I read “Holes” tonight. Good little tale, a quick and enjoyable read.

Marketing Classic Books

So I had an idea that I thought I’d sketch out last night…

What if overzealous marketers wanted to promote classic books, but had never read them, and didn’t want to take the time to?

So here are some cover designs and taglines, based only on the book title.
They’re really rough, but convey the basic idea…

You can also see higher-res versions on Flickr.


“They were separated by age, but brought together by love. The tale of the forbidden passion that shocked a nation! – 19 / 84 – George Orwell”

“The life of a porn star is a hard one. – Moby Dick – A ribald romp by Herman Melville”


“Their mission: colonize Mercury. But they were not alone… – Fahrenheit 451 – Ray Bradbury”

“The FBI’s top agent has only 3 days to stop 22 criminal masterminds! – Catch-22 – Joseph Heller”


“Revenge is a drink best served with poison. – The Grapes of Wrath – John Steinbeck”

“When you want to get away from… your life. – Uncle Tom’s Cabin – Harriet Beecher Stowe, the master of horror”


“He can see you, but you can’t see him. – The Catcher in the Rye – J.D. Salinger”

The Jungle – A handy guide to visiting the Amazon. With full-color photos! – Upton Sinclair”


“An Oprah Book Club Selection! – Oliver Twist – He’ll dance his way to the top, and into your heart. – Charles Dickens”

The Time Machine – An illustrated history of the wristwatch. – H.G. Wells”

“All he ever wanted was to play football. – The Hunchback of Notre Dame – Victor Hugo”