← All models

learned sparse retrieval · text · WASM · ~532 MB

Learned sparse retrieval (SPLADE)

The built embedding models turn text into a dense vector of opaque numbers. SPLADE does something different: it produces a sparse vector — a weight per word in the vocabulary, mostly zero — and it expands the text with related terms it never contained ("pasta" also lights up "noodles", "italy", "food"). That's how neural lexical search matches meaning while staying an interpretable, invertible index. Encode a sentence, then match a second one. Runs on your device.

At a glance

ModelSplade_PP_en_v1 — a SPLADE++ sparse encoder (BERT MLM head)
Tasklearned sparse retrieval (feature-extraction) — run via raw ONNX Runtime Web (see note below)
Runtimeonnxruntime-web 1.21 (transformers.js has no SPLADE task) + a transformers.js tokenizer
Inputtext → input_ids / attention_mask / token_type_ids
OutputMLM logits → SPLADE pool maxi log(1 + relu(logits)) → a sparse weight per vocabulary term
Quantizationfp32 ONNX — runs on the plain WASM backend, no WebGPU needed
Download~532 MB, cached after first load (auto-inits on return)
LicenseApache-2.0 (Splade_PP_en_v1) — the weights stay Apache-2.0 wherever exported
Web APIsWebAssembly, Web Workers — all Baseline widely available

Encode & expand

term in the text expansion + (added by the model)

Match a second text

SPLADE relevance = the sparse dot-product of the two weighted-term vectors.

Why raw ONNX Runtime Web?

transformers.js has no SPLADE task, so we run the masked-LM ONNX directly with onnxruntime-web and tokenize with a transformers.js tokenizer. SPLADE reads the model's word-prediction logits at every position and keeps, for each vocabulary word, its strongest log(1 + relu) score — a sparse vector where a handful of words carry weight, including words the text implies but never wrote. Two texts are relevant when their sparse vectors overlap. Everything runs on your device.