• Tech
  • Innovation

Artificial Intelligence Can Now Craft Original Jokes—And That’s No Laughing Matter

11 minute read

Don’t you hate it,” says Jon the Robot, gesturing with tiny articulated arms at an expectant crowd, “when you’re trying to solve inverse kinematics equations to pick up a cup and then you get ‘Error 453, no solution found’?” The crowd laughs. “Don’t you hate that?”

An experiment billed as a comedy act, Jon is the brainchild of Naomi Fitter, an assistant professor in the School of Mechanical, Industrial and Manufacturing Engineering at Oregon State University. The tiny android performs when a handler (who must also hold the mic) presses a button, then tells the same jokes in the same order, like a grizzled veteran comic at a down-market Vegas casino.

But the robot’s act is more human than it might first appear. Jon is learning how to respond to its audience—it can now vary the timing of its delivery based on the length of the audience’s laughter, and append different responses to jokes based on the level of noise in the room. It can deliver one line if a joke gets a roar of laughter (“Please tell the booking agents how funny that joke was”) and another if there are crickets (“Sorry about that. I think I got caught in a loop. Please tell the booking agents that you like me … that you like me … that you like me”).

The prospect of an AI that understands why we are laughing, and that can generate its own genuinely funny material, is sort of a holy grail for a subset of AI researchers. Artificial intelligence can diagnose tumors, read maps and play games, often faster and with more accuracy than humans can.

For the moment, however, linguistic humor is still primarily a people thing. Jon can work blue, with a whole bit on robot dating that involves cryptic texts, encrypted text, and the eggplant emoji—but only because a human has written and programmed a set list for it. Finding a way to teach machines to be funny on their own would be a major breakthrough—one that could fundamentally reshape the way we relate to the devices around us. To understand a person’s humor is to know what they like, how they think and how they see the world. An AI that understands all that has the power to do a lot more than just crack jokes.

The first step is to attempt to break down the nuts and bolts of human humor. Machines learn by taking vast amounts of data and feeding it through algorithms—in other words, formulas or detailed sets of instructions—in search of patterns or unique features. This process works when it comes to, say, identifying the difference between photos of dogs and photos of cars, but it can effectively destroy a joke, deconstructing it in a painfully unfunny operation. “Explanations are to jokes what autopsies are to bodies: if the subject isn’t already dead, it soon will be,” wrote University College Dublin associate professor Tony Veale in his recent book Your Wit Is My Command: Building AIs With a Sense of Humor.

Humans have vast mental libraries of cultural references and linguistic nuances to draw upon when hearing or telling a joke. AI has access only to the information that humans choose to give it, which means that if we want an AI to make us laugh, we have to be clear about the kind of humor we want to teach it.


More from TIME


Read more: An Artificial Intelligence Helped Write This Play. It May Contain Racism

One theory of humor is that the degree to which we find something funny matches the degree to which a joke’s punch line deviates from the listener’s unconscious expectation. Thomas Winters, a doctoral student in artificial intelligence at Katholieke Universiteit Leuven in Belgium, uses this one as a case study: Two fish are in a tank. Says one to the other: “You man the guns, I’ll drive.”

“In the beginning, you see this aquarium, this water tank. But then you hear ‘You man the guns, I’ll drive,’ and you’re like, Well, aquariums generally don’t have weaponry or wheels or drivability,” Winters says, in a heroic effort to parse the mechanics of a fish joke. “This mental jump from one interpretation to another one is something that most jokes or things we find funny have.”

Jon the Robot and Naomi Fitter perform onstage at the Majestic Theater in Corvallis, Ore., in October 2019Courtesy Naomi Fitter

Following a formula is something AI is exceptionally good at. So are a lot of successful comedy writers.

Joe Toplyn broke into comedy in the 1980s, when a friend from the Harvard Lampoon tipped him off that a writing job was opening up at David Letterman’s late-night show. He sent in some jokes—a bit about a periscope–enabled refrigerator made it onto the air—and landed the job. He spent the better part of the next two decades writing for comedy and talk shows, racking up four Emmy awards and head-writer credits at both The Late Show With David Letterman and The Tonight Show With Jay Leno.

In 2014 Toplyn published Comedy Writing for Late-Night TV: How to Write Monologue Jokes, Desk Pieces, Sketches, Parodies, Audience Pieces, Remotes, and Other Short-Form Comedy. The book is a distillation of a course he taught in New York City after scrutinizing decades of monologues and reverse engineering the most successful jokes.

Toplyn isn’t precious about comedy writing: it’s a job, one that a person can learn to do well if given the right inputs. The jokes that got the biggest laughs for Leno and Letterman follow identifiable formulas populated with “handles”—people, places, things and other references—each with a variety of related associations that can be combined to form a punch line. Given enough time and data, he realized, a computer could potentially learn to make these jokes too.

