Using GPT-3 to Explain Jokes

Branko Blagojevic
Sep 2, 2020 · 5 min read

There’s a Reddit bot that explains jokes. Well, that’s not exactly true, because its too good to be a bot and is curiously selective. Often times, the explanation is funnier than the joke. It hasn’t been active in about a year, but here’s an example:

My wife and I went on our honeymoon to Australia. Unfortunately, I had to dial the help line."G'day this is Tim, you've reached the Aussie help line. How can we help ya?"I told him, "We were in the ocean and my wife was stung by a jellyfish on her lady parts. Her vagina is completely swollen shut. It's our honeymoon, and well....ya know."The guy on the help line replies, "Ah, bummer mate!"I say, "I hadn't thought of that! Thanks for the advice. You've saved my honeymoon!"

Explanation:

Bummer can mean unfortunate or anal intercourse.

Pretty good.

This explanation was from 3 years, and if you follow natural language processing, you’d know that NLP was no-where near this level of comprehension at that time. Even models that were fine tuned for joke explanation would have difficulty explaining a joke like this. For one, its pretty long and layered. Consider the inferences in the jokes: Australian slang for bummer as a double entendre, expectation of intercourse during a honeymoon, types of sexual intercourse available. It’s a complicated joke for a machine to parse.

But its 2020, and gpt-3 has moved the needle on what we expect from NLP.

GPT-3 as a Joke Explainer

The way GPT-3, and all language models that I’ve seen work, is that they try to predict the next group of characters. They can then recursively feed the output back into itself and predict the next groups of characters.

For instance, consider the phrase “I love”. The most likely word that comes after that based on a corpus of english text is probably “you”. So it becomes “I love you”. Then you can feed in “I love you” and the next token would likely be “I love you, too” and so on.

So to get a joke explainer bot, we have to prime the model with some joke explanations. GPT-3 is incredible that it requires very little in terms of priming to be able to continue the pattern. Here is the input text I used to prime GPT-3

Joke: Three men are on a boat. They have four cigarettes, but nothing to light them with. So they throw a cigarette overboard and the whole boat becomes a cigarette lighter.Explained: Lighter can mean a device that creates fire or less heavy.Joke: Where did Noah keep the Bees? In the Ark-Hives.Explained: Ark hives sounds like archives.

Note that there is no reason I picked these two, apart from the fact that I thought they were pretty good and short. I didn’t try any other ones but I encourage people to try other primes. As you see below, I think they serve their purpose.

Now I’m able to put in a joke and get an explanation. Here’s one that GPT-3 nailed:

Joke: If you could have dinner with any historical figure, who would you choose? "Gandhi. Why him? "More food for me."Explained: Gandhi was a famous Indian leader who was known for his hunger strikes.

The joke explained reddit bot had said “Gandhi was stereotypically perceived to engage in hunger strikes.”

Here’s another one, not as good:

Joke: I've got one thing to say to all you motherfuckers. Happy Father's dayExplained:  Motherfucker is a word that is used to insult someone.

I’m sorry, the answer we were looking for was “Fathers are stereotypically perceived to have intercourse with mothers.”

How about a blonde joke?

Joke: Blonde gets caught speeding. The cop is also a blonde.Cop: “Let me see your driver’s license.”Driver: “What’s that?”Cop: “A square thing with your picture on it.”Blonde fumbles through her purse, finds a mirror, sees herself in it, and hands it to the cop. Cop looks at it, hands it back and says, “I’m gonna let you go without a ticket. I didn’t know you were a cop.”Explained: A mirror is a square thing with your picture on it.

Or maybe a pop culture reference with a play on words?

Joke: The only two white actors in Black Panther are Martin Freeman, who played Bilbo Baggins, and Andy Serkis who played Gollum. They're the Tolkien white guys.Explained: Martin Freeman played Bilbo Baggins in the Hobbit movies. Andy Serkis played Gollum in the Lord of the Rings movies.

These are all somewhat plausible. I’m most impressed how the model actually does the correct thing in terms of trying to explain the joke. It doesn’t always get the joke or the point, but its doing something right.

And what about out Aussie joke from the start of the article? Here’s the joke again with the GPT-3 explanation:

Joke: My wife and I went on our honeymoon to Australia. Unfortunately, I had to dial the help line."G'day this is Tim, you've reached the Aussie help line. How can we help ya?"I told him, "We were in the ocean and my wife was stung by a jellyfish on her lady parts. Her vagina is completely swollen shut. It's our honeymoon, and well....ya know."The guy on the help line replies, "Ah, bummer mate!"I say, "I hadn't thought of that! Thanks for the advice. You've saved my honeymoon!"Explained:  G'day is a greeting in Australia.

This is understandable. But let’s see if we can do better.

I mentioned at the start of the post that models work by trying to predict the most likely set of characters following a particular input. But it doesn’t have to take the most likely, it can allow for some randomness. In NLP, they call this “temperature”. The higher the temperature, the more randomness. All the explanations above were made with a temperature of 0, meaning the model took the most likely path. But let’s see some alternative answers to the Aussie joke using a temperate of 0.9:

Explained: G'day means Hello. Mate means friend. See the Australian stereotypes in play here?Explained: It's just a joke about how Australia is international slang for a secluded, remote location.Explained: Aussie slang. G'day is a greeting, mate is friend, you've reached is you are the correct person/company to reach, ya know is you understand something, bummer is a slang term for something bad has happened, the distended part of the male or female genitalia is a beehive, its ok is a word used to convey sympathy and concern. So the guy was saying too bad you called me, but I sympathized with you on the phone.

I like the third one because its trying so hard. It understands that its something to do with Aussie slang and sex but can’t quite get it. It even throws in a new angle with explaining what beehive is. But it doesn’t quite work.

But my personal favorite has to be:

Explained:  Australia + honeymoon + penis + swollen vagina = Aussie joke.

ml-everything

Machine Learning Everything