Basics · CLS Dot-Product Ablation, Norm Magnitude & 512-Token MPNet Ceiling

Inside multi-qa-mpnet-base-dot-v1: cls dot-product vs mean & cosine

1_Pooling/config.json selects pooling_mode_cls_token: true and pooling_mode_mean_tokens: false with un-normalized dot-product scoring. Compare all 4 pooling/normalization modes live, inspect pre-norm vector lengths (‖v‖), and audit token retention across the 512-token MPNet ceiling.

Model status

A · Live cls vs mean pooling & normalize ablation

SentenceTransformers trained multi-qa-mpnet-base-dot-v1 with pooling: "cls" and normalize: false. Compare un-normalized dot-product margins against L2-normalized cosine margins and watch how raw ‖v‖ norms differ between <s> ([CLS]) and token averages.

CLS vs mean pooling and L2 normalization ablation table
Pooling · Normalize dot(Q, Pos) dot(Q, Dist) Active margin cos(Q, Pos) |dot − cos| ‖Q‖ / ‖Pos‖ norm
Initialise multi-qa-mpnet-base-dot-v1 above to run the 4-mode pooling ablation.

B · Magnitude & specificity probe: why dot product ≠ cosine

Because q · d = ‖q‖ · ‖d‖ · cos(θ), two candidates with similar cosine alignment can separate sharply under dot product when their ‖d‖ vector norms differ. Compare dot rank vs cosine rank live.

Live CLS dot product vs cosine similarity and L2 norm comparison
Candidate Role Dot (q · d) Cosine ‖d‖ L2 norm Text
Run a magnitude preset to compare live dot product, cosine, and L2 norm.

C · 512-token MPNet ceiling (128 → 512 tokens)

Adjust how many telemetry filler blocks precede the answer needle, then score across 128, 256, 384, and 512 token budgets. Unlike 256-capped MiniLM models, multi-qa-mpnet-base-dot-v1 retains full signal up to 512 content tokens (max_position_embeddings: 514).

Live CLS dot product and cosine score across 128, 256, 384, and 512 token budgets
Budget cap Full doc tokens Kept tokens dot(Q, Doc) cos(Q, Doc) Note
Click Audit 128 → 512 budgets to measure MPNet token retention.

Show the code

Show the code: MPNet WordPiece token budget slicing up to 512 tokens (worker.js)
Show the code: un-normalized dot product vs cosine & norm comparator (multi-qa-mpnet-core.mjs)