Skip to content

multi-model · 2 Web Workers · 37.6 MB total Stage 1 ALBERT (13.7 MB int8) → Stage 2 MS MARCO (23.9 MB q8) Both Apache-2.0 WASM

2-Stage Retrieve → Rerank (ALBERT Bi-Encoder → MS MARCO Cross-Encoder)

Stage 1 embeds the query and full passage corpus into 768-d vectors using Xenova/paraphrase-albert-small-v2 (13.7 MB int8) to retrieve a Top-K shortlist fast. Stage 2 hands that shortlist to the already-built MS MARCO MiniLM-L-6-v2 cross-encoder (Xenova/ms-marco-MiniLM-L-6-v2, 23.9 MB q8) to read each (query, passage) pair jointly and lift true answers above keyword traps.

Two-Stage Workflow Models (37.6 MB total)

Stage 1 · paraphrase-albert-small-v2 Retriever (13.7 MB int8)

Runs ../worker.js — Xenova/paraphrase-albert-small-v2, 6-layer parameter-shared ALBERT 768-d bi-encoder (Apache-2.0, CPU WASM int8).

Stage 2 · MS MARCO MiniLM-L-6-v2 Cross-Encoder (23.9 MB q8)

Reuses ../../ms-marco-reranker/worker.js — Xenova/ms-marco-MiniLM-L-6-v2, 6-layer cross-encoder emitting raw relevance logits (Apache-2.0, CPU WASM q8).

Retrieve-then-Rerank Funnel

Use the Workflow Pack bar above to download both models (37.6 MB total) or let cached weights auto-initialise.

Stage 1 (ALBERT)–
Stage 2 (MS MARCO)–
Stage 1 MRR–
Stage 2 MRR–
Top-1 Hit (S1 → S2)–
Kendall τ (S1 ↔ S2)–
Non-finite–

Rank-Shift Slopegraph (Stage 1 → Stage 2)

Green = Relevant · Red = Demoted trap

Stage 1 · Full Corpus Cosine Recall

Top-K highlighted for Stage 2
Stage 2 cross-encoder reranked shortlist (sorted by raw MS MARCO relevance logit)
S2 Rank Shift ID & Role S1 Cosine (#Rank) S2 Logit (Prob) Lexical Passage

See inside — bi-encoder retrieval + cross-encoder reranking

Stage 1 encodes all corpus passages independently into 768-d vectors in a single batch so cosine lookup scales to hundreds of documents. Stage 2 reads only the Top-K shortlist as joint [CLS] query [SEP] passage [SEP] pairs with full cross-attention, catching negation exclusions and lexical decoys that independent embeddings miss.

Show the code — Stage 1 shortlist + Stage 2 logit fusion & MRR metrics
Show the code — Stage 2 MS MARCO cross-encoder pair scoring