Compare multi-vector passage ranking with single-vector search while accounting for storage, candidate pruning and token-level false matches.
Late-interaction retrieval: score token matches without one-vector blur
Keep token evidence visible
A single vector compresses a whole passage into one representation. Late-interaction ranking keeps multiple token vectors for the query and passage, then combines their best token-level matches. This can preserve a rare part number alongside broad topic words. It is a ranking signal, not a proof that a passage answers the question: matching 'P-47', 'pressure' and 'limit' in separate sentences could still miss the requested limit. Claim support must inspect the actual text after ranking.
Separate candidate generation from scoring
Scoring every passage token against every query token is expensive. First build a candidate set with lexical or approximate vector search, apply tenant and revision filters, then run token-level scoring on a bounded window. If the correct passage never enters that window, late interaction cannot rescue it. Filtered candidate recall and reranker window size should be measured before debating score formulas.
Explain the aggregation
One simple late-interaction score takes each query token's best similarity to any passage token and sums those maxima. It rewards coverage of query terms while allowing different passage tokens to satisfy them. Normalize or calibrate for query length when comparing across questions; within one query, ranking scores can be compared directly. Stop words, duplicated tokens and template boilerplate can distort results. A document containing twenty copies of a part label should not gain twenty independent votes from one query term.
Budget memory and CPU
Multi-vector passages consume more index space than a single vector per passage. Token pruning, low-precision storage and candidate caps reduce cost, but each can reduce recall. Measure bytes per passage, index build time, p95 query latency and judged passage recall together. Keep encoder version and tokenization version on the index; a query encoded with a different vocabulary or model revision can change rankings without any corpus update. Embedding migrations need paired tests.
Test the hard queries
Include near-identical part numbers, terms scattered across unrelated sections, long passages, short passages and one genuinely absent answer. Report candidate recall, rank after late interaction, and final support separately. A high ranking score for a passage with all query words but no answer is an expected failure mode to catch, not a reason to weaken the citation check.
Worked contract
from math import sqrt
def cosine(left: tuple[float, ...], right: tuple[float, ...]) -> float:
numerator = sum(a * b for a, b in zip(left, right, strict=True))
left_norm = sqrt(sum(value * value for value in left))
right_norm = sqrt(sum(value * value for value in right))
if not left_norm or not right_norm:
raise ValueError("zero-length token vector")
return numerator / (left_norm * right_norm)
def token_coverage(query_tokens: list[tuple[float, ...]],
passage_tokens: list[tuple[float, ...]]) -> float:
if not query_tokens or not passage_tokens:
raise ValueError("empty token sequence")
return sum(max(cosine(query, passage) for passage in passage_tokens)
for query in query_tokens)
pressure_query = [(1.0, 0.0), (0.0, 1.0)]
complete_passage = [(1.0, 0.0), (0.0, 1.0)]
partial_passage = [(1.0, 0.0), (1.0, 0.0)]
assert token_coverage(pressure_query, complete_passage) == 2.0
assert token_coverage(pressure_query, partial_passage) == 1.0Performance and operating cost
For Q query tokens, P passage tokens and D vector dimensions, direct scoring costs O(QPD) time and O(1) extra space beyond the vectors. For C candidates, multiply that work by C. Index storage grows with passage token count rather than passage count alone, so use a candidate stage and measure the cost of any compression or token pruning.
Common Mistakes
- Running token-level scoring over the entire corpus without a candidate bound.
- Treating token coverage as proof that the passage states the requested fact.
- Mixing encoder or tokenizer revisions between query and index.
- Ignoring storage growth when comparing against a single-vector baseline.
Validation drill
Judge 49 part-number questions with close distractors. Compare a single-vector baseline and a bounded token-level reranker on candidate recall, supported top-one answers, index bytes and p95 latency.
