Article originally published in Towards Data Science

What fits in a shoebox, cracks complex problems, and can run for hours on the energy of a masala dosa? Human brain.

Russell Peters, Maz Jobrani, Zakir Khan, Atul Khatri, Vir Das, Neeti Palta…doesn’t make us just smile. They make us laugh. Laugh hard. And thanks to youtube, this is just the beginning. We have seen Stanford fellow doctors (Dr Jagdish Chaturvedi), MBA graduate (Rahul Subramanian) as well as Microsoft Gaming Director (Anshu More) turning into overnight sensations as stand-up comedian.

Comedy is a difficult art, yet, AI researchers are testing the boundaries by seeing if the cognitive skill to provoke laughter and provide amusement can be placed into machines. Basically, they want to see if robots can be funny. Crazy? Sure. This is mostly because humour is dependent on multiple parameters, many of which are internal and subject to change — what might be funny today may not be funny tomorrow.

Linguistics and psychologists believe good jokes all share the same properties — they amuse us — so systematic analysis ought to reveal them, right? Well, not really.

Computer scientist Dragomir Radev of the University of Michigan and friends at Yahoo Labs, Columbia University and The New Yorker have been studying cartoon captions to see if humour can be arithmetically expressed in computers. Radev and co’s study is published in arXiv. The New Yorker’s famous cartoon caption contest has been running for more than a decade. Each week, editors publish a captionless cartoon and more than 5,000 readers submit a funny caption. The editors pick the top three and ask readers to choose the funniest. In the paper, the authors of the study take a computational approach to determine what differentiates the funniest captions from the rest. They use a number of standard linguistic techniques to rank all 300,000 captions. Criteria include the level of sentiment, whether the captions were referring to people, how clearly they refer to particular objects in the cartoon, and so on. Radev and co then took the highest ranked captions and compared them to the gold standard: the captions New Yorker readers chose as the funniest. This was done by crowdfunding opinion using Amazon’s Mechanical Turk, a place where companies perform tasks that computers are currently unable to do. Based on this approach, it’s easy to imagine a computer capable of churning out the best caption. But the researchers are a long way off from achieving this.

One problem is that for a computer to truly be humorous, most people agree that first you have to program into it what, exactly, makes things funny — and that’s something experts have struggled with for millennia. Plato and Aristotle, for example, long pondered the issue and came up with the superiority theory, the idea that people laugh at the misfortune of others. Sigmund Freud, meanwhile, argued for his relief theory, the concept that humor was a way for people to release psychic energy pent up from repressed sexual and violent thoughts. Then there’s the incongruity theory, the idea put forward by seventeenth-century French philosopher Blaise Pascal that humor arises when people discover there’s an inconsistency between what they expect to happen and what actually happens. Another stumbling block for computer-generated humor: Computers excel in working with simple, fixed data sets. It’s why most joke-generating programs have so far focused on puns and other wordplay, since finite word lists and specific definitions are easy for computers to scan and parse. But most comedy trades in concepts that aren’t simple or fixed at all. The best comedy mines a wide world of attitudes, assumptions, morals, and taboos, most of which aren’t even mentioned in the joke, just subtly hinted at. So if we aim to have computers truly “get” jokes — much less to come up with their own and know when and to whom to tell them — we’re essentially going to have upload into them all of humanity.

What is the difference between laughter and humour?

One of the most common challenges in developing comedy-comprehending machines is the lack of a scientifically valid, agreed-upon definition of humor.

The research is still scant on laughter and humour and the differences between them. It is hard to analyse and quantitate such subtle, human things. What might make us laugh one minute, may not the next. Laughter is used as a communication aid; from the gentle chuckle to the full on belly laugh, it helps us to convey our response to various social situations. We don’t just laugh at something funny, we can use it to build rapport, show trust and acceptance and to fill in the blanks in conversation. Humour could be defined as the art of being funny, or the ability to find something funny; it is a two way thing. It is full of subtle nuances and relies on correct social interpretation and interaction — and it is innately human.

Can Spontaneity Be Programmed?

The spontaneous nature of humor is a confounding factor when it comes to A.I. Even the most sophisticated machines require programming and some type of template to process inputs. But much of comedy depends on unpredictable outcomes, a skill computers generally lack.

While computers can be trained to switch between multiple templates or hypotheses, they’re still incapable of handling a truly original concept outside the boundaries of their knowledge base. To understand spontaneous jokes and truly have a sense of humor, machines would have to gain a much broader contextual appreciation of reality.

There’s a reason computer scientists are eager to tackle comedy: jokes are some of the toughest tests of their programs. If artificial intelligence programs are truly going to model human intelligence, they have to be able to grasp all the clever ways people make things funny.

In fact, scientists have been hard at work for decades designing robo-jokesters. Among the efforts are JAPE, the Joke Analysis and Production Engine; STANDUP, the System To Augment Non-speakers’ Dialogue Using Puns; LIBJOB, the light bulb joke generator; SASI, a sarcasm-detecting program; and DEviaNT, the Double Entendre via Noun Transfer program, which finds the perfect spots in natural language to insert “That’s what she said.” Plus, for computer programmers looking for just the right witty acronym for the next big comedy computer, there’s the HAHAcronym Generator.

Delivering a joke is not a joke!

Comic timing and humour are difficult enough for humans so the challenge is great when attempting to transfer these abilities to robots. Comic timing is a very subtle thing, and can be very difficult to pull off. Engaging in any form of humour requires a lot of real-time thinking, identifying and reacting to social nuances and a certain degree of empathy in order to understand when to deliver the line and to predict how it will be received.

So, how we might build funny robots, if ever? Dragomir Radev replies: “Easy — leave a few of the screws loose”.


a. It’s Comedian vs. Computer in a Battle for Humor Supremacy, Wired, Joel Warner, Joel Warner and Peter McGraw.

b. Humour and Laughter in Artificial Intelligence, Nao Blog

c. Could a robot make you laugh?, New Statesman

d. Humor in Collective Discourse: Unsupervised Funniness Detection in the New Yorker Cartoon Caption Contest, Radev et al., April 2015

e. Neural Joking Machine : Humorous image captioning, Kota Yoshida et al., 30 May 2018