Multi-model · GTE + cross-encoder · WASM
This is how real search works. Stage one: GTE embeds the query and every passage independently and ranks by cosine — fast, cheap, scales to millions. Stage two: a MS MARCO cross-encoder reads the query and each shortlisted passage together and re-scores them — slower, but far more precise. Both models run locally. Watch the order change between the two stages.
A bi-encoder (GTE) turns every document into a vector once, so retrieval is just nearest-neighbour math — it scales, but the query and document never "see" each other. A cross-encoder attends across the pair, catching relevance a cosine misses, but it must run the model for every candidate — too slow for a whole corpus. Retrieve wide and cheap, rerank narrow and sharp.