Machine Learning

Bi-Encoder

A model that independently encodes two texts into separate vectors, then compares them using a similarity metric like cosine similarity. Bi-encoders are fast because vectors can be pre-computed.

Why It Matters

Bi-encoders power real-time semantic search — documents are encoded once and stored, and only the query needs encoding at search time.

Example

Pre-computing embeddings for 1 million documents and storing them. When a query arrives, encode it (once) and find the most similar pre-computed document vectors in milliseconds.

Think of it like...

Like two people independently summarizing a movie and comparing their summaries, versus watching the movie together — independent encoding is faster but less nuanced.

Related Terms