Siri is not good with sarcasm.

Maybe once you've sassed back at Apple's virtual assistant after a particularly unhelpful answer only for her to sincerely say, "My Pleasure. As Always." Once in a while you might get a spark of snark — for example, ask her what the film Inception is about. But those quips are simply Easter eggs—pre-programmed responses to voice cues.

Imagine if Siri and Cortana and Google Assistant could understand sarcasm, and maybe throw it back in equal measure. What would that mean for robotics and the future of artificial intelligence?

Advertisement – Continue Reading Below

How Sarcasm Works

Yes, sometimes explaining a joke ruins the joke. But researchers who want to teach robots how to be sarcastic have to think hard about the basic mechanisms of how sarcasm works.

One key element of human sarcasm is the counterfactual, says Penny Pexman, professor of psychology at the University of Calgary. Quite simply, a person says one thing but means another. (Perhaps that's why some humans, with an ear tuned toward facts, have such a hard time interpreting sarcasm correctly.)

"[Sarcasm] is filling some essential function in terms of our communication."

Sarcasm also requires us to make decisions about a speaker's intentions, says Pexman. We the listeners must combine long-term information about who the speaker is and the chosen words. Subtle facial gestures, emotional cues, and phrases like "yeah, right" or "nice going" also clue us in to sarcasm, which, fundamentally, is a way of saying and not saying something at the same time.

If sarcasm is such a weird way of communicating, why does it exist in many human cultures in the first place? "Sarcasm seems to be quite pervasive," says Pexman, "which suggests it's filling some essential function in terms of our communication." For example, sarcasm allows us to manage our relationships, exert our intellects, and convey how clever we are, according to Pexman. Whatever the reasons, humans love to be sarcastic, which means robots that seek to talk to us need to learn its ins and out.

"When sarcasm works, it can diffuse a hostile situation," says Paul Levinson, professor of communications and media studies at Fordham University. "But the problem is, what happens if someone takes it the wrong way?"

The Problem with Robo-Sass

There's a sweet moment in Big Hero 6 when Baymax, the giant, white healthcare robot, accidentally scares Hiro, the human he cares for. "You gave me a heart attack," the boy screams. That's t the big white puffy robot's palm-embedded defibrillator springs into action.

"Stop!" yells Hiro, before Baymax can shock him. "It's just an expression."

This cute scene illustrates the major problem with AI. Machines are built to be efficient, and therefore, painfully literal. "One of the key goals in AI is for it to be more reliable than human beings," says Levinson. It makes sense that a machine built for ultimate reliability whiffs on a communication convention that says one thing but means another.

Advertisement – Continue Reading Below

Still, one end goal of AI is to make these systems indistinguishable from human beings, Levinson says. "If we were to say AI is not going to try to develop a way of putting sarcasm into its software…then it would be lacking a really crucial element of human life." But if robots are going to be able to understand sarcasm, then they're going to need to pay attention to a lot more than just the individual words they hear.

"Sarcasm detection is a good example of what we call AI-complete," says David Bamman, assistant professor in the School of Information at UC Berkeley. It requires knowledge of the entire world, including current events, the general attitude of the speaker, and the relationship between the speaker and listener. The need for so much information makes it difficult to "code" sarcasm.

As Pexman points out, some sarcasm is very easy to detect, like a deadpanned "yeah right!" A robot could theoretically be programmed to recognize these basic sarcastic phrases. But what about the more complicated stuff? How long until Baymax is able to realize his human isn't actually dying?

Creating Synthetic Sarcasm

In 2014, SoftBank created a robot named Pepper, which it called the world's first humanoid robot capable of detecting principal emotions like joy, sadness, anger, and surprise. To interpret the moods of the humans around it, Pepper takes into account several different multimodal cues, including facial expressions, body language, and tone of voice.

For example, says Angelica Lim, software engineering manager at SoftBank Robotics, if somebody were to tell Pepper they feel great but were frowning, Pepper would recognize the incongruity. Those dissimilar cues is where the opportunity for sarcasm detection comes into play.

Of course, this requires a familiarity between humans and robots. The reason our friends pick up on our snark and are willing to give our mean-sounding insults the benefit of the doubt is because they've spent time with us. They better understand our speech and thought patterns and can easily discern when we divert from that. Compare that with an AI, says Lim, who might be with you for thirty seconds at a time, and then forgets your history when the interaction is complete.

But what if you were able to build that relationship with a robot? After all, robots can remember the past, she says. "We want to create a robot that has a shared history with you."

SoftBank isn't alone. Google announced in October that it wants to create "a personal Google for each and every user," which could fill the same unfamiliarity gap. Its big rival, Apple, is also interested in getting in on the game. Earlier this year, it snatched up Emotient, a startup that claims it's "at the vanguard of a new wave of emotion analysis."

To be better humans, these robots need data

As Christopher Mims recently wrote in The Wall Street Journal, "your next friend could be a robot." But none of these systems are "true" AI. Their interactions with humans are based on scripts written by creatives, comedians, and, in Google's case, its search database.

To be better humans, these robots need data—data that companies like Google and Apple could slowly accumulate. Creating systems tailor-made for each person that can read emotions and draw on a shared history will advance AI beyond its current ultra-literal understanding of human language. But whether people want to share that kind of information is another question entirely.

Like most friendships, AI still needs to earn our trust.