Why Facebook Is Teaching Its Machines to Think Like Humans

Photo: Josh Valcarcel/WIRED

Facebook needs machines that can understand the way we humans behave and write and even feel.

In January — after the company rolled out a limited public trial of Graph Search, a way of searching activity on the popular social network — Facebook engineers were forced to tweak their algorithms so they could translate slang like “pics of my homies” into more straightforward language like “pictures of my friends” and convert expressions like “dig,” “off the chain,” and “off the hook” into that standard Facebook word: “Like.”

This worked well enough. But it’s just the beginning. Like Google and Apple and other tech giants, Facebook is exploring a new field called “deep learning,” which will allow its machines to better understand all sorts of nuanced language and behavior that we humans take for granted. In short, deep learning teaches machines to behave more like the human brain. Facebook’s effort only recently got off the ground — “we’re just getting started,” a company spokesperson says — but its importance will expand as time goes on.

On their own, each of those three words — “off,” “the,” and “hook” — could mean just about anything. Even the complete phrase could have multiple interpretations depending on the context. It could mean that a telephone receiver wasn’t hung up or, as in the Graph Search example, that a Facebook post was, um, rad or awesome. But Facebook’s original algorithms had no way of knowing the difference because they hadn’t been “taught.”

At that time, that subtlety was less important because Graph Search could only scour connections between people and entities. But now, Graph Search can also crawl Facebook posts and comments. Everything you do and write on Facebook is searchable, including the sentences you pen in the status box at the top of your News Feed and Timeline. And that’s when Facebook’s ability to parse natural language becomes really important.

“Humans differ in the way they use language because of differences in their cultural upbringing. We still need to teach machines these nuances,” says Oleg Rogynskyy, CEO of text analytics company Semantria. “Right now, there’s no way a machine can understand these things that precisely because it lacks the cultural context. That’s going to be the hardest thing to crack in the next 10 to 15 years.”

“Right now, there’s no way a machine can understand human language that precisely because it lacks the cultural context. That’s going to be the hardest thing to crack in the next 10 to 15 years.”

Deep learning involves building neural networks — multi-layered software systems inspired by the way the human brain is built — or at least what we know about the way the human brain is built. Much like the human brain, these artificial neural nets can gather information and react to it. They can build up an understanding of what objects look or sound like or what words mean without the need for as much human labeling as traditional machine learning methods.

Deep learning is especially useful for complex problems like computer vision, voice recognition, language translation, and natural language processing, and in order to make it work, you need massive amounts of data. “Deep learning depends less on human engineering and flourishes on having more and more training data,” said Richard Socher, a Stanford University computer scientist studying natural language processing. “If you ask the algorithm to learn from examples and not an expert, now it also needs more data to be able to make inferences. As soon as you have more and more training data, that’s when you really gain with deep learning.”

Already, companies like Baidu, Google and Microsoft have used deep-learning algorithms to supercharge image and voice search. The next big challenge will be deciphering the written musings of individuals — and there’s an overabundance of that to keep companies busy for a long time. Just look at your Facebook page — or your Twitter feed.

A first step toward the kind of computer brain that Rogynskyy speaks of — the type that understands dialectic differences for multiple languages — is all about building algorithms that can better understand opinion, or sentiment. The next step would be algorithms that can accurately analyze emotion — or the multi-dimensionality of sentiment, how good or bad something is, for example. Socher, the Stanford computer scientist, recently launched a deep learning algorithm that begins to do just that and has a better understanding of written language than other current methods. Already, he has been approached by several startups who are interested in licensing the new algorithm.

Today, even the smartest algorithms have a limited ability to extract accurate information about an individual’s opinion from a string of words. That’s because the most widely used models for sentiment analysis have been limited to so-called “bag of words” approaches — models that overlook word order. The system just sees a mixed collection of words, counts them up, and uses that tally to assess whether a sentence or paragraph had a positive or negative meaning. Other similar algorithms can look at strings of words of varying length, which might get you closer to the actual intended meaning. It’s better, but only by a hair.

These approaches work well if you’re interested in looking at the collective voice of users, but what companies really want is to understand individuals, to target real people with personalized messages and ads. And that’s where these models break down. “If a system is wrong 30 percent of the time, you probably wouldn’t want to consider its opinion heavily when applied to a single tweet,” says Elliot Turner, CEO of AlchemyAPI, a company that uses deep learning for sentiment analysis.

That’s why Facebook and others are turning to deep learning. They want technology that lets them better understand how individual users feel about and interact with, well, everything. They can use that information to improve user experience, build brand loyalty, and, ultimately, sell people stuff — all in a more finely tuned way than what’s currently possible. “The power of deep learning is building high-level abstract representations of data,” says Turner. “In the world of language, you can imagine going from letters to words to phrases to sentence fragments to sentences to paragraphs and so on.”

That’s becoming easier because more and more of the internet is becoming structured. The web abounds with databases of information like the Internet Movie Database, Wikipedia, Pubmed, Wolfram Alpha, Data.gov, and the CIA Factbook — all of which can be plugged into deep learning models as training data. Some of this data is publicly available, which also makes this market more accessible not only to the likes of Facebook, but to companies who don’t have their own big-data arsenals.

“Because it’s all structured,” Rogynskyy says, “you can bring it to the machine and have it understand more about what it’s seeing.”

Here’s The Thing With Ad Blockers

We get it: Ads aren’t what you’re here for. But ads help us keep the lights on. So, add us to your ad blocker’s whitelist or pay $1 per week for an ad-free version of WIRED. Either way, you are supporting our journalism. We’d really appreciate it.