01. Why bi-encoders lose precision
The embedding model scores the question and each passage independently. That makes vector search extremely fast. But because it never sees the question and the passage together, it is comparing two summaries rather than judging a true match. As a result, the top of the ranking can be imprecise. The chunk that truly answers a question can get lost among near duplicates that appear relevant.
A cross-encoder reads the query and the candidate passage jointly as one input. It scores true relevance, not separate summaries. That joint attention is materially more precise. But it is only affordable over a small candidate set. So the system retrieves wide with the fast bi-encoder first, then reranks narrow with the cross-encoder. Fusion and reranking compose rather than compete. One widens the pool, the other orders it.
The design is a deliberate trade. Speed for the first pass, precision for the second. The bi-encoder handles the entire corpus quickly. The cross-encoder refines the top results. This two‑stage approach prevents any single component from becoming a bottleneck.
The cross-encoder runs on the open neural network exchange runtime through the same library the platform already uses. No deep learning framework, no graphics card, no separate service. Cross‑encoding twenty candidates costs CPU milliseconds. That is negligible next to language model synthesis.
But the cross-encoder is not always available. If its weights cannot load, the builder returns nothing and the caller keeps the plain unreranked top results. Every stage can be switched off by an environment flag. Grounding degrades in quality but never fails outright. That rule governs the whole retrieval path.
The bi-encoder’s weakness is inherent. It never sees the question and passage together, so it relies on cosine similarity of separate embeddings. That works well for paraphrase but misses exact lexical matches. Keyword search with BM25 captures those, so the system fuses dense and sparse results to widen recall. Then the cross-encoder reorders for precision.
The result is a retrieval stack that balances speed, recall, and precision. The bi-encoder provides the speed. The fusion provides the breadth. The cross-encoder provides the final ordering. None of these stages is a hard dependency. They compose gracefully. The user gets the best available results under any circumstances.
That is how the platform ensures that the chunk that truly answers a question rises to the top, despite the bi-encoder’s inherent limitation. The trade‑off is explicit and deliberate. Speed at the first stage, precision at the last.