Loading slide

Loading contents...

[██████████░░░░░░░░][████████████████░░░░░░░░░░░░]8 / 14
<back>next

How the search actually works

That search step deserves a proper look, because you already built the machinery for it two modules ago and it has been waiting to be spent.

The naive version would hunt for documents containing your words. That fails in the ordinary way. Ask about car repair costs and a document titled automobile maintenance expenses never surfaces, despite being the exact thing you wanted. No shared words, so nothing matches.

The version that actually gets used is the one from the embeddings chapter.

Every document is turned into a position in the space of meaning, worked out in advance and stored. Your question is turned into a position too. Then finding relevant documents becomes a question about distance: which positions sit nearest to this one?

The automobile document surfaces because automobile and car were pulled into the same neighbourhood by keeping the same company across millions of sentences. Nobody wrote a synonym list. The geometry did it.

So the black box in the middle of retrieval is not a new mechanism. It is embeddings, the thing that made words comparable in the first place, now used to make documents comparable.

# citations(1)↓
  1. [1]arxiv.org