Before long, computers will be writing jokes as funny as those created by professional comedy writers.
I’m no expert in computational humor, but I am the author of “Comedy Writing for Late-Night TV.” It’s possibly the most practical guide to writing jokes and other short-form comedy ever written.
I’ve also been reading up on the rapid advances in artificial intelligence (AI).
Take a look at these AI milestones:
1997: IBM’s Deep Blue computer system beats a human world champion in a chess match.
2011: IBM’s Watson computer system beats human champions in Jeopardy.
2016: Google’s AlphaGo computer program beats a top-ranked human in Go.
Each of those milestones was previously considered unattainable by a computer. Each of them was considered to be a true test of a computer’s ability to think like a human. And a computer raced past each one of them.
The ability to write a good joke will be the next barrier for AI that a computer leaps over. That’s because writing a joke involves executing the kind of algorithms that computers can apparently already execute.
Here’s how I believe a computer system like IBM’s Watson will soon be able to write a joke. (What I know about Watson I get from The AI Behind Watson: The Technical Article.)
Say you’re a senior citizen sitting at home with no one but your personal robot for companionship. You’re reading the news and you say, “Huh. Some airline employee was arrested with over two hundred eighty two thousand dollars in his backpack.”
In a flash, the computer brain in your robot companion takes these steps:
STEP 1: The computer identifies the most unusual keywords and sentence fragments in the potential joke topic you uttered. Those are the linguistic elements–I call them handles–that made the topic interesting enough for you to comment on.
This process of parsing the joke topic into handles seems similar to what IBM’s Watson did every time it “decomposed” a Jeopardy question into “subclues.”
In our hypothetical joke topic, the two handles are “airline employee” and “two hundred eighty two thousand dollars.”
STEP 2: For each of those two handles, the computer generates a list of what I call associations. An association is a word or phrase that’s somehow related to the handle.
One association of “airline employee” is “airport restaurant,” which has the sub-association “costs a lot of money.”
And one association of “two hundred eighty two thousand dollars” is “a lot of money.”
This process of generating associations seems similar to what IBM’s Watson did when it found phrases that were statistically related to keywords by using its “hypothesis generation” algorithms.
STEP 3: The computer makes a connection between the two associations “costs a lot of money” and “a lot of money” and it decides to build a punch line around that strong connection.
This process seems similar to what IBM’s Watson did when it evaluated candidate Jeopardy answers by using its “evidence retrieval” algorithms.
Here’s a diagram of Watson’s question-answering (QA) architecture:
STEP 4: The computer uses its automated reasoning skills to devise what I call an angle leading from the joke topic to the punch line. The computer might reason this way: The airline employee has a lot of money, so he can dine at an airport restaurant, which costs a lot of money.
STEP 5: The computer uses its natural language generation (NLG) skills to transform the topic-angle-punch line data of the candidate joke into conversational English.
Some NLG systems are currently used to transform numerical data into sentences in English. And other computer programs known as chatbots now use NLG systems to simulate human conversation.
STEP 6: The computer decides that the resulting candidate joke is probably surprising enough to be funny. It does this by searching through its store of human knowledge and finding that a meal at an airport restaurant is extremely unlikely to cost two hundred eighty two thousand dollars.
This process seems similar to what IBM’s Watson did when it performed “confidence estimation” and “ranking” on a candidate answer.
STEP 7: The computer directs your robot companion to tell you the joke.
Sure, those are a lot of steps for a computer to execute. But remember, IBM’s Watson beat human champions in Jeopardy. That strongly suggests that a computer could do all of the above really fast, as fast as a professional comedian.
And it may be even easier for a computer to get a laugh than to win dollars in Jeopardy. That’s because there’s only one way to win a Jeopardy question: figure out the one correct answer and buzz in first.
But there are several ways to get a laugh from any given joke topic. A fertile joke topic–one with a lot of associations–may spawn three or more different jokes. And those jokes don’t have to be of professional quality to get a laugh; they just have to be reasonably funny.
So when you comment to your robot companion, “Look at this. Some airline employee was arrested with over two hundred eighty two thousand dollars in his backpack,” the robot might wisecrack:
“He probably needed the money to buy lunch at the airport.”
And you, the senior citizen, might chuckle and feel a little less lonely.
High-quality computational humor is the next Holy Grail for AI. That’s because a computer with a sense of humor is a more human computer. And a more human computer is worth billions of dollars.
Help maintain humanity’s lead in comedy writing! Get my book “Comedy Writing for Late-Night TV.”