AI and Humor

A machine learning algorithm walks into a bar.

"What'll you have?" asks the bartender.

The algorithm thinks for a moment, then says "I'll have what everyone else is having."

Caveat 1

These slides are about verbal jokes, e.g.,puns and such , like The Word Play Hotel

Such jokes are just a small fraction of the types of humor that humans generate.

Caveat 2

AI systems generate texts that look like a joke.

There is little or no modeling of what makes something funny.

Humor has a strong observer effect. The more jokes you look at, the less funny they seem.

Approaches

  • Most generators based on specific joke patterns:
    • Knock-knock jokes, Dad jokes, riddles, ..., e.g.,
      • What do you get if you cross an X with a Y?
      • An X walks into a bar.
  • Before LLMs, joke generators were hand-built. Few were created and those were rarely maintained.
  • Now there are many LLM-based generators online, often for a fee.

Joke Generators

How to Write Riddles and Feghoots

  • What is a Feghoot?
  • Start with the punchline pun.
  • Generate a question (for a riddle) or story (for a Feghoot) that naturally leads to the final line.

Example: Feghoot

I had a job one winter for the National Park Service, tracking down and bringing back wolves who had left Yellowstone Park.

I had tranquilized a large grey wolf and was dragging it on a sled through some sticky wet snow. I saw a frozen pond that would make part of the journey a lot easier. But as I headed toward it, a rancher came out of a small cabin and pointed a shotgun at me.

"Oh, no, you don't," he said. "You are not going to pull the wolf over my ice!"

Example: Riddle

Why can't J. K. Rowling catch mice when she's high?

A Rowling stoned gathers no mouse.

Gracie Allen Jokes

A script-based joke format

Gracie Allen Joke Pattern

Gracie Allen Joke Example

Real Jokes (not word play)

Two men are camping in the deep woods when suddenly a bear charges into their campsite. They run off together but after 15 minutes, the bear remains close behind.

"It's no use," pants one man. "We'll never outrun that bear."

"I don't need to outrun the bear," says the other man. "I just need to outrun you."

Real Jokes (not word play)

A man decides to try skydiving. On his very first jump, no matter how hard he tries, he can't get the parachute to open.

As he's plummeting down, he's amazed to see another man rising up.

"Hey!" he yells. "Do you know anything about parachuetes?"

"Sorry, I don't," the other man replies. "Do you know anything about lighting camp stoves?"

Humor enerators

Research Links