Live reranking demo
Paste a query and candidate passages. A cross-encoder scores every pair; a bi-encoder proxy (token overlap) shows why independent embeddings mis-order. Compare two models, share a link, or enable WebGPU for faster inference.
See the effect before you download anything
This example needs no model — the left column is the real output of the token-overlap heuristic used elsewhere on this page. The interactive demo below scores your own text with an actual cross-encoder.
Query: “How do I add a reranking step to my RAG pipeline?”
The left column runs live in your browser right now — zero downloads, deterministic token-overlap math, the same code the interactive demo uses for its middle column. The right column is the order a working cross-encoder is expected to produce for this query, checked by reading rather than captured from a model run on this page; load the model below to see its own scores on this exact example.
Model comparison
Aligned diff — same passage, two models
| # | Passage | Δ score | Δ rank |
|---|
Privacy & cost: everything here runs locally with transformers.js on ONNX Runtime Web. Your query and passages never leave the browser, there’s no API key, and there’s no per-call cost — which is exactly why this page can be free and abuse-proof.
How this demo works
The model is a cross-encoder: instead of embedding the query and each passage separately, it feeds the pair (query, passage) through the network together and outputs a single relevance score. The middle column shows a bi-encoder proxy (token overlap only) so you can see why cosine-style retrieval often mis-orders before reranking.
- Your query is paired with every candidate passage.
- Each pair is tokenised and run through the cross-encoder.
- The output logit is squashed to a 0–1 relevance score.
- Passages are sorted by score; compare against the bi-encoder proxy column.
That’s the same operation you’d run as the second stage of a RAG pipeline — only here it happens in a browser tab instead of behind an API.
Tips: use Enter in the query field to run, Ctrl+Enter in the passages box, Esc to clear. Copy the share link to send your exact query to a colleague. Enable model comparison to see how jina-tiny and mxbai-xsmall disagree on edge cases.