Basics Β· Asymmetric Query–Passage Geometry, Mean vs CLS Pooling & L2 Norm Sensitivity

Asymmetric Retrieval, Pooling & Norm Sensitivity

sentence-transformers/msmarco-distilbert-base-v4 maps short queries near long relevant passages using mean pooling (1_Pooling/config.json) and L2 normalization across 768 dimensions. Run the 3-condition ablation below to see why unnormalized dot products skew across passage lengths and why un-tuned [CLS] embeddings lose retrieval margin.

1. Load Model & Asymmetric Ablation Pack

2. Live Pooling, Norm & Asymmetry Telemetry

Official: Mean Pooling + L2 Norm (Cosine)

Run ablation to score with Mean pooling + L2 norm.

    Ablation: Unnormalized Mean (Raw Dot) vs [CLS]

    Run ablation to compare unnormalized dot product and [CLS] pooling.

      3-Condition Separation Margin Chart

      Per-Passage Norm, Length & Drift Table

      Per-passage token count, unnormalized L2 norm, Mean+L2 cosine, Mean-Raw dot, and CLS+L2 cosine
      ID Role Tokens Raw β€–vβ€– Mean+L2 cos Mean-Raw dot CLS+L2 cos
      Run ablation above to compare pooling and norm sensitivity live.

      Show the Code

      Show the code: Worker embed() supporting Mean/CLS pooling and normalize toggle (worker.js)
      Show the code: Relevant vs distractor separation margin math (msmarco-core.mjs)