1 Β· Topic map with a live query compass
Every document is embedded with the required search_document: prefix, your query with
search_query: . The 768-d vectors (optionally Matryoshka-truncated) are projected onto their
top two principal components; rays connect the query star to its nearest documents by real cosine.
The model initialises above; the map is drawn as soon as it is ready.
Click a node to inspect it. Keyboard: focus the map, then β/β (or β/β) step through documents, Home/End jump, Enter fires the compass from the selected document, Escape returns to the query compass.
No document selected yet.
Selected document
Compass rays
2 Β· Needle in a long document
One relevant sentence (the needle) is inserted into an otherwise unrelated long document at different depths. Each variant is embedded twice: once with ModernBERT's long context (up to the cap you choose) and once clipped at 512 tokens, the way every original-BERT embedder is forced to read. A needle-free copy gives the baseline.
Choose a document and run the sweep. Each long variant takes a few seconds on a single WASM thread.
| Needle at | Sentence # | β Token pos | Doc tokens | Full read | cos full | Ξ vs base | cos 512-clip | Ξ vs base | 512-clip sees needle? |
|---|---|---|---|---|---|---|---|---|---|
| Run the sweep to fill this table with live measurements. | |||||||||
ββ Token posβ is a proportional estimate (needle character offset Γ real token count). β512-clip sees needle?β is measured, not estimated: when the needle sits past the horizon, the clipped embedding is bit-for-bit identical to the needle-free baseline.
Why this is wild
- Dilution is real and visible. One sentence is a small share of a long mean-pooled vector, so the lift is modest and depends on position and length β the chart shows exactly how much, live.
- Matryoshka maps. Switch the map to 64-d and watch whether the clusters survive a 12Γ smaller index β no re-embedding, just a slice and a re-normalise.
- Private by construction. Every vector here is computed on your CPU in a Web Worker; no document leaves the page.