TL;DR
BITEMBED introduces an extreme low-bit framework for LLM-based text embeddings, compressing the model backbone to 1.58-bit ternary weights and enabling output vectors to dynamically scale down to 1-bit precision. It delivers a 2x inference speedup on CPU and massive storage savings while maintaining performance nearly on par with full-precision models.
What Problem Does This Paper Address?
Large Language Models (LLMs) make fantastic text embedders because of their deep semantic understanding, but deploying them at scale is incredibly expensive. They suffer from a double whammy of resource bottlenecks:
- Inference Latency: Encoding text queries and documents using massive full-precision LLM backbones is computationally heavy and slow.
- Storage Overhead: High-dimensional, full-precision (FP16) output vectors dominate the memory footprint and bandwidth of large-scale vector databases containing millions or billions of documents.
While prior work has tackled backbone quantization or vector compression separately, BITEMBED addresses both sides of the deployment coin simultaneously without sacrificing representation quality.
Methods
The authors propose a three-stage training pipeline to build an extreme low-bit embedding model:
- Backbone Quantization: They convert standard LLM backbones into BitNet-style architectures. This means linear weights are restricted to ternary values (scaled values in $\{-1, 0, 1\}$, effectively 1.58 bits), and activations are quantized to 8-bit integers. Sub-layer normalization (SubLN) is introduced to stabilize training against quantization noise.
- Three-Stage Training Strategy:
- Architecture Conversion: Initializing the BitNet structure from a pretrained LLM.
- Continual Contrastive Pre-training: Training on 1 billion text pairs to rebuild the semantic space distorted by extreme quantization.
- Distillation-based Supervised Fine-Tuning (SFT): Fine-tuning the model alongside a full-precision FP16 teacher. The student model minimizes two novel distillation objectives: similarity-distribution distillation (matching the teacher's relative preferences over text candidates) and attention-relation distillation (aligning token-level interactions).
- Multi-Precision Output Quantization: Inspired by Matryoshka representation learning, BITEMBED trains the output layer to support multiple storage precisions (1, 2, 4, 8, and 16 bits) simultaneously. A single model checkpoint can thus serve different memory budgets on the fly.
Datasets
- Pre-training: 1 billion text pairs following the Multilingual E5 recipe.
- Fine-tuning: The BGE-en-ICL dataset, consisting of 2.1 million samples spanning retrieval, reranking, classification, clustering, and semantic textual similarity (STS) tasks.
- Evaluation: The Massive Multilingual Text Embedding Benchmark (MMTEB) (eng, v2).
Key Insights and Ideas
- Pre-training is Non-Negotiable: Directly fine-tuning a quantized backbone without a contrastive pre-training phase results in severe performance degradation (an average score drop of over 8 points). Continual pre-training is essential to reconstruct a coherent semantic space after extreme quantization.
- Target the Middle-to-Late Layers: For attention distillation, aligning the student's token interactions with the teacher's middle-to-later layers (e.g., layer 18 in Qwen3-0.6B) yields the best results. Earlier layers focus too much on local syntax, while the very last layers become overly specialized.
- Bits over Dimensions: Retaining the full embedding dimensionality but reducing bit precision (multi-precision quantization) outperforms Matryoshka Representation Learning (MRL)—which drops vector dimensions—at equivalent storage budgets. Keeping the full vector space allows more nuanced semantic factors to participate in similarity calculations.
Key Results
- Near-Lossless Quality: BITEMBED closely matches its full-precision FP16 teacher baselines. On Qwen3-0.6B, BITEMBED scores 67.60 on MMTEB (just 0.35 points behind the teacher). On Gemma3-270M, it achieves 66.10 compared to the teacher's 66.71.
- 2x CPU Throughput: Token throughput on an 8-thread CPU doubles for both model backbones (e.g., jumping from 364.36 to 830.50 tokens/second for Qwen3).
- Flexible Storage Trade-offs: Output embeddings at 4-bit and 8-bit precisions are virtually lossless. Even under aggressive 1-bit or 2-bit quantization—which reduces vector storage by up to 16x—the embeddings retain highly usable performance.
Limitations and Future Work
- Retrieval Sensitivity: While classification and STS tasks are highly robust to low-bit output quantization, retrieval performance is significantly more sensitive. Aggressive 1-bit and 2-bit output compression leads to noticeable drops in retrieval accuracy because long-document matching demands finer-grained semantic information.
- Future Directions: The authors suggest expanding this dual-quantization framework to larger foundation models and evaluating its efficacy across broader multilingual and multimodal settings.
Summary updated