Earlier this year, at the International Conference on Computational Creativity, Toplyn presented a research paper outlining Witscript, a joke–generation system trained on a data set of TV–monologue jokes that detects keywords in entered text and creates a relevant punch line. Unlike other forms of robot comedy, the system—which Toplyn has patented—can generate contextually relevant jokes on the spot in response to a user’s text. A chatbot or voice assistant enabled with the software can respond with humor to users’ queries (when appropriate) without derailing the interaction.

Toplyn sees Witscript as an extension of the work he did for decades in late-night TV: making people laugh, and therefore making them feel less alone.

“That’s basically the goal,” Toplyn says. “It’s to make chatbots more humanlike, so people will be less lonely.”

Very few professionals love the idea that a computer can reliably do their jobs. Comedy writers are no different. When Winters posted a joke—writing software prototype to a Reddit forum for stand-up comics, he got some colorfully worded responses insisting that no machine could replicate the nuance of human comedy.

Toplyn counters that critics overlook how much communication follows simple formulas, even the funny kind. “Rodney Dangerfield: ‘I get no respect.’ That’s a formula. Or Jeff Foxworthy: ‘You may be a redneck if.’ There are plenty of formulas in comedy, and some of them are right on the surface,” Toplyn says.

There are, obviously, people who do not laugh at the comedy of Jeff Foxworthy, or the light topical banter of a late-night talk show. A separate camp argues that the better use of artificial intelligence in comedy and the arts is as sort of an infinite idea generator freed from the blinders and biases of human thinking, one that can toss up endless themes and potential associations that human writers and performers can run with themselves.

Read more: Artificial Intelligence Has a Problem With Gender and Racial Bias. Here’s How to Solve It

Piotr Mirowski was working as a search engineer at Bing when he noticed the similarities between his day job and his personal passion, improv. The principle of search engineering is to teach the computer how to identify the best result for a given query. In improv, Mirowski says, performers are also trained to follow their instincts and do what feels best in that scene. It’s not always perfect, and the results sometimes have a hilarious absurdity, as anyone who has started typing a Google query with the predictive search feature on knows. Mirowski co-founded Improbotics, an international improv troupe that works alongside an AI that tosses out prompts and lines that human performers have to work into the show.

“I don’t think it’s really possible to build a true AI-based comedy that relies on understanding the emotions of another person or the context,” he says. “What we can do is to bring that into life ourselves.”


Improv comedians often draw upon cues shouted out from the audience. An AI can draw upon ideas from all over the world and across history. The goal isn’t to build a thing that will make the laughs for us, Mirowski says, but instead one that can help humans find new things to laugh about. As with any new technology, its power will come from the way users choose to interact with it, with results that no one may yet have imagined.

“I see what we’re doing as kind of like building the electric guitar. It’s not very clear how to play it or what it’s going to do, and it sounds really weird and distorted and there are enough acoustic guitars anyway,” says Kory Mathewson, Improbotics co-founder and cast member and a Montreal-based research scientist with DeepMind. “Then Jimi Hendrix gets an electric guitar, and it’s like, ‘Oh. That’s what this is about.’”

On the flip side, of course, a tool with the power to influence and entertain can also be used to exploit. Understanding someone’s sense of humor is a window into how they see the world, what their preferences are, maybe even where they are vulnerable. It’s not a power that people are entirely comfortable with computers having.

In one 2019 study, researchers recruited pairs of people who already knew each other as friends, romantic partners or family members. They gave participants a list of jokes and asked them to choose which ones their friend or partner would find funny, based on a limited sample of the person’s responses to other jokes. They had computers guess the same thing, based on the same data, then showed the list to the buddy so that they could verify which gags they liked. The machines predicted people’s favorite jokes more accurately than their friends or partners did.

The computers performed better than humans at guessing which jokes a participant would like in a second experiment as well. But in this one, people liked the recommended jokes less if they thought they came from a machine. They didn’t trust them. Other studies have also found that people rate humor as one of the tasks they trust humans with far more than AI, along with writing news articles, composing songs and driving trucks (all of which AI has some success in doing). Jokes are about a shared view of the world, a willingness to violate the same norms and laugh at the same things. We know what it means when a friend sends something along and says, “I thought you’d find this funny.” What’s a robot getting at when it does the same thing? And who ultimately benefits if its humor wins us over?

There’s a common saying that robots should do the jobs that are too dirty, dangerous or dull for humans. Comedy can be all of those things, but we still want it for ourselves.

As for Jon the Robot, its live appearances have so far been limited to a series of pre-pandemic shows. The act is not at the point where it might threaten the livelihood of Netflix-special-level comedians—yet. Before powering down, Jon always signs off with the same line: “If you like me, please book me and help me take your jobs.”

More Must-Reads from TIME

Contact us at letters@time.com