Introduction
Dense embeddings are the workhorse of modern AI, powering everything from Retrieval-Augmented Generation (RAG) to semantic search. However, storing millions of high-dimensional vectors (e.g., 1024-dimensional floats) is incredibly expensive and slow. To save costs, engineers often use post-training compression, such as truncating vectors or "binarizing" them (turning floats into 1s and 0s).
The challenge is that models optimized for the best raw performance often "break" when compressed. This paper investigates why some embedding spaces compress better than others and how we can train models that offer both top-tier performance and extreme compressibility. The key lies in the temperature parameter ($\tau$) used during contrastive training, which dictates the "intrinsic dimensionality" of the resulting embedding space. By increasing temperature, researchers can create embeddings that are far more resilient to extreme compression, allowing for a 32x reduction in size while retaining over 99% of original retrieval performance.
Methods and Datasets
The authors focus on the temperature parameter ($\tau$) in the InfoNCE loss function, the standard objective for training embeddings. They analyze the intrinsic dimensionality of the resulting spaces using Principal Component Analysis (PCA) to measure how many dimensions are needed to represent 95% of the data's variance.
To test compressibility, they evaluate two main methods:
- Truncation: Discarding the end of the vector (e.g., keeping only the first 256 of 1024 dimensions).
- Binarization: Converting every value to a single bit based on its sign.
The models were pre-trained on a massive 2-trillion-token multilingual corpus and fine-tuned using contrastive learning on a mix of ~2 million pairs from datasets like MS Marco, Natural Questions, and HotpotQA. Evaluation was performed using the Massive Text Embedding Benchmark (MTEB), focusing on Retrieval and Clustering tasks.
Key Insights
The Temperature-Dimensionality Link
Lower temperatures ($\tau \approx 0.04$) force the model to spread data points out uniformly, leading to high "intrinsic dimensionality." While this is great for fine-grained retrieval, it makes the embeddings "brittle" to compression. Conversely, higher temperatures ($\tau \approx 0.3$) lead to lower intrinsic dimensionality. The model encodes information more redundantly across dimensions, acting as a safety net; if bits or dimensions are removed, the core signal remains intact.
The Retrieval-Clustering Seesaw
There is a natural tension between downstream tasks based on the temperature used during training. Low temperature favors Retrieval (instance-level discrimination), while high temperature favors Clustering (group-level discrimination).
To break this trade-off between raw performance and compressibility, the authors propose novel training objectives:
- Temperature Aggregation: Training with a sum of losses using different temperatures.
- Temperature Specialization (TempSpecMRL): A hybrid approach using a small temperature for the "head" of the vector (boosting retrieval accuracy) and a larger temperature for the full vector (encouraging a low-dimensional, compressible structure).
Key Results
- Compression Resilience: At a low temperature ($\tau=0.04$), truncating to 256 dimensions retains only 93% of performance. At a higher temperature ($\tau=0.4$), that same truncation retains 99% of performance.
- Binarization Breakthrough: Surprisingly, binarizing a high-temperature model (32x compression) often retains more quality than truncating a low-temperature model to 1/4 of its size. Using the proposed TempSpecMRL method, the authors trained a model that matches the retrieval power of the best baseline but maintains 99% quality even after being binarized and re-ranked.
- Efficiency: These methods allow for reducing embedding storage by an order of magnitude (e.g., from 4KB per vector to 128 bytes) with negligible impact on search quality.
Limitations and Future Work
While the correlation between temperature and intrinsic dimensionality is clear, the exact mathematical mechanism of how high temperature induces redundancy isn't fully proven. Furthermore, the study primarily used "homogeneous" negative sampling. Different strategies for picking "hard negatives" might interact with temperature in complex ways. Finally, as this research focuses on text embeddings, whether these temperature effects translate identically to vision or audio embedding spaces remains an open question.
Summary updated