ColBERT
The 2020 paper that introduced Late Interaction, bridging the speed of dual-encoders with the accuracy of cross-encoders for neural retrieval.
Paper: ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT
Authors: Omar Khattab, Matei Zaharia · 2020
Read the paperThe Problem
In neural retrieval, you have two choices. Cross-encoders concatenate the query and document and feed them into a transformer. They are highly accurate because tokens can attend to each other early, but they are far too slow for retrieving from millions of documents. Dual-encoders (like DPR or SBERT) encode the query and document separately into single vectors and use dot-product similarity. They are fast, but because they collapse entire documents into a single vector, they lose complex contextual nuances and perform worse on difficult queries.
The Idea
ColBERT introduced a third way: Late Interaction. Instead of collapsing a document into one vector, it encodes documents into a bag of contextualized token embeddings offline. At search time, it encodes the query into token embeddings, and then computes a cheap "MaxSim" operation: for each query token, it finds the most similar document token, and sums these max scores to get the final document score.
How It Works
ColBERT separates the encoding of the query and document, but retains token-level representation:
- Offline Document Encoding: Every passage is passed through BERT. Instead of pooling to a single vector, ColBERT stores a vector for every token in the document.
- Online Query Encoding: The query is passed through BERT to produce token-level embeddings.
- Late Interaction (MaxSim): For each token embedding in the query, ColBERT calculates the dot product with every token embedding in the document, and takes the maximum value. The overall score for the document is the sum of these maximum similarity scores across all query tokens.
To make this fast enough to run in milliseconds over millions of documents, ColBERT uses a two-stage retrieval pipeline. It first retrieves candidate documents using a fast vector similarity search (using FAISS) over the token embeddings, and then applies the MaxSim operation only to the top candidates.
Why It Mattered
ColBERT proved you could achieve accuracy competitive with heavy cross-encoders while operating at speeds close to simple dual-encoders. It solved the "bottleneck" problem of dual-encoders, which struggle to represent long, nuanced documents in a single vector.
What Came After
The authors released ColBERTv2, which dramatically compressed the token embeddings (by up to 100x) using residual quantization, solving the main drawback of the original method (massive storage requirements). The ColBERT architecture heavily influenced modern re-ranking systems and enterprise search solutions that need high precision.