esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

What Is ColBERT-Style Late Interaction?

How ColBERT matches each word piece of a question against each word piece of a document, and what that costs, explained for your AI interview.

In short

ColBERT-style late interaction keeps one vector per token of each document and scores a search by matching each question token to its best document token. It is more precise than one summary vector, but it needs much more storage.

12 min readAdvancedOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

ColBERT keeps one small vector for each token in a document, roughly a word or part of one. When someone asks a question, each question token finds its best match in the document, and those scores add up. It is more precise than a single summary vector, and the document side can be prepared ahead of time. The cost is storage, so in a real system I would compress the vectors and use a fast first search to pick a short list.

What is ColBERT-style late interaction, in plain words?

Most AI search turns a whole document into one list of numbers, called an embedding. That list is quick to compare. But it has to carry everything in the document at once, so detail gets blurred. A contract can mention a 30-day notice period and an automatic renewal, and one summary list may only capture the general topic.

ColBERT keeps a list for every word piece instead. Its name stands for Contextualized Late Interaction over BERT. BERT is a language model that reads text in both directions. Late interaction means the question and the document are encoded separately, then compared word by word only at the end.

Think of a paralegal checking a contract against a client's question. She does not judge the whole contract by one feeling. She takes each key phrase in the question, finds the closest phrase in the contract, and adds up how well each one fitted. ColBERT does the same kind of matching, in numbers.

Here is a real case. A legal team has 40,000 supplier contracts and types: "Which contracts renew automatically with a notice period under 60 days?" A single-list search may return any contract that talks about renewals. A ColBERT-style search matches each word of the question to its closest word in each contract, so a contract that mentions both the notice period and the automatic renewal scores high. It does not check that the two sit in the same clause, so a lawyer still has to read the clause.

Key words

Embedding
A list of numbers, also called a vector, that stands for the meaning of a text.
Token
A word or part of a word. It is the unit a language model reads.
Multi-vector
Many vectors for one text, one per token, instead of one for the whole text.
MaxSim
For each question token, keep its best match in the document, then add those up.
Re-ranking
A slower second pass that puts a short list from a fast search into a better order.

How does ColBERT score a match?

A match is scored in four steps. The first step happens ahead of time, which is why search stays fast.

  1. 1

    Encode each document, ahead of time

    A BERT model turns every token in a document into its own vector. These vectors are saved in an index. This work is done once, before anyone asks a question.

  2. 2

    Encode the question

    The same model turns each token of the question into a vector. This happens at search time, once per question.

  3. 3

    Find each token's best match

    For each question vector, look across the document's vectors and keep the closest one. Closeness is a cosine score, a measure of how alike two lists of numbers are.

  4. 4

    Add up the best matches

    The sum is the document's score. The document with the highest sum ranks first.

How ColBERT scores one contract

Done ahead of time

Contract text

split into word pieces

Each question

Question

split into word pieces

BERT encoder

one vector per word piece

Two sets of vectors

Saved contract vectors

kept in an index

Question vectors

made for this search

Match and add

best match per word, summed

Score for this contract

higher means a closer match

  1. 1The contract is split into word pieces and encoded ahead of time.
  2. 2The question is split into word pieces and encoded at search time.
  3. 3The contract's vectors are saved in an index.
  4. 4The question's vectors are kept for this search.
  5. 5The saved contract vectors are compared with the question's vectors.
  6. 6Each question vector keeps only its best match.
  7. 7The summed score ranks this contract against the others.
The contract side is prepared ahead of time, so only the question is encoded during a search. Each question vector keeps its closest match, and the matches are summed into one score for that contract.

Here is a small, made-up run. Two-number vectors stand in for the real ones, so you can check the sums by hand.

Python
import math

def cos(a, b):
    dot = sum(x * y for x, y in zip(a, b))
    return dot / (math.sqrt(sum(x * x for x in a)) * math.sqrt(sum(y * y for y in b)))

# Made-up 2-number vectors. Real ColBERT vectors have many more numbers.
query = {"notice": [1.0, 0.1], "renewal": [0.2, 1.0]}
contract_a = {"30 days": [0.9, 0.2], "auto-renews": [0.1, 0.95], "signed": [0.5, 0.5]}
contract_b = {"fixed term": [0.9, 0.1], "12 months": [0.6, 0.1]}

def maxsim(query_vecs, doc_vecs):
    total = 0.0
    for word, qv in query_vecs.items():
        best = max(cos(qv, dv) for dv in doc_vecs.values())
        print(f"  {word}: best match {best:.2f}")
        total += best
    print(f"  total: {total:.2f}")
    return total

print("Contract A")
maxsim(query, contract_a)
print("Contract B")
maxsim(query, contract_b)

Output

Contract A
  notice: best match 0.99
  renewal: best match 1.00
  total: 1.99
Contract B
  notice: best match 1.00
  renewal: best match 0.35
  total: 1.35

Contract A wins, 1.99 against 1.35. Contract B matches notice well, but its best match for renewal is weak, so its total drops. Summing best matches means one strong word match cannot hide a missing one.

