# Bring your own context: 20-persona benchmark (2026-11-18)

Tests the two client-side matchers behind [For you](https://zidingz.com/for-you/) and [Bring your own context](https://zidingz.com/ideas/bring-your-own-context/):

- **Shared words (`src/lib/terms.mjs` over `/compendium.json`):** TF-IDF cosine over top-80 words per piece, no network download beyond the 70 KB site index.
- **Meaning (`src/lib/meaning.mjs` over `/embeddings.json`):** 8-bit `Xenova/all-MiniLM-L6-v2` (384 dims, `FLOOR = 0.22`), comparing each visitor sentence against `0.5 * head + 0.5 * body` vectors inside the browser.

## Files

- `personas.json`: 20 hand-written reader descriptions frozen before scoring—8 everyday paraphrases avoiding post jargon (`zero_jargon`), 8 technical or multi-interest agent bios (`technical`), and 4 out-of-domain readers (`negative`) for whom the site has nothing relevant.
- `score.mjs`: runs the exact production `match()` and `rank()` functions against `dist/compendium.json` and `dist/embeddings.json` (excluding `/matching-reader-context-in-the-browser/` to prevent benchmark write-up terms from leaking into the scored corpus).
- `summary.json`: per-persona top-3 hits, scores, and aggregate counts across 71 pieces.

## Results (71 pieces)

| Metric | Shared words (`/compendium.json`) | Meaning (`all-MiniLM-L6-v2`, `FLOOR = 0.22`) |
|---|---|---|
| Positive Top-1 (`16` descriptions) | `12 / 16` | `14 / 16` |
| Positive Hit@3 (`16` descriptions) | `14 / 16` | `16 / 16` |
| Zero-jargon Top-1 / Hit@3 (`8`) | `5 / 8` · `7 / 8` | `7 / 8` · `8 / 8` |
| Technical Top-1 / Hit@3 (`8`) | `7 / 8` · `7 / 8` | `7 / 8` · `8 / 8` |
| Unrelated negatives returning false hits (`4`) | `4 / 4` | `1 / 4` (`0.2231`) |

## Main findings

1. **Word matching has no floor.** Because `terms.mjs` accepts any `score > 0`, every unrelated reader got 3–6 false recommendations on single incidental words (`"bulk"` matched correlation traps, `"propeller"` matched aircraft audio, `"schedule"` matched the ideas feed, `"division"` matched the front-page note).
2. **Embeddings closed the vocabulary gap and suppressed 3 of 4 negatives.** Meaning found all 16 positive targets within the top 3, rescuing descriptions that shared no topical words (`p07_chatty_slack_bots`, `p13_sycophancy_vs_reason`), while staying empty on 3 of 4 unrelated bios. One negative (`n20_volleyball_recruiting`) cleared `FLOOR = 0.22` at `0.2231`; the lowest true-positive Top-1 score was `0.3034`.
3. **Exact terminology still helps word matching.** On `p11_portable_user_models_hci`, shared words ranked `/walkable-mind-five-ways-to-arrange-notes/` first (`spatial`, `portable`, `json`, `local`), whereas meaning placed the June robot essay `0.0004` ahead (`0.4115` vs `0.4111`).

Licence: CC BY 4.0. Credits: benchmark and analysis by Gemini (Google DeepMind) for Ziding Zhang.
