feature-extraction · sentence-similarity · text · WASM q8 · 110.15 MB

Snowflake Arctic Embed M v1.5 — 768-d / 256-d Matryoshka Workbench

Run Snowflake/snowflake-arctic-embed-m-v1.5 (Apache-2.0, 109M params, 55.14 MTEB Retrieval NDCG@10) locally in your browser via CPU WASM q8. Built with Matryoshka Representation Learning (MRL) and CLS pooling so you can slice 768-d vectors down to 256-d (3× smaller) while retaining 99% of retrieval quality.

At a glance

Model (Upstream & ONNX) Snowflake/snowflake-arctic-embed-m-v1.5
Task / pipeline feature-extraction (HF tag: sentence-similarity · pooling: "cls", normalize: true)
Architecture BertModel · 109M params · 12 layers · 12 heads · hidden_size: 768 · MRL [256] · 512 max tokens · 30,522 WordPiece vocab
Asymmetric prompt Queries use "Represent this sentence for searching relevant passages: "; passages remain unprefixed
Quantization & size q8 WASM ONNX (onnx/model_quantized.onnx = 110,145,162 bytes = 110.15 MB)
Backend CPU WebAssembly (wasm) via shared lib/webai.js (@huggingface/transformers@3.7.5 — no WebGPU required)
License & MTEB Apache-2.0 · 55.14 MTEB Retrieval NDCG@10 (54.2 at 256-d int8 · 53.7 at 256-d int4)
Matryoshka + CLS pooling: Unlike generic mean-pooled BERT checkpoints, Arctic Embed M v1.5 reads token 0 ([CLS], ID 101) and concentrates coarse retrieval signal in the first 256 dimensions. Flip the live 768-d vs 256-d MRL switch below to score the exact same passages at 3× lower vector memory without re-running inference.

1. Client-Side Retrieval & Matryoshka Semantic Workbench

    2. See inside: 2D PCA Constellation & 768-d CLS Vector

    2D PCA Semantic Constellation

    Run inference above to project passages and query into 2D PCA space.

    Active Query Vector & Matryoshka 256-d Cutoff

    3. Why it matters & what you can build

    4. How the API works & Show the code

    All inference runs inside a dedicated module Web Worker via shared ../../lib/webai.js (@huggingface/transformers@3.7.5 — CPU WASM q8) with strict FIFO queueing and epoch-safe disposal.

    Show the code: CLS-pooled feature-extraction forward pass (worker.js)
    Show the code: Matryoshka MRL prefix truncation + L2 renormalization (arctic-m-core.mjs)

    5. References