Skip to content

ColBERT: contextualized late interaction over BERT

optionalcorefundamentalpaperrubric 11/122020 · SIGIR 2020 · ~30 min

Omar Khattab, Matei Zaharia

Status

TL;DR. BERT rerankers are accurate but read each query–document pair jointly, which is slow. ColBERT encodes the query and the document separately into one small vector per token, and scores with MaxSim: for each query token, the best-matching document token, summed over the query. Documents can be encoded and indexed offline.

Why it matters now. “Late interaction” became its own family of retrievers. It includes ColBERTv2 and PLAID, ColPali for page images, the token-level pooling behind late chunking, and the 2026 late-interaction embedding models.

Late interaction: MaxSim scoring and how ColBERTv2 and PLAID make it cheap Left: the query and the document are encoded separately into one vector per token. A grid shows the similarity of every query token with every document token; the maximum in each query row is highlighted, and the row maxima are summed into the relevance score. Right: ColBERTv2 stores each document vector as a centroid id plus a small quantized residual, and PLAID first scores passages using centroids only, prunes, and decompresses residuals only for the final candidates. ColBERT: encode separately, interact late query encoder doc encoder doc vectors precomputed and indexed offline q₁…q₄ (one per token) d₁…d₆ (one per token) sim(qᵢ, dⱼ) = qᵢ · dⱼ d₁d₂d₃d₄d₅d₆ q₁q₂q₃q₄ max max max max Σ = score(q, d) sum of per-token maxima Making it cheap ColBERTv2: residual compression d ≈ centroid[c] + quantized residual (1–2 bits per dimension) + denoised supervision: distil a cross-encoder, mine hard negatives → 6–10× smaller index PLAID: centroids first 1 · candidates from nearest centroids 2 · centroid interaction + pruning 3 · centroid interaction, no pruning 4 · decompress residuals, full MaxSim each stage keeps fewer passages
Left: MaxSim scoring. Right: how ColBERTv2 and PLAID make it cheap to store and search.

Compare the two documents for each query. Each query token picks its single best document token, so an ambiguous word like capital or bank can be matched by the wrong sense.

MaxSim on toy token embeddings

Each word has a made-up, unit-length 3-d vector with axes ≈ (water, place, finance). Cell = cosine qᵢ·dⱼ. The outlined cell in each row is that query token's max; the ColBERT score is the sum of the row maxima.