Why is it accurate, and what does it cost?

  • Reads pairs together

    Cross-encoder

    Feeds the question and one document through a big model together, once per pair. It is a strong scorer, but costly: the ColBERT paper says such rankers raise computational cost by orders of magnitude.

  • One summary list

    Single-vector search

    Fast, since each text is one list of numbers. But one list can blur fine detail, such as which word matched.

  • Token by token

    ColBERT

    Documents are prepared ahead of time, and scoring keeps word-level detail. The cost is storage: many vectors per document.

The ColBERT paper, from 2020, describes its interaction step as cheap yet powerful. Its own words:

  • “ColBERT introduces a late interaction architecture that independently encodes the query and the document using BERT and then employs a cheap yet powerful interaction step that models their fine-grained similarity.”

    ColBERT paper, 2020

  • “existing late interaction systems impose an order-of-magnitude larger space footprint than single-vector models, as they must store billions of small vectors for Web-scale collections.”

    ColBERTv2 paper, 2022

The 2020 paper also reports indexing speed. It could index about nine million passages from the MS MARCO collection in around three hours on one server with four GPUs. Treat that as a sense of scale, since hardware and data change fast.

How does ColBERT fit into a RAG system?

In RAG, which means retrieval-augmented generation, ColBERT can work as the second pass. A fast first search picks a short list of passages. ColBERT re-scores that list, and the best few go to the chat model that writes the answer.

ColBERT as the second pass in RAG

Staff question

asked in the contract tool

Fast first search

picks a short list of passages

ColBERT re-scores

orders the short list word by word

Best few passages

with contract name and page

Answer with sources

the chat model writes from these

  1. 1A staff member asks a question about the contracts.
  2. 2A fast search picks a short list of passages.
  3. 3ColBERT re-scores that list, comparing word by word.
  4. 4The best few passages go to the chat model, which writes the answer.
The fast search is cheap and broad. ColBERT is more careful per passage, so it only sees the short list. Only its best few passages reach the chat model.

PLAID, a 2022 engine, speeds up ColBERT search by dropping weak passages early, without hurting quality. Its job is speed: it drops weak passages early, so search runs faster at the same quality.

Tip

Asked how you would add ColBERT? Say you keep a fast first search for coverage, let ColBERT re-rank a short list, and measure both on your own questions before you ship.

How would you add ColBERT to a 40,000-contract search?

The legal team needs answers like the one in the plain-words section. The stakes are real: a missed automatic renewal can lock the company into another year of payments.

  1. 1

    Index with clause positions

    Store each token vector with its contract ID and clause position, so every hit points to the exact clause a lawyer can open.

  2. 2

    Keep a fast first pass

    A vector search picks a short list of clauses for each question. ColBERT never reads all 40,000 contracts for one question.

  3. 3

    Re-score and show the source

    ColBERT re-scores the short list, and the screen shows the contract name and the clause text, so a lawyer can check each answer.

  4. 4

    Budget the storage first

    A vector for every token across 40,000 contracts is a lot of data. Compress the vectors and size the disks before buying anything.

  5. 5

    Measure on real questions

    Collect 100 real questions with known answers. Check that the right clause makes the short list, then that it ranks at the top.

Tip

Keep a fast first pass in front of ColBERT. Without it, every question scores every token of every contract, which is slow and costly.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: one vector per token, scored by matching each question token to its best document token.
  • The name: late interaction, because the two sides meet only at scoring time.
  • Why it is accurate: word-level detail is kept, so single words and phrases can match.
  • The cost: much more storage, and why compression and a first-stage search matter.
  • Where it fits: usually as a re-ranker after a fast search in a RAG system.
  • Honest limits: it needs an index engine, and you measure it on your own data.

Common traps

  • Trap"ColBERT is just a faster BERT."

    BetterIt is a different way to score. Each side is encoded on its own, then tokens are matched late, which is why documents can be prepared ahead of time.

  • Trap"It is always better than a cross-encoder."

    BetterAccuracy depends on your data. Test it on your own questions, then compare it with the other options you could use.

  • Trap"Storage is free because the work is done offline."

    BetterOffline work saves time at search, but the vectors still take disk and memory. Plan for them and compress them.

Can you spot the weak design?

Spot the problem

A team plans to search 2 million help articles with ColBERT. Which step is wrong?

Quick check

Your ColBERT index for 40,000 contracts is too big for the server. What is the best first move?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q131Retrieval metrics: recall@k, MRR, nDCG?12 min
  2. Q134How do you reduce hallucinations in RAG?13 min
  3. Q141What is contextual retrieval?13 min
  4. Q146How do you pick top-k?11 min
  5. Q112Walk through a RAG pipeline end to end.12 min
  6. Q142What is parent-child (small-to-big) retrieval?11 min

Last updated on 27 November 2026

Building search over thousands of documents?

I design and build AI search and agents, including the retrieval layer and how it is tested. Book a short call and tell me what your documents and questions look like.