feature-extraction Β· text Β· WASM Β· ~337 MB
GTE-large is the heavyweight sibling of GTE-small: the same recipe β multi-stage contrastive training, mean pooling, and no instruction prefix β but a BERT-large backbone (~335M parameters) that emits a 1024-dimensional sentence vector instead of 384. Those extra parameters and dimensions buy a higher MTEB retrieval score and sharper separation on hard, near-synonymous pairs β the price is a much bigger download (~337 MB) and slower per-embedding latency. Type a few lines to build a live similarity matrix, search by meaning, and watch GTE-large and GTE-small score the SAME pairs side by side. Nothing leaves your device.
| Model | Xenova/gte-large (ONNX of thenlper/gte-large) |
|---|---|
| Task / pipeline | feature-extraction |
| Architecture | BERT-large encoder (~335M params) β 1024-dimensional sentence embedding |
| Pooling | mask-aware mean pooling, then L2-normalize β and no instruction prefix (embed query and document identically) |
| vs GTE-small | ~10Γ the parameters, 2.7Γ the dimensions, higher MTEB β at ~10Γ the download and slower latency |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~337 MB, cached after first load β a real commitment, so we only fetch it when you ask |
| License | MIT (thenlper GTE) |
| Web APIs | WebAssembly, Web Workers, Cache Storage β all Baseline widely available |
Put one sentence per line, then embed. The matrix shows the cosine similarity between every pair (1.00 = identical direction). The scatter is a 2D PCA projection of the 1024-d vectors β a flattened map where near = similar. Then type a query below to rank the lines by meaning. Because this model is ~337 MB, it only downloads when you click.
The encoder emits one 1024-number vector per token. To get a single vector per sentence GTE mean-pools those token vectors (mask-aware) and L2-normalizes, so every sentence becomes a unit-length arrow and cosine similarity is a plain dot product. Pick a sentence to see its real vector and its pre-normalization magnitude β 1024 numbers, not 384.
First 128 of 1024 dimensions (blue = positive, orange = negative, brighter = larger magnitude):
Same recipe, different scale. On easy pairs both models agree. The difference shows on hard, near-synonymous pairs, where the 1024-d model separates "same meaning" from "merely related" more decisively. The catch is the tab bill: GTE-large is ~10Γ the download and noticeably slower per embedding. This loads GTE-small (~34 MB) on demand, embeds each pair below with both models, and shows the real cosines, the same-vs-unrelated GAP, and each model's latency.
Embeddings are the quiet workhorse behind search, recommendations, deduplication, clustering, and retrieval-augmented generation. GTE-large's pitch is quality: when a mis-ranked result is expensive β legal search, support deflection, dedup at scale β the bigger model's sharper separation earns its download. And it still runs entirely client-side, so the text never leaves the device. The honest tradeoff: reach for GTE-small when latency and download budget matter, GTE-large when ranking accuracy does.
Do two lines mean the same thing? One cosine number from GTE-large β and the same pair scored by GTE-small.
High-quality semantic search plus near-duplicate detection over your own corpus.
Cluster a mixed bag by meaning, and hunt hard pairs where GTE-large sees a distinction GTE-small misses.
GTE-large retrieves a shortlist by meaning, then a cross-encoder reranker re-scores the top hits.
Feature-extraction plus the pooling discipline is the whole recipe β same as GTE-small, just a bigger model and 1024-d output, and still no prefix:
import { pipeline } from "@huggingface/transformers";
const extract = await pipeline(
"feature-extraction",
"Xenova/gte-large",
); // downloads + caches ~337 MB once
// GTE uses MEAN pooling and needs NO instruction prefix β embed query and doc identically:
const out = await extract(["how do I sign in?", "the login page rejects my password"], {
pooling: "mean",
normalize: true,
});
const [q, d] = out.tolist(); // each is a 1024-number unit vector
// unit-length vectors β cosine similarity is just the dot product:
const sim = q.reduce((s, x, i) => s + x * d[i], 0); // high β same meaning
This page asks the worker for the un-normalized pooled vectors so "See inside" can show the real pre-normalization magnitude, then normalizes them in JS. Inference runs in a Web Worker, so the matrix, projection and comparison never jank the page.