Lossless Embedding Compression via Spherical Coordinates
Han Xiao
TL;DR
This paper addresses the need for lossless compression of high-dimensional unit-norm embeddings without training. By transforming Cartesian coordinates to spherical angles on the hypersphere $S^{d-1}$, the method exploits exponent concentration near $\pi/2$, enabling effective entropy coding after a strategic byte-shuffling pipeline. Across 26 configurations (text, image, and multi-vector embeddings), the approach achieves approximately $1.5\\times$ compression with consistent, bit-exact reconstruction within float32 precision, and substantial practical gains for large-scale KV caches (e.g., ColBERT) with no training required. This work fills the gap between uncompressed storage and lossy quantization, offering a robust, fast, and exact solution for embedding storage and transmission, while also revealing favorable behavior for BF16 inputs.
Abstract
We present a lossless compression method for unit-norm embeddings that achieves 1.5$\times$ compression, 25\% better than the best prior method. The method exploits that spherical coordinates of high-dimensional unit vectors concentrate around $π/2$, causing IEEE 754 exponents to collapse to a single value and enabling entropy coding. Evaluation across 26 configurations spanning text, image, and multi-vector embeddings confirms consistent improvement. The method requires no training and is fully lossless within float32 precision.
