feature-extraction · sentence-similarity · 100 languages · WASM q8 · 578.85 MB

Multilingual E5 Large — 100-Language 1024-d Meaning Space

Run intfloat/multilingual-e5-large (ONNX: Xenova/multilingual-e5-large, MIT, 24-layer XLMRobertaModel) locally in your browser via CPU WASM q8. Maps text across 100 languages into a single 1,024-dimensional L2-normalized mean-pooled space using E5's asymmetric "query: " and "passage: " prefixes — zero server calls.

At a glance

Upstream & ONNX intfloat/multilingual-e5-large → Xenova/multilingual-e5-large
Task / pipeline feature-extraction (HF tag: sentence-similarity · pooling: "mean", normalize: true)
Architecture XLMRobertaModel · 24 layers · 16 heads · hidden_size: 1024 · 4,096 FFN · 514 max_position_embeddings (512 usable tokens) · 250,002 SentencePiece Unigram vocab
E5 prefix protocol Every input starts with "query: " (queries / symmetric STS) or "passage: " (documents to retrieve)
Quantization & size q8 WASM ONNX (onnx/model_quantized.onnx = 561,768,762 B / 561.77 MB + tokenizer.json 17.08 MB + configs 1,210 B = 578.85 MB)
Backend CPU WebAssembly (wasm) via shared ../../lib/webai.js (@huggingface/transformers@3.7.5 — no WebGPU required)
License & browser APIs MIT · Web Workers, WebAssembly, Cache Storage, Canvas 2D (Baseline Widely Available)
Asymmetric prefixes + 1,024-d mean pooling: Initialized from xlm-roberta-large and contrastively trained on ~1B multilingual pairs plus supervised retrieval datasets, multilingual-e5-large averages non-padding token states (pooling: "mean") and L2-normalizes to 1,024 unit floats. Toggle the E5 "query: " / "passage: " prefixes below to inspect how asymmetric framing shifts cosine separation across scripts.

1. Cross-Lingual 1024-d Retrieval Workbench

    2. See inside: 2D PCA Constellation, 1024-d Vector & Cosine Matrix

    2D PCA Semantic Constellation

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

    Active Query 1024-d Mean Vector & Histogram

    Pairwise Cosine Similarity Matrix (Query + Passages)

    Run inference above to inspect the live N×N pairwise cosine matrix.

    3. Why it matters & what you can build

    4. How the API works & Show the code

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

    Show the code: 1024-d mean-pooled feature-extraction forward pass (worker.js)
    Show the code: E5 asymmetric query: / passage: prefix formatter (e5-large-core.mjs)

    5. References