← All models

late-interaction retrieval · text · WASM · ~133 MB

Late-interaction retrieval (ColBERT)

The built dense embeddings compress a whole text into one vector; SPLADE makes a sparse bag of weighted words. ColBERT is the third way: it keeps a small vector for every token and scores a query against a document with MaxSim — each query word takes its best match among the document's words, and the matches are summed. The payoff is interpretability: you can see exactly which document word each query word latched onto. Runs entirely on your device.

At a glance

Modelanswerai-colbert-small-v1 — a compact BERT-based ColBERT
Tasklate-interaction retrieval (feature-extraction + MaxSim) — run via raw ONNX Runtime Web (see note below)
Runtimeonnxruntime-web 1.21 (transformers.js has no ColBERT task) + a transformers.js tokenizer
Inputa query (marked [Q]) and a document (marked [D])
Outputa 96-d L2-normalised vector per token → MaxSim score + the per-query-token alignment
Quantizationfp32 ONNX (the projected export) — runs on the plain WASM backend, no WebGPU needed
Download~133 MB, cached after first load (auto-inits on return)
LicenseApache-2.0 (Answer.AI)
Web APIsWebAssembly, Web Workers — all Baseline widely available

Match a query to a document

Which document word each query word matched

Why raw ONNX Runtime Web?

transformers.js has no ColBERT task, so we run the projected ONNX export directly with onnxruntime-web and tokenize with a transformers.js tokenizer. Each token becomes a 96-dimensional unit vector; MaxSim pairs every query token with its most similar document token and sums those similarities. Unlike a dense embedding — a single opaque vector — every contribution is traceable to a word, which is why late interaction is prized for high-recall, explainable search. (This demo uses a simplified query encoding without ColBERT's [MASK] augmentation; the token alignment it shows is genuine.) Everything runs on your device.