Interview Q&A / AI & Generative AI

AdvancedQuick answer1 min readUpdated 3 Oct 2026

What is the difference between a bi-encoder and a cross-encoder?

SHORT ANSWER

A bi-encoder embeds the query and each document separately, so document vectors can be precomputed and searched fast. A cross-encoder reads query and document together for a more accurate score, but must run for every pair, so it is used on a short candidate list.

Explain it simply

A matchmaker can write a profile card for every person in advance and then compare cards quickly. That is a bi-encoder: the two sides never meet during encoding, only their summary vectors are compared. Fast and scalable.

Or the matchmaker can seat two people together and watch them talk before judging. That is a cross-encoder: the model sees query and passage jointly and can notice fine-grained matches, negation and context. Accurate, but you would have to seat every possible pair, which is impossible for millions of documents.

So systems combine them. The bi-encoder retrieves a shortlist using precomputed vectors, and the cross-encoder reranks only that shortlist.

Example

text
Bi-encoder:    score = similarity( embed(query), embed(doc) )   # embed(doc) precomputed
Cross-encoder: score = model( query + doc together )             # run per pair, at query time

What to say in the interview

"Bi-encoders encode separately, enabling pre-indexed fast retrieval; cross-encoders jointly encode the pair for better accuracy at higher cost. The standard design is bi-encoder retrieval followed by cross-encoder reranking."

#retrieval#bi-encoder#cross-encoder

Related questions

Practise more AI & Generative AI questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open AI & Generative AI quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.