Embedding-based Retrieval in Facebook Search
Jui-Ting Huang
juiting@fb.com
Facebook Inc.
Ashish Sharma
ashishsharma@fb.com
Facebook Inc.
Shuying Sun
shuyingsun@fb.com
Facebook Inc.
Li Xia
xiali824@fb.com
Facebook Inc.
David Zhang
shihaoz@fb.com
Facebook Inc.
Philip Pronin
philipp@fb.com
Facebook Inc.
Janani Padmanabhan
jananip@fb.com
Facebook Inc.
Giuseppe Ottaviano
ott@fb.com
Facebook Inc.
Linjun Yang
∗
yang.linjun@microsoft.com
Microsoft
ABSTRACT
Search in social networks such as Facebook poses dierent chal-
lenges than in classical web search: besides the query text, it is
important to take into account the searcher’s context to provide
relevant results. Their social graph is an integral part of this context
and is a unique aspect of Facebook search. While embedding-based
retrieval (EBR) has been applied in eb search engines for years,
Facebook search was still mainly based on a Boolean matching
model. In this paper, we discuss the techniques for applying EBR
to a Facebook Search system. We introduce the unied embedding
framework developed to model semantic embeddings for person-
alized search, and the system to serve embedding-based retrieval
in a typical search system based on an inverted index. We discuss
various tricks and experiences on end-to-end optimization of the
whole system, including ANN parameter tuning and full-stack opti-
mization. Finally, we present our progress on two selected advanced
topics about modeling. We evaluated EBR on verticals
1
for Face-
book Search with signicant metrics gains observed in online A/B
experiments. We believe this paper will provide useful insights
and experiences to help people on developing embedding-based
retrieval systems in search engines.
CCS CONCEPTS
• Information systems → Retrieval models and ranking
; Search
engine architectures and scalability;
• Computing methodologies
→ Learning latent representations.
KEYWORDS
Embedding, deep learning, search, information retrieval
ACM Reference Format:
Jui-Ting Huang, Ashish Sharma, Shuying Sun, Li Xia, David Zhang, Philip
Pronin, Janani Padmanabhan, Giuseppe Ottaviano, and Linjun Yang. 2020.
∗
This work was performed when the author was at Facebook.
1
In Facebook search, verticals are based on result types, e.g., people, page, group, etc.
KDD ’20, August 23–27, 2020, Virtual Event, CA, USA
© 2020 Copyright held by the owner/author(s).
ACM ISBN 978-1-4503-7998-4/20/08.
https://doi.org/10.1145/3394486.3403305
Embedding-based Retrieval in Facebook Search. In Proceedings of the 26th
ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD
’20), August 23–27, 2020, Virtual Event, CA, USA. ACM, New York, NY, USA,
9 pages. https://doi.org/10.1145/3394486.3403305
1 INTRODUCTION
Search engines have been an important tool to help people access
the huge amount of information online. Various techniques have
been developed to improve search quality in the last decades, espe-
cially in web search engines including Bing and Google. Since it is
dicult to accurately compute the search intent from query text
and represent the semantic meaning of documents, search tech-
niques are mostly based on various term matching methods [
1
],
which performs well for the cases that keyword match can address.
It still remains a challenging problem for semantic matching [
12
],
which is to address desired results that are not exact match of the
query text but can satisfy users’ search intent.
In the last years, deep learning has made signicant progress
in speech recognition, computer vision, and natural language un-
derstanding [
10
]. Among them embedding, which is also called
representation learning, has been proven to be successful techniques
contributing to the success [
2
]. In essence, embedding is a way to
represent a sparse vector of ids as a dense feature vector, which
is also called semantic embedding in that it can often learn the
semantics. Once the embeddings are learned, it can be used as a
representation of query and documents to apply in various stages of
a search engine. Due to the huge success of this technique in other
domains including computer vision and recommendation system,
it has been an active research topic in information retrieval com-
munity and search engine industry as the next generation search
technology [13].
In general, a search engine comprises a recall layer targeting to
retrieve a set of relevant documents in low latency and computa-
tional cost, usually called retrieval , and a precision layer targeting
to rank the most desired documents on the top with more complex
algorithms or models, usually called ranking. While embeddings
can be applied to both layers, it usually has more opportunities to
leverage embeddings in the retrieval layer, since it is at the bottom
of the system which is often the bottleneck. The application of
embeddings in retrieval is called embedding-based retrieval or EBR
for short. Briey, embedding-based retrieval is a technique to use
embeddings to represent query and documents, and then convert
Applied Data Science Track Paper
KDD '20, August 23–27, 2020, Virtual Event, USA
This work is licensed under a Creative Commons Attribution International 4.0 License.