Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

Learned sparse (SPLADE)

From: How RAG Finds Things

A neural model reads a short text and predicts which vocabulary terms should represent it, and how strongly, including synonyms never literally written. It matches meaning like a dense model while staying in a fast, invertible sparse index like BM25.

Learned sparse: the words it adds for youinteractive
text:return a defective laptopBM25: only literal terms
laptop
1.00
return
0.90
defective
0.85
device
added
computer
added
warranty
added
broken
added
refund
added

BM25 indexes only the words literally present. A search for “broken device” finds nothing, because those tokens are absent.

Late interaction (ColBERT / MaxSim)

From: How RAG Finds Things

Instead of crushing a passage into one vector, keep an embedding per token. Each query word finds its single best-matching word on the page, and those best matches are summed. Watch the MaxSim score build up word by word.

Late interaction: each word finds its best matchinteractive
query wordsdocument wordsreturn0.92defectivelaptopcompanylaptopswithdefectsmustbereturnedin30daysMaxSim so far0.92

The query word "return" looks across every word on the page and keeps only its single best match, "returned" at 0.92.

Contextual retrieval

From: How RAG Finds Things

A chunk torn out of its document loses the context that made it findable. Contextual retrieval prepends a short generated blurb before embedding, so the indexed chunk names its own company, year, and topic and is found for the right reasons.

Contextual retrieval: staple the caption back oninteractive
query:Acme 2024 unemployment rate
the chunk you index:
From Acme Corp's 2024 annual report, unemployment section:
The rate rose to 4 percent.
MISSwhich rate? which year? which company? the chunk cannot say

On its own the chunk is an orphan. Its embedding is ambiguous, so the query that should find it does not.

Visualizers — Sachin Gupta