cd /news/large-language-models/gemini-embedding-001-mrl-truncation-… · home › topics › large-language-models › article
[ARTICLE · art-181364] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Gemini Embedding 001 MRL Truncation: Why Unnormalized 768d Vectors Lose 0.54 Dot Product

A benchmark from VoxellInc's rag-contradiction-benchmark v1.1.0 found that truncated Matryoshka prefixes of Google's gemini-embedding-001 are not unit-normalized, so 768d vectors carry an L2 norm of about 0.584 and raw dot products fall to roughly 0.288 versus 0.832 cosine similarity at full 3072d. The team reports that 768d MRL stays within 0.0028 to 0.0074 cosine points of the full vector while cutting index RAM 4x, provided vectors are L2 re-normalized before storage or search. The project recommends re-normalizing every ingested batch and query, and offers server-side fused normalization through its Voxell Forge embedding service.

recommendation

L2-normalize every gemini-embedding-001 batch and query before storing or searching when output_dimensionality is below 3072, or dot-product scores will drop by roughly 0.54.

more in playbook: Retrieval and RAG
by read2 min views6 publishedDec 3, 2026

Matryoshka Representation Learning (MRL) lets you slice high-dimensional embeddings (3072d or 2560d) down to 768d, 1024d, or 1536d to shrink HNSW memory footprints by 50% to 75%. Yet teams migrating to Google's gemini-embedding-001 frequently hit silent ranking regressions when indexing truncated output_dimensionality=768 vectors in pgvector (vector_ip_ops), Pinecone dot-product indexes, or FAISS IndexFlatIP.

The root cause is geometric: only the full 3072d output of gemini-embedding-001 is guaranteed unit-normalized (||v||_2 = 1.0). Truncated MRL prefixes ( 768d, 1536d) are not unit-length unless you re-normalize them.

In our 2026 open benchmark (VoxellInc/rag-contradiction-benchmark v1.1.0), we measured 3072d full cosine similarity, L2-normalized 768d MRL cosine similarity, unnormalized 768d dot products, and 768d prefix L2 norms on gemini-embedding-001:

Probe Query 3072d Cosine 768d MRL Cosine (L2 Normed) 768d Unnormed Dot Product 768d Prefix L2 Norm
"Cohere Rerank 3.5 pricing" 0.8385 0.8318 0.2883 0.5845
"Vertex AI Search pricing per GB" 0.8211 0.8183 0.2878 0.5862
"pgvector 2000 dimension limit hnsw fix" 0.8386 0.8338 0.2899 0.5835
"Model Context Protocol server for private engineering documentation" 0.8185 0.8111 0.2793 0.5841
"ERROR: column cannot have more than 2000 dimensions pgvector" 0.8506 0.8459 0.2918 0.5823

Notice two critical facts:

768d MRL stays within 0.0028 to 0.0074 cosine points of the full 3072d vector while cutting index RAM by 4x.||v||_2 = 0.584, their raw dot product scales by roughly 0.584 * 0.584 = 0.341, dropping 0.8318 down to 0.2883. Worse, passage-to-passage variance in prefix energy ( 0.5823 vs 0.5862+) skews top- k candidate ordering whenever an ANN engine assumes unit vectors or applies score thresholds (score >= 0.75) ahead of If you call gemini-embedding-001 at < 3072 dimensions, enforce L2 re-normalization on every ingested batch and every query before storage or search:

package vecnorm

import "math"

func NormalizeL2(v []float32) []float32 {
    var sum float64
    for _, x := range v {
        sum += float64(x) * float64(x)
    }
    if sum == 0 {
        return v
    }
    inv := float32(1.0 / math.Sqrt(sum))
    for i := range v {
        v[i] *= inv
    }
    return v
}

Or eliminate client-side drift completely with Voxell Forge: both turbo (1024d, $0/forever, MRL 256..1024) and pro (2560d, $0.25/1M tokens, MRL 256..2560) execute fused GPU L2 re-normalization on the server whenever dimensions is passed, returning strict unit-norm vectors over HTTPS (/v1/embeddings) and mTLS gRPC.

── more in #large-language-models 4 stories · sorted by recency
── more on @google 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/gemini-embedding-001…] indexed:0 read:2min 2026-12-03 · —