EmbeddingGemma-2 text · 0.8 BPW (v2.0.0)
EmbeddingGemma-2 quantized to 0.79982 bits per weight (25.84 MiB / 27.09 MB, 20.0× smaller than BF16), with pure-CPU and CUDA inference for text in a 768-dimensional embedding space.
| Property | Value |
|---|---|
Checkpoint size (model.safetensors) |
25.84 MiB (27,094,216 B) |
Compression vs BF16 (516.90 MiB) |
20.0× smaller (-95.0%) |
| Effective bits per weight (file) | 0.79982 BPW |
| Parameters | 271,002,648 |
| Output dimensions | 768 (optional 512, 256, 128) |
| Similarity | Cosine |
weights_sha256 |
9d722b02...92f80 |
Evaluation Results
1. Dense Text Retrieval (FiQA Test Split: 131 Queries / 2,048 Docs)
| Encoder | Stored Size | Compression vs BF16 | Recall@1 | Recall@10 | Recall@50 | nDCG@10 |
|---|---|---|---|---|---|---|
Base FP32 (google/embeddinggemma-2) |
1,033.8 MiB |
0.5× |
36.82% |
68.10% |
89.04% |
0.6343 |
0.8 BPW v2.0.0 |
25.84 MiB |
20.0× |
19.49% |
55.86% |
78.53% |
0.4478 |
| Retention vs FP32 | 40.0× smaller |
20.0× vs BF16 |
52.9% |
82.0% |
88.2% |
70.6% |
2. Blind STEM Domain Routing (MMLU-Pro Held-Out: 120 Unseen Questions)
Zero-shot cosine similarity between question embeddings (prompt_name="Classification") and 6 canonical discipline prototypes (20 unseen questions per discipline):
| Model | Global (120) | CS (20) | Eng (20) | Bio (20) | Chem (20) | Phys (20) | Math (20) |
|---|---|---|---|---|---|---|---|
Base FP32 (google/embeddinggemma-2) |
67.50% (81) |
50.0% |
60.0% |
50.0% |
85.0% |
70.0% |
90.0% |
0.8 BPW v2.0.0 |
60.00% (72) |
90.0% |
70.0% |
60.0% |
35.0% |
50.0% |
55.0% |
| Retention vs FP32 | 88.9% |
180.0% |
116.7% |
120.0% |
41.2% |
71.4% |
61.1% |
Evaluation Scope
- Measured splits: Reduced, fixed academic test splits (
256-token limit on FiQA131q/2,048d;512-token limit on MMLU-Pro STEM120). - Limitations: Not validated on 10M+ document corpora, full BEIR/MTEB suites, multimodal inputs, or web-scale production traffic. Hard-science discrimination (such as Chemistry at
35.0%) remains below unquantized FP32 (67.50%base global STEM).
Quantization & What Changed in v2.0.0
Uses binary latent-factor quantization inspired by LittleBit: bit-packed low-rank binary factors, FP16 scales, 2-bit frequent-token rows in embed_tokens, dense FP16 embedding_projection ([768, 512]), and a rank-4 query_adapter for SearchQuery.
- Standalone multi-domain fix (
v2.0.0): Inv1.0.0(available via git tagv1.0.0), quantization noise across the 24 binary layers collapsed technical domains outside Mathematics and Physics (28.33%global STEM:15.0%CS,0.0%Engineering,10.0%Chemistry,20.0%Biology).v2.0.0applies saliency-guided DARE projection surgery (p = 0.35) toembedding_projectionand recalibrates the rank-4SearchQueryadapter directly inside the25.84 MiBcheckpoint (0extra bytes, standalone with no external reranker or lexical index required), lifting global STEM routing by+31.67 pp(60.00%) while trading-0.54 ppon FiQARecall@10(55.53%to54.99%). - Why text-only at
0.8 BPW: Sub-2-BPW quantization is intentionally scoped to text only. Vision and audio towers (as well as cross-modal alignment through a0.8 BPWlanguage backbone) collapse below2 BPWand lose practical retrieval/classification accuracy; for image, video, and audio embeddings, use the unified3.3 BPWmultimodal release instead. - Breaking change vs
v1.0.0: Becauseembedding_projectionandquery_adapterwere updated,v2.0.0produces a refined embedding space incompatible withv1.0.0. Existingv1.0.0indexes must be re-indexed when upgrading.
Runtime Memory
EmbeddingGemma2LittleBit runs directly on CPU (~3.2 ms per text) or CUDA into standard 768D FP32 vectors (3,072 bytes/vector). The 25.84 MiB figure measures stored weights on disk; active runtime memory also includes inference activations, unpacked temporary factors during layer execution, and approximately 200 to 350 MB of baseline CUDA context overhead when running on GPU (device="cuda").
Usage
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
from modeling_littlebit import EmbeddingGemma2LittleBit
model = EmbeddingGemma2LittleBit.from_pretrained(".", device="cpu", verify=True)
# Dense retrieval (activates calibrated rank-4 SearchQuery adapter)
query = model.encode("What is compound interest?", prompt_name="SearchQuery")
document = model.encode(
"Compound interest includes interest earned on accumulated interest.",
prompt_name="Document",
)
score = float(query[0] @ document[0])
# Standalone domain routing / classification (no adapter required)
tech_q = model.encode(
"What is the time complexity of Dijkstra's algorithm with a binary heap?",
prompt_name="Classification",
)
Base model: Google DeepMind · EmbeddingGemma-2 · Apache 2.0.
- Downloads last month
- 20
Model tree for lethalbeats/embeddinggemma-2-0.8bpw-text
Base model
google/embeddinggemma-2