Humorous AI is a riddle worth solving
Learn why Tony Veale -- author of the book 'Your Wit is my Command' -- believes comedic machines could change the world for the better.
AI-based technology can be found in many areas of business and life.
Language models help sort through the ever-growing glacier of information on the internet. Chatbots help answer customer service phone calls. Predictive algorithms provide suggestions on business decisions, driving directions and places to eat. Voice assistants field queries for information.
Still, many of the common functions of AI boil down to what some may describe as stochastic parroting.
Author and AI researcher Tony Veale said despite this wide-ranging, ever-expanding spectrum of use cases, one thing AI isn't very adept at is humor. Sure, a machine can tell a joke when prompted and issue a "laugh" if programmed. But when was the last time you actually laughed with Alexa or another "smart" device in earnest? Have you ever laughed with Alexa?
In this Q&A, Veale explains why nailing down a computational theory of humor is so tricky, and why a machine that both tells jokes and understands them could have incredibly positive ripple effects beyond just chuckle automation.
Editor's note: This Q&A has been edited for conciseness and clarity.
Why is it important to study computational humor?
Tony Veale: Humor is the social lubricant for dealing with mistakes, dealing with surprises and dealing with frustrations and minor incongruities. A machine that can handle those things with aplomb is very desirable from an everyday point of view -- even if it's not telling you jokes.
You're really studying how the mind works, how language works, how surprise works, how prediction and prediction failure work. It's understanding why jokes work. If you build a model of thoughts -- and the model is good -- then that gives credence to your view of how humans are doing [what they're doing]. You're trying to understand how humans do things.
One of the functions of computational humor is to make the machines more robust and handle the unexpected. To take something that's very topical at the moment, the concept of gender. Traditionally, machines ask what your gender is, and they give you two radio buttons for male and female. Now people have adapted their interfaces to give more choices or say, 'I would rather not answer.'
That's because people found those two radio buttons quite limiting. But you'll notice that the machine was designed so that you couldn't put in a different option -- you had these two radio buttons. If you had a free text field, people might put in something that the machine didn't expect.
So, the interface has engineered out the potential for surprise. Now, if we put the potential for surprise back here, by having free text fields, the machine has to be able to reason about what you say. And then we need to make them more robust in the face of potential surprise.
Is there one universal theory of humor that could be programmed into a machine?
Veale: There are some reusable ideas -- such as superiority, incongruity and relief. They're all components of the hidden theory that we don't know yet.
People have been theorizing about humor since Aristotle. Not with tremendous success, either.
I get emails from people all the time saying, 'I've come up with a new humor theory. What do you think?'
My immediate thought is, well, it's a rephrasing of one that was done hundreds of years ago, because it's hard to come up with something new. You've just used synonyms to describe someone else's inadequate theory. I'm quite happy to call the other theories inadequate because I don't really have an adequate one of my own. They're all inadequate because it really is an impossible, contentious phenomenon.
Are machines capable of humor right now?
Veale: Machines are at the level of the punning child at the moment. Most puns are kind of schoolyard puns. They don't rely on profound insights into the human condition or the world. They're formal. We call them formal jokes because they work at the level of form. Form is when the sound of the words is more important than the meaning of words. A good pun will use the meaning and the sound, but you can get away with just the sound or use the sound as a crutch.
With conceptual jokes, it's ideas that are important. The child progresses from formal jokes -- which are very superficial -- into conceptual jokes that just kind of get beneath the skin of language and get under the hood of how the world works. We don't really have an upgrade path for machines to go from punning to this deeper understanding. But if there were, machines would be better at not just telling jokes, but understanding the world more generally.
Are there any examples of AI humor that you're excited about or that are performing well?
Veale: Excitement is hard to generate in this space. I had an online meeting a few weeks ago, with a bunch of people who were doing something in the computational space with humor. We all showed our wares over Zoom. And it was not encouraging. The systems are flaky; the understanding exhibited by the machines is superficial at best. It shows that we're still lacking this insightful theory that can help us.
The theory helps us describe what we've done after we've done it, but it doesn't help us do the things that we need to do in advance. It doesn't tell us what we should be doing next; it only gives us the vocabulary for talking about what we've just done. So, it was kind of funny at a meta level.
So we're, I would say, at a really bad performance level when it comes to humor, because no one really cares about it as a topic. The companies that invest huge money into building language models don't care about humor. It's an afterthought.
There are a few people who think they've solved the problem, but really what they've done is what we call prompt engineering. You give language models some prompts and then they spiel out an output. You ask the language model to tell you a story about unicorns, and it will spool out a text about unicorns. Now, if you prompt it differently, then you get different outputs.
If you treat the language model like a black box and figure out, 'How do I ask it in such a way that what comes out the other end seems funny?' that's prompt engineering. And it's treating the language model like a black box. Kind of like something that you might have found in Roswell in 1947.
You say, 'I don't know how it works, but if I poke it here, something interesting happens.' It's an unscientific way to use these things, but they're so powerful that people are succumbing to that attractiveness. [Many modern language models] have been trained on the entirety of the internet -- or close enough. So, deep in their statistics, in their understanding of how words go together, there's a kind of a tacit understanding of the world. Clearly, they have a role to play in the future of computational humor, because they have a role to play in the future of AI. But hopefully, that future will be more interesting than prompt engineering, where you're just poking at it in interesting ways or provocative ones.
Why is it so difficult to get past the basic formalism that AI is currently limited to?
Veale: Jokes are always about the details, which makes them hard to generate computationally because with machines you want to have a general algorithm. Every joke relies on the specific details, the specific words that it contains, the specific setting. You just kind of swap in words and say, 'Well, I got this joke here. If I use a thesaurus and swap out all the words for synonyms, I'll get 10 variants of this joke.' Well, you get 10 variants that don't work. Because the jokes are really fragile creatures. And that's a reason why they're worth studying.
I meet people who write their own jokes all the time because I talk to professional comedy writers for stand-up comedians or stand-up comedians themselves. They have a very algorithmic approach to how they do things. They sit down and they work the angles. They generate 10 times more jokes than are actually forward for consideration. Then the person who considers them only takes a handful of those. The rest of it is thrown away. But they're mulch for future endeavors, I suppose.
So, [comedians] use algorithms too, which suggests that [joke writing] is an algorithmic process. But there's something very special that happens in their algorithm because they're relying on knowledge. That's really what a machine needs to up its game. Not just what it knows of the world, but how it's able to reason over what it knows about the world.
Normally, you don't write jokes for paperclips. You don't write jokes for dogs. You write jokes for humans, and they have to be about human concerns. You have to write jokes about working in an office, or the difference between bagels and doughnuts or whatever it is that people care about but will tell you is trivial.
Jokes remind us of things that we know but didn't necessarily know that we knew. They surprise us by telling us what we know. You don't really learn things in a joke, because the joke has to work by using what you already know. If you try to set up a joke by saying, 'Hey, there's this person who does this thing, and the thing does this.' The joke's already dead, right? So you tell jokes to someone, and they know everything they need to know. They just don't necessarily know that they know. Then the joke kind of dredges this to the surface, and there's this laughter of recognition.
That all comes back to understanding. Can the machine understand what it's saying? This is the number one goal, to my mind. There's no point in having a machine generate jokes if it doesn't understand the joke. If the machine isn't laughing at its own jokes, it doesn't really deserve to call them jokes. Right now, we're at the level where we might get a machine to generate a joke, but the machine doesn't appreciate the joke. Which means, to my mind, it's not a joke. If we get them understanding, then the knock-on effects for everything else in AI will be huge. The goal isn't humor for its own sake, it's that the mechanisms that are needed to generate humor are so useful everywhere else.