sentence-similarity · text · WASM q8 · 110.80 MB · 768-d CLS dot-product · Apache-2.0

multi-qa-mpnet-base-dot-v1 — 768-d QA dot-product studio

Trained on 215M (question, answer) pairs over a 12-layer MPNet backbone: pools the <s> ([CLS]) representation without L2 normalization so un-normalized dot product (q · d) captures both semantic direction and vector magnitude inside a 512-token window.

At a glance

Model card metadata, architecture, pooling contract, token limits, and runtime
Upstream model sentence-transformers/multi-qa-mpnet-base-dot-v1
Browser ONNX build Xenova/multi-qa-mpnet-base-dot-v1 · onnx/model_quantized.onnx
Task / pipeline sentence-similarity via pipeline("feature-extraction", …, { device: "wasm", dtype: "q8" }) with { pooling: "cls", normalize: false } (1_Pooling/config.json: pooling_mode_cls_token: true) → 768-d un-normalized dot-product vector
Architecture MPNetForMaskedLM (mpnet) · 12 layers · 12 heads · 768 hidden · 3,072 FFN · 109.5M params · 30,527 WordPiece vocab (<s>=0, <pad>=1, </s>=2)
Sequence limits 512 content tokens (model_max_length: 512, max_position_embeddings: 514)
Quantisation & download q8 · 110.09 MB ONNX (110,086,121 B) + 0.71 MB tokenizer (710,944 B) + configs (957 B) = 110.80 MB decimal total
Backend & runtime CPU WebAssembly (wasm) via shared ../../lib/webai.js (Transformers.js 3.7.5) inside a dedicated Web Worker
License Apache-2.0

1. Live CLS dot-product QA retrieval & norm comparison

Unlike cosine-normalized SentenceTransformers, multi-qa-mpnet-base-dot-v1 keeps raw [CLS] (<s>) magnitudes (‖v‖ > 1) and ranks answers by un-normalized dot product q · d = ‖q‖ · ‖d‖ · cos(θ). Inspect both q · d and cos(q, d) alongside answer L2 norms below.
Or drag & drop a file or paste candidate answer lines outside text boxes.
Question-vs-answer CLS dot-product ranking and cosine comparison
Rank Answer passage Dot (q · d) Cosine ‖d‖ norm MPNet tok
Initialise multi-qa-mpnet-base-dot-v1 above to compute live 768-d CLS dot-product embeddings.

2. See inside: pairwise dot-product matrix, 2-D PCA & MPNet tokens

Left: N×N pairwise un-normalized dot-product matrix (diagonal = ‖d‖², highlighting norm differences). Right: deterministic 2-D PCA projection showing the question (★) and dashed rays to its Top-3 answers.

Pairwise dot-product matrix (q · d)

2-D PCA 768-d QA space

Query MPNet WordPiece tokenization (30,527-token vocab, <s>=0, </s>=2)

Run inference to inspect <s>, WordPiece subwords (##), and </s> tokens.

Why multi-qa-mpnet-base-dot-v1 matters

Use-case ladder

How the API works

import { pipeline } from "@huggingface/transformers";

const extractor = await pipeline("feature-extraction", "Xenova/multi-qa-mpnet-base-dot-v1", {
  device: "wasm",
  dtype: "q8",
});

// Exact SentenceTransformers 1_Pooling/config.json contract: CLS pooling + normalize: false
const out = await extractor(["How many people live in London?", "Around 9 million people live in London."], {
  pooling: "cls",
  normalize: false,
});
// out.dims = [2, 768]; score = un-normalized dot product sum(q[i] * d[i])

Show the code

Show the code: epoch-safe pipeline("feature-extraction", "Xenova/multi-qa-mpnet-base-dot-v1") loader (worker.js)
Show the code: N×N pairwise un-normalized dot-product matrix (multi-qa-mpnet-core.mjs)
Show the code: deterministic 768-d → 2-D PCA projection (multi-qa-mpnet-core.mjs)

References