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.
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.