late-interaction retrieval · text · WASM · ~133 MB
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.
| Model | answerai-colbert-small-v1 — a compact BERT-based ColBERT |
|---|---|
| Task | late-interaction retrieval (feature-extraction + MaxSim) — run via raw ONNX Runtime Web (see note below) |
| Runtime | onnxruntime-web 1.21 (transformers.js has no ColBERT task) + a transformers.js tokenizer |
| Input | a query (marked [Q]) and a document (marked [D]) |
| Output | a 96-d L2-normalised vector per token → MaxSim score + the per-query-token alignment |
| Quantization | fp32 ONNX (the projected export) — runs on the plain WASM backend, no WebGPU needed |
| Download | ~133 MB, cached after first load (auto-inits on return) |
| License | Apache-2.0 (Answer.AI) |
| Web APIs | WebAssembly, Web Workers — all Baseline widely available |
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.