Skip to content

SYSTEM Cited by 1 source

Unicorn (Meta inverted index)

Unicorn is Facebook's in-house inverted-index retrieval system — the lexical backbone behind Facebook search since the Graph Search era. Originally disclosed in the 2013 Meta Engineering post "Under the hood: Indexing and ranking in Graph Search". Re-referenced in the 2026-04-21 Meta Engineering post on Facebook Groups Scoped Search as the lexical-path component of the modernized hybrid retrieval architecture.

In the Groups Scoped Search pipeline, Unicorn provides the sparse lexical retrieval arm that runs in parallel with the SSR + Faiss semantic arm:

"We utilize Facebook's Unicorn inverted index to fetch posts containing exact or closely matched terms. This ensures high precision for queries involving proper nouns or specific quotes."

The lexical path is not deprecated — the 2026 re-architecture makes it parallel to semantic retrieval, not replaced by it. Unicorn remains the high-precision path for queries where users already know the right term.

Features that flow from Unicorn into the L2 ranker

  • TF-IDF scores
  • BM25 scores

These sparse lexical features enter the L2 MTML ranker alongside cosine-similarity scores from the semantic arm, where the ranker learns to fuse the two paradigms.

Historical context

Unicorn predates modern dense retrieval at Meta by roughly a decade. Its longevity reflects the BM25-is-a-workhorse-not-a-fallback argument also made by the Dropbox Dash team (cf concepts/hybrid-retrieval-bm25-vectors): lexical retrieval remains production-critical for precision on exact-term queries even when the enterprise moves to hybrid retrieval as the default.

Seen in

Last updated · 550 distilled / 1,221 read