AI Is Funny - A Generative Joke Model
Written by Alex Armstrong   
Thursday, 08 August 2013

Can computers tell a good joke? Is comedy just a matter of statistics or is there something only a human can bring to creating a joke? A joke generator created at the University of Edinburgh suggests that AI can be funny. 


I like my jokes like my AI, heuristic.

This is an example of an "I like my X like my Y, Z" and software is now almost as good as humans at creating examples that are funny. Two researchers, Sasa Petrovic and David Matthews at the School of Informatics University of Edinburgh have put together a statistical model that can generate such gags - and yes people, real humans, found them funny:

  • I like my relationships like I like my source, open
  • I like my coffee like I like my war, cold
  • I like my boys like I like my sectors, bad

OK, so they are a bit groan-worthy but they are recognizably jokes. 

The method used is interesting.  The jokes need two nouns, X and Y, and an attribute, Z, and it is postulated that:

  1. a joke is funnier the more often the attribute is used to describe both nouns
  2. a joke is funnier the less common the attribute is
  3. a joke is funnier the more ambiguous the attribute is,
  4. a joke is funnier the more dissimilar the two nouns are.

You can verify that these are reasonable by just looking at a few human generated examples. 



The model as a factor graph


The problem in implementing such a model is in getting the necessary data. The word frequencies needed were gathered from Google's n-gram database, which was augmented by tagging words with their part of speech using Wordnet. This was then used to work out how often each noun occurred with the same attribute and the other statistics needed to apply the rules given above. 

Next some human jokes, harvested from Twitter, were mixed in and a people were asked to rate the set as funny or not funny. Of the human jokes  33% were judged to be funny compared to the computer generated jokes of which 16% were funny. You could say that currently AI is half as funny as a human. 

The joking doesn't stop there as the authors also couldn't resist naming their computation of the log likelihood of a joke as the LOcal Log-likelihood or LOL and when ranked according to LOL we get Rank OF Likelihood or ROFL. Hmmm.

And the paper concludes with:

"Finally, we thank the inhabitants of offices 3.48 and 3.38 for putting up with our sniggering every Friday afternoon."

Of course, no understanding or creativity was used in the production of the jokes. The whole exercise is about a statistical model that has a high likelihood, or should that be LOL, of producing a group of words that a human finds funny.

One interesting observation is that the human arbiters of "funniness" disagreed more on the human jokes than on the computer jokes. Presumably human jokes contain cultural or personal references that mean that some other humans don't get the joke. 

More Information

Unsupervised joke generation from big data

Related Articles

Google Helps Tell An Apple From Apple       

Winning spelling algorithm       

Microsoft Web N-gram Services go public       

Inside Google Translate    

Nao and Heather Knight on CNN         


To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.






or email your comment to:



ChromeOS Flex Now Supports 400 Old Machines

ChromeOS Flex is now available to save your old hardware from early onset obsolescence. Now almost every machine can be a "chromebook". Is this a new opportunity for apps?

Tinycade Puts Cardboard And AI Into Games

We tend to underestimate how much AI is changing the way we can tackle problems - even problems that seem to have nothing to do with intelligence of any kind. Tinycade converts scrap cardboard into ga [ ... ]

More News

Last Updated ( Friday, 09 August 2013 )