Basics · Inside Snowflake Arctic Embed XS · 22.97 MB q8 WASM

CLS vs Mean Pooling & Query Prefix 2×2 Ablation

Most BERT tutorials default to mean pooling without a query prefix. Snowflake trained Arctic Embed XS with CLS pooling plus an asymmetric retrieval prompt — run all 4 real on-device configurations (CLS vs Mean × Prefix vs No Prefix) on the same corpus and measure what each choice actually does to the retrieval margin. Nothing here is precomputed: the winner can differ from corpus to corpus.

1. Local model status

Checking browser cache for Snowflake/snowflake-arctic-embed-xs (22.97 MB q8 WASM)…

2. Configure query & passages

Scoring rule: The first passages are treated as relevant (relIndices = passages.length >= 3 ? [0, 1] : [0]), and the remaining passages act as distractors. Retrieval margin = mean(relevant cos) − mean(distractor cos). Watch the absolute scores too: dropping the query prefix typically inflates every cosine (relevant and distractor alike), while the official CLS + prefix setting is the one Snowflake evaluated on MTEB (50.15 NDCG@10). On a small toy corpus a mismatched setting can tie or even edge ahead — that is a real measurement, not a bug.
2 by 2 pooling and query prefix ablation metrics for Snowflake Arctic Embed XS
Configuration Mean Relevant Mean Distractor Margin (Δ) Top-1 Hit Latency

3. Interactive N×N cosine heatmap

Run the 2×2 ablation, then click any heatmap cell or press arrow keys while focused on the canvas to inspect a pair.

4. Exact implementation

Show the code — worker.js CLS / Mean pooling forward pass
Show the code — arctic-core.mjs 2-passage-safe margin calculation