r/MachineLearning • u/faceshapeapp • Oct 26 '19
Discussion [D] Google is applying BERT to Search
Understanding searches better than ever before
If there’s one thing I’ve learned over the 15 years working on Google Search, it’s that people’s curiosity is endless. We see billions of searches every day, and 15 percent of those queries are ones we haven’t seen before--so we’ve built ways to return results for queries we can’t anticipate.
When people like you or I come to Search, we aren’t always quite sure about the best way to formulate a query. We might not know the right words to use, or how to spell something, because often times, we come to Search looking to learn--we don’t necessarily have the knowledge to begin with.
At its core, Search is about understanding language. It’s our job to figure out what you’re searching for and surface helpful information from the web, no matter how you spell or combine the words in your query. While we’ve continued to improve our language understanding capabilities over the years, we sometimes still don’t quite get it right, particularly with complex or conversational queries. In fact, that’s one of the reasons why people often use “keyword-ese,” typing strings of words that they think we’ll understand, but aren’t actually how they’d naturally ask a question.
With the latest advancements from our research team in the science of language understanding--made possible by machine learning--we’re making a significant improvement to how we understand queries, representing the biggest leap forward in the past five years, and one of the biggest leaps forward in the history of Search.
Applying BERT models to Search
Last year, we introduced and open-sourced a neural network-based technique for natural language processing (NLP) pre-training called Bidirectional Encoder Representations from Transformers, or as we call it--BERT, for short. This technology enables anyone to train their own state-of-the-art question answering system.
This breakthrough was the result of Google research on transformers: models that process words in relation to all the other words in a sentence, rather than one-by-one in order. BERT models can therefore consider the full context of a word by looking at the words that come before and after it—particularly useful for understanding the intent behind search queries.
But it’s not just advancements in software that can make this possible: we needed new hardware too. Some of the models we can build with BERT are so complex that they push the limits of what we can do using traditional hardware, so for the first time we’re using the latest Cloud TPUs to serve search results and get you more relevant information quickly.
Cracking your queries
So that’s a lot of technical details, but what does it all mean for you? Well, by applying BERT models to both ranking and featured snippets in Search, we’re able to do a much better job helping you find useful information. In fact, when it comes to ranking results, BERT will help Search better understand one in 10 searches in the U.S. in English, and we’ll bring this to more languages and locales over time.
Particularly for longer, more conversational queries, or searches where prepositions like “for” and “to” matter a lot to the meaning, Search will be able to understand the context of the words in your query. You can search in a way that feels natural for you.
To launch these improvements, we did a lot of testing to ensure that the changes actually are more helpful. Here are some of the examples that showed up our evaluation process that demonstrate BERT’s ability to understand the intent behind your search.
Here’s a search for “2019 brazil traveler to usa need a visa.” The word “to” and its relationship to the other words in the query are particularly important to understanding the meaning. It’s about a Brazilian traveling to the U.S., and not the other way around. Previously, our algorithms wouldn't understand the importance of this connection, and we returned results about U.S. citizens traveling to Brazil. With BERT, Search is able to grasp this nuance and know that the very common word “to” actually matters a lot here, and we can provide a much more relevant result for this query.
Let’s look at another query: “do estheticians stand a lot at work.” Previously, our systems were taking an approach of matching keywords, matching the term “stand-alone” in the result with the word “stand” in the query. But that isn’t the right use of the word “stand” in context. Our BERT models, on the other hand, understand that “stand” is related to the concept of the physical demands of a job, and displays a more useful response.
Here are some other examples where BERT has helped us grasp the subtle nuances of language that computers don’t quite understand the way humans do.
Improving Search in more languages
We’re also applying BERT to make Search better for people across the world. A powerful characteristic of these systems is that they can take learnings from one language and apply them to others. So we can take models that learn from improvements in English (a language where the vast majority of web content exists) and apply them to other languages. This helps us better return relevant results in the many languages that Search is offered in.
For featured snippets, we’re using a BERT model to improve featured snippets in the two dozen countries where this feature is available, and seeing significant improvements in languages like Korean, Hindi and Portuguese.
Search is not a solved problem
No matter what you’re looking for, or what language you speak, we hope you’re able to let go of some of your keyword-ese and search in a way that feels natural for you. But you’ll still stump Google from time to time. Even with BERT, we don’t always get it right. If you search for “what state is south of Nebraska,” BERT’s best guess is a community called “South Nebraska.” (If you've got a feeling it's not in Kansas, you're right.)
Language understanding remains an ongoing challenge, and it keeps us motivated to continue to improve Search. We’re always getting better and working to find the meaning in-- and most helpful information for-- every query you send our way.
38
u/BatmantoshReturns Oct 26 '19
Amazing! I'm currently working on my own mini informat retrieval project using Bert for information retrieval problem. It's for machine learning papers!
6
u/cpjw Oct 26 '19
Interesting project. Though, if you don't mind giving a brief explanation, how is BERT actually being used? (You mention summarization for a lot of the readme, but seems a bit different than search).
There's something about using FAISS. Are you just doing something like, (1) slide BERT over the doc text and average all the token vectors (2) index those averages into vectors index (3) average BERT embeddings of query and then take nearest neighbor? (This seems like simple aproximation how something like BERT-based IR could work, but I would guess such an approach wouldnt really work, especially for long docs)
1
u/BatmantoshReturns Oct 26 '19
You pretty much described it, the architecture is similar to a previous one we did for medical question and answering
2
u/cpjw Oct 26 '19
Oh ok cool. Thanks for sharing that.
I still have some scepticism on how well squishing documents and answers into vectors and searching for nearest neighbors can work for the web, as often time queries might involve only a fraction of a webpage, and that relevant fraction might get lost in the pooling of the doc vec.
I haven't really done anything in this area though, so not really going to try and comment further. Thanks for sharing.
4
u/import_social-wit Oct 26 '19
So there's been established research indicating that ranking top sentences of a document are a good substitute for the entire document. This didn't really matter when l2r approaches relied on explicit features of the document (tfidf, length, etc) or it didn't matter at all with BM25/query likelihood.
With recent work, we've essentially cycled back to work from the 90s, where BERT now ranks every sentence (or passage/sliding window) and we take the top $n$ as the document score.
Take a look et EMNLP this year, we have a number of papers demonstrating this approach for ad-hoc retrieval.
1
17
Oct 26 '19
We see billions of searches every day, and 15 percent of those queries are ones we haven’t seen before
That is an amazing number of novel queries.
6
20
u/picardythird Oct 26 '19
I'm sure nothing can go wrong, especially if BERT was trained on anything similar to the dataset on which GPT-2 was trained.
48
u/gfrscvnohrb Oct 26 '19
Pretty sure GPT-2's banning was an overhyped PR stunt.
13
Oct 26 '19
IMHO GPT-2 is overhyped. It makes perfect sounding responses, but its responses tend to be total garbage when it comes to factual information. It has its uses though.
As far as I am aware proper out of context hasn't been solved yet.
4
u/cpjw Oct 26 '19
Can you explain a little about how you think the linked generative model concerns are causing concerns here?
Are you worried a model might might associate some concepts with actual writers or people? Seems like a win from a search perspective.
0
Oct 26 '19
IIRC you could shape your questions to get PII data from the model.
Google probably have something in place to handle PII data ending up in their indexes, so likely a non-issue.
6
u/cpjw Oct 26 '19 edited Oct 26 '19
No, you definately can Google PII (someone's name, someone's tweets, leaked personal conversations that ended up on the public internet, etc) and get results back. It seems like that's exactly what web search engine is for though if the information is crawlable on web and a user is querying for it...
5
u/MrPuj Oct 26 '19
Is this live yet ? I tried some of the example queries and they still don't work as expected
2
7
3
u/joker1999 Oct 26 '19
Would it be possible to extend search to support multiple sentences? For example for more complex questions, you could build up some context explaining what you need specifically.
1
u/mwb1234 Oct 27 '19
Damn, that would be fantastic. I just read a bit about how they created BERT, and I believe it would be possible. I imagine that's possible given this snippet from their blog post about BERT
BERT also learns to model relationships between sentences by pre-training on a very simple task that can be generated from any text corpus: Given two sentences A and B, is B the actual next sentence that comes after A in the corpus, or just a random sentence? For example:
1
u/TotesMessenger Oct 26 '19
-8
u/RaunchyPa Oct 26 '19
Great for users, potential nightmare for small website masters. As Google progresses further with essentially conquering the internet, they filter and remove small sites from the equation almost entirely. I know Reddit is very anti ads, but these days people with excellent content are just giving up because Google is shutting them out regardless of how hard they try, and it will only get worse as DeepMind and BERT gets smarter (I suspect this because smaller websites compete on smaller keywords, the more keywords that resolve to a single meaning, the more competitive that top spot becomes as there are no longer single keywords but a single meaning to searches).
20
u/faceshapeapp Oct 26 '19
Did you take a look at some of the examples they give ? I actually think this will *help* small websites. The reason is that big websites get authority and can rank for these keywords even if they are off-topic because of some minor variation.
Take for example: "do estheticians stand a lot at work" they show, there's no way apps.il-work-net.com would have ranked for that query simply because Chron "seems" to be on topic and has authority.
0
u/doireallyneedone11 Oct 26 '19
Will this improve Google Assistant as well?
1
u/faceshapeapp Oct 26 '19
The article mentions that conversational queries was one of the improvements in this launch, so looks like it will benefit Assistant quite a bit.
0
u/amado88 Oct 26 '19
The BERT/whole transformer approach must have been informed about the last few years using a conversational interface with assistants as well? Although Google is large, I'm sure there must be some spillover knowledge :)
-1
u/doireallyneedone11 Oct 26 '19
Man, Google Assistant is already miles ahead, this will make others look even more stupid.
0
u/cpjw Oct 26 '19
The digital assistant race is still a lot closer than the search engine race though. So for others it's less of "catching up seems near impossible" kind of thing.
0
u/bartturner Oct 26 '19
Should be for cloud GA.
But Google is also releasing the next generation assistant with local processing and do not see how it will help?
-3
u/RaunchyPa Oct 26 '19
Small businesses have small authority. It's already a waiting game of 6 months once you put a site up before it will rank for anything. Authority sites are things like Amazon, MassivelyOverpowered, etc. Things that people know by name. The only way small businesses (aka people you've never heard of) can rank is by picking keywords that other businesses aren't explicitly after. I feel like this will eliminate finetuned keywords (bars of soap instead of bar of soap--okay, this was eliminated in the past but just for example) and just make more super groups that will allow authority sites to dominate basically everything.
The good thing for users is that if you want to find something, you don't have to wade through spam and you'll get right to your topic, but it also eliminates a lot of new talent. Google does make everything seem like it's helping small businesses in their press releases, but I've never experienced anything but the opposite (with the exception being specifically location based searches which are still dominated by small businesses just because of the implication)
0
u/faceshapeapp Oct 26 '19
I think your past interactions with search ranking changes gives you a bias, but I strongly believe this will help those niche websites which target long-tail keywords. Time will tell.
-2
u/RaunchyPa Oct 26 '19
I respect your opinion but even in your example it pretty much confirms it. Exact match tlds and spam sites have already been pretty dead for a while. Small businesses are businesses which have no authority and generally build authority by targeting longtails. This will almost certainly create 'super keywords' which will preclude anyone at the bottom from entering the playing field. The only good thing is this can differentiate between bad content and good content to an extent but they have already had systems which improved that. Hopefully I'm wrong though
1
u/mwb1234 Oct 27 '19
I disagree with your assessment entirely. It looks like BERT is introducing contextual awareness into language modeling, so I would imagine that it will improve ranking of contextually niche websites who otherwise wouldn't appear in keyword optimization
1
u/RaunchyPa Oct 27 '19
Every niche has authority sites. New sites in a niche have 0 authority but potentially a lot of talent. Before BERT, it's not like there were super sites ranking for every keyword (outside of things like maybe Amazon). That stopped like 10 years ago. Now BERT will likely get rid of a lot of spam sites that are ranking with shitty spun content, but other Google updates have largely eliminated that as well.
Google already had enough awareness through other detection features such that only relevant on-topic sites rank for the most part.
0
u/mattstats Oct 26 '19
I’ve seen this come up for commercial chatbots. I’d like to know more about this, can it integrate with knowledge bases?
-3
u/bartturner Oct 26 '19
This is part of the reason Google is now getting over 50% of search queries ending without an additional click.
Here is a direct link to T5.
https://super.gluebenchmark.com/leaderboard
Plus some comments from HN
2
0
u/_olafr_ Oct 28 '19
This is more likely to be a result of all their filtering (for example of torrenting/streaming sites) and the introduction of their political biases.
9
u/cpjw Oct 26 '19
This is interesting. Is there any public information on actually how BERT is being applied to IR?
For each of the scenarios they described they are just like "here's potential hard search query, and BERT adds magic language understanding which makes it all better 👏🎉👏". It's non-obvious how BERT is actually being used though, especially at the scale and latency they need.
(I get that that this is Google's "secret sauce" and they might not saying anything in this particular use of BERT. But I'm curious if anyone had seen anything related.)