100% browser-side inference · No paid compute

Fast retrieval.
Precise reranking.

A two-stage Transformer ranking system using a MiniLM bi-encoder for semantic candidate retrieval and an MS MARCO MiniLM cross-encoder for query-document reranking.

Stage 1 MiniLM bi-encoder
Stage 2 MS MARCO reranker
Runtime Transformers.js + ONNX
Hosting Hugging Face Static Space
Interactive search laboratory

Compare retrieval and reranking

Models not loaded
First-run download: the browser downloads quantized ONNX model files from Hugging Face. This can take a minute depending on your connection. Files are cached by the browser for faster later searches.
01

Configure the search

Select a labelled example or enter your own query.

Search mode
Architecture

Why use two ranking stages?

01

Independent embeddings

The bi-encoder embeds documents once and embeds each query independently. This makes candidate search efficient and reusable.

02

Joint pair scoring

The cross-encoder reads the query and document together, enabling richer token-level interaction and more precise relevance scoring.

03

Practical tradeoff

The slower model evaluates only the top candidate set, preserving interactive latency while improving the final order.

Metric guide

How ranking quality is measured

Live values for the currently selected query are displayed in the results section above. The cards below explain each measure, while the verified BEIR section reports aggregate performance across hundreds of held-out benchmark queries.

Verified offline evaluation

Recall@K

Measures whether known relevant documents entered the candidate set. A reranker cannot recover a document that was never retrieved.

MRR@10

Rewards systems that place the first relevant result as early as possible in the first ten positions.

nDCG@10

Uses graded relevance and penalizes useful documents that appear lower in the ranked list.

Latency

Separates model loading, document indexing, query embedding, retrieval, reranking, and total search time.

Verified BEIR benchmark

Aggregate ranking evidence

These fixed values were generated offline with the Python evaluation pipeline. They are separate from the live query-specific metrics shown above.

queries documents bootstrap samples
Loading verified benchmark results…
Responsible use

Human review remains essential

This project is an educational portfolio demonstration. Rankings may be incomplete, biased, irrelevant, or misleading. Cross-encoder outputs are relevance estimates—not factual guarantees or calibrated probabilities.

Do not upload confidential, proprietary, copyrighted, sensitive, or personally identifiable content. Do not use this demo as the sole basis for hiring, rejection, compensation, promotion, immigration, legal, or employment decisions.