What it is
The query is present, or it isn't
A bi-encoder runs the encoder twice, once over each text, and compares the two vectors it gets back. The document half runs once when you build your index, and the query half runs when somebody searches. Everything about its speed follows from the document vector existing before the query does.
A cross-encoder runs the encoder once over both texts joined into a single input, with a separator between them, and reads a score off the end. Every layer of the model can look from a word in the query to a word in the document, which is the accuracy, and the score exists only for that one pair, which is the cost.

The numbers in that strip are the argument. Building a searchable index of 10,000 passages took 143 seconds once. Answering a query off that index took 15 milliseconds. Scoring the same 10,000 passages with a cross-encoder takes 20 minutes, for one question, every time it is asked.
All of those are sequential timings, one text or one pair at a time on a laptop CPU, which is how the 120.7 ms per pair was measured. A real reranker sends pairs through the model in batches, and on a GPU a batch of dozens of pairs usually takes only a little longer than a single pair, so the 20 minutes could shrink a lot. This page didn't measure a batched run, so treat the size of that drop as something to time on your own hardware. What batching can't change is that the work still grows with the number of documents scored for every query, because each pair is a full pass through the model. The bi-encoder's per-query work stays at one embedding and a cheap comparison whatever the collection size, so batching narrows the gap between the two designs without removing it.
Keep reading
The rest of this article is free with an account
Create a free account to read the remaining 5 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.
- 02Which models are which
- 03What reading together buys, and what it costs
- 04Choosing, which usually means using both
- 05How to try it
- 06What neither design fixes