Vocabulary: river, water, seine, flows, paris, france, city, capital, bank, money, funds, raises, through, in
Document
Try:

  • score(q, ) =
  • Doc A =
  • Doc B =
  • Storage. One vector per token makes the index an order of magnitude larger than single-vector indexes. ColBERTv2 addresses this.
  • Serving. A multi-stage pipeline (ANN search, gather, rescore) is harder to run than one ANN lookup. PLAID and newer engines address this.
  • Theory. The LIMIT result says single vectors cannot represent all top-k combinations. How much does token-level matching escape that bound?
  • Before: BM25, BERT cross-encoder rerankers (monoBERT), DPR-style bi-encoders.
  • After: ColBERTv2, PLAID, Baleen (FLIPR, a multi-hop late-interaction retriever), ColPali, SPARSEUP (initialised from a late-interaction model).
  • Hands-on: PyLate trains and serves ColBERT-style models in a few lines.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Two query tokens q1, q2 and two candidate passages, each with three unit-normalised token vectors. Cosine similarities (rows = query tokens): passage A: q1 → [0.9, 0.2, 0.1], q2 → [0.8, 0.3, 0.2]; passage B: q1 → [0.6, 0.5, 0.4], q2 → [0.1, 0.7, 0.6]. Compute each passage's MaxSim score, then its score under the "average similarity" variant the paper ablates. Which passage wins under each, and what does that say about MaxSim's inductive bias?

    What a strong answer covers
    • MaxSim: A = 0.9 + 0.8 = 1.7, B = 0.6 + 0.7 = 1.3, so A wins.
    • Average similarity: A = 0.40 + 0.43 ≈ 0.83, B = 0.50 + 0.47 ≈ 0.97, so B wins. Averaging rewards passages that are uniformly "sort of" related.
    • In A both query tokens align to the same document token (d1). MaxSim allows many-to-one alignment with no normalisation across query tokens, unlike attention.
    • MaxSim is a soft per-term match: each query term asks whether its best evidence appears anywhere in the passage. That is closer to BM25-style term matching than to whole-passage similarity. Model [B] in Fig. 5 (average instead of max) is clearly worse.
    • Scale: with unit vectors each term lies in [−1, 1], and the score always sums N_q = 32 terms (real tokens plus [MASK] padding), which keeps scores comparable across query lengths.
  2. Derive / compute

    Table 4 of the paper reports 286 GiB for the 8.8M-passage MS MARCO collection with 128-d vectors at 4 bytes per dimension. (a) Back out the implied number of stored vectors per passage. (b) Predict the size at 2 bytes/dim and at 24 dims × 2 bytes, and compare with the reported 143 GiB and 27 GiB. (c) Compare with a single-vector index holding one 768-d fp32 vector per passage.

    What a strong answer covers
    • (a) One vector = 128 × 4 = 512 bytes. 286 GiB ≈ 307 GB, so about 600M vectors, or about 68 per passage after punctuation filtering.
    • (b) At 2 bytes/dim the size halves to ≈ 143 GiB. At 24 × 2 = 48 bytes/vector it is ≈ 28.8 GB ≈ 27 GiB. Both match Table 4: storage is simply vectors × dims × bytes.
    • (c) 8.8M × 768 × 4 bytes ≈ 27 GB ≈ 25 GiB. So 128-d fp16 ColBERT is ≈ 5.7× larger and the fp32 version ≈ 11× larger: the "order of magnitude" storage cost.
    • Quality cost of shrinking: re-ranking MRR@10 falls only from 34.9 to 33.9 going from 128-d fp32 to 24-d fp16, about 10× less space. Token vectors are highly redundant, which is what ColBERTv2's compression exploits.
  3. Mechanism

    The paper calls MaxSim "amenable to pruning", enabling end-to-end retrieval with N_q per-token ANN searches (k′ vectors each) followed by exact re-scoring of the union. Explain why per-token candidate generation is valid for MaxSim. Then show that the "average similarity" variant does not need per-token search at all, because it collapses to a single-vector index, and say what that collapse costs. What kind of relevant passage can MaxSim's candidate generation miss?

    What a strong answer covers
    • MaxSim decomposes into per-query-token maxima. A passage with S(q,d) ≥ s must contain, for some query vector, a document token with similarity ≥ s/N_q. A per-token nearest-neighbour search can find that witness without scoring the passage as a whole.
    • Average similarity is linear: Σ_i mean_j q_i·d_j = (Σ_i q_i)·(mean_j d_j). Each passage can be precomputed as one pooled vector and searched with ordinary MIPS, so it is indexable, but as a single-vector model. Per-query-token evidence disappears into one dot product (Fig. 5 [B] is clearly worse), unlike MaxSim's non-linear per-token max.
    • Stage 1: 32 query vectors × k′ hits each, mapped to passage ids, gives K ≤ N_q·k′ unique candidates. Stage 2 gathers their full embeddings and computes exact MaxSim. The paper used IVFPQ with P = 2,000 cells, the nearest p = 10 searched, k′ = 1,000 and 16-byte PQ codes.
    • Misses: passages whose score comes from many moderate matches, none of which reaches a query vector's top-k′ across the whole collection (for example, matches on common words spread over many terms). ANN and PQ approximation error add further misses.
    • Evidence it works: end-to-end ColBERT (36.0 MRR@10) beats the same model re-ranking BM25's top-1000 (34.9). It surfaces passages BM25 never retrieved.
  4. What if…

    Figure 5 ablates, with 5-layer BERT encoders: [A] a single 4096-d [CLS] vector per side (4096 = 32 × 128), [B] average instead of max similarity, [C] no [MASK] query augmentation, [D] full 5-layer ColBERT; then [E] 12-layer ColBERT and end-to-end retrieval. Predict the ordering and explain the mechanism behind each gap. What does the 4096-d control rule out, and what does it leave open?

    What a strong answer covers
    • [A] is clearly worst. One pooled vector must summarise the whole passage, so term-level evidence is lost. Sizing it at 4096 = 32 × 128 matches the query side's total dimensionality, so the gap is not just "more numbers".
    • It does not match the document side (≈ 68 vectors × 128 dims per passage), and it changes the scoring geometry. Capacity and structure are therefore not fully separated.
    • [B] < [D]: averaging dilutes strong term matches (see the toy MaxSim question). [C] < [D]: without [MASK] padding the model loses its learned soft-expansion and re-weighting slots. The paper calls this drop "noticeable".
    • [E] > [D]: depth matters (34.9 MRR@10 for the 12-layer re-ranker). End-to-end retrieval also raises MRR@10, because some top-10 passages are missing from BM25's top-1000.
    • All of these are re-ranking runs on MS MARCO dev, so they say nothing about out-of-domain behaviour.
  5. Critique

    The headline claim is about 170× lower latency and 13,900× fewer FLOPs than BERT-base re-ranking. Identify what this comparison depends on (re-ranking depth, what the latency includes, which costs are left out) and design a comparison a 2026 reviewer would accept.

    What a strong answer covers
    • The FLOP ratio scales with depth k: ≈ 180× at k = 10, 13,900× at k = 1,000 and 23,000× at k = 2,000. ColBERT encodes the query once, while a cross-encoder runs k full passes. At shallow k the advantage is about two orders of magnitude smaller.
    • ColBERT's latency includes gathering embeddings and moving them to the GPU; query encoding and interaction take only 13 ms of it. The baselines exclude CPU preprocessing. All numbers are tied to one V100 per query.
    • Left out: index memory (hundreds of GiB; see the storage question) and the offline encoding cost (about 3 hours on 4 GPUs for MS MARCO), which a cross-encoder never pays.
    • Fairer design: compare at matched quality against today's small distilled cross-encoders (for example a 6-layer MiniLM) at k ∈ {10, 50, 100}. Report p50 and p95 latency on fixed hardware, cost per 1,000 queries including the RAM to hold the index, and out-of-domain quality, not just MS MARCO dev.
  6. Design

    You must add late interaction to a legal search engine: 50M documents averaging 2,000 tokens, CPU servers with 512 GB RAM each, a p95 latency budget of 200 ms, and lawyers who care about exact statutory phrases. Compute the raw ColBERT index size, then choose between (i) indexing all tokens with heavy compression, (ii) a BM25 or single-vector first stage with ColBERT re-ranking of the top-k, and (iii) chunking plus token pruning. Defend the choice and say how you would validate it.

    What a strong answer covers
    • Raw size: 50M × 2,000 = 10^11 token vectors. At 128-d fp16 (256 bytes) that is ≈ 25.6 TB. Even at ColBERTv2's 20–36 bytes per vector it is ≈ 2–3.6 TB, so full-token indexing means a sharded cluster.
    • Option (ii) needs vectors only for re-ranked documents, but they still have to be stored. Encoding 100 × 2,000-token documents per query on CPU will not fit in 200 ms.
    • The 512-token encoder limit forces chunking under every option. The document score is a max (or top-m sum) over chunk scores, and that aggregation rule is itself a design choice to validate.
    • Exact phrases: MaxSim ignores token order, so keep a lexical or phrase-aware stage (BM25 with positions). Hybrid fusion is defensible here.
    • Validate: first-stage recall@1000 on a judged sample, nDCG@10 after re-ranking, p95 latency under load, and per-query-type slices (citation look-ups vs conceptual questions).

Done with this page?

Status