Random Cycle Coding: Lossless Compression of Cluster Assignments via Bits-Back Coding
Daniel Severo, Ashish Khisti, Alireza Makhzani
TL;DR
The paper introduces Random Cycle Coding (RCC), a lossless compression method for cluster assignments that represents assignments via permutation cycles. By employing bits-back coding and Foata's canonicalization, RCC achieves Shannon-bound bit savings equal to $\log|\Pi|$ without training and with quasi-linear worst-case complexity in the largest cluster. The approach outperforms two variants of Random Order Coding (ROC) in both bit-rate savings and computational efficiency, and demonstrates practical impact on vector databases like FAISS by reducing labeling overhead and improving storage efficiency. The work provides a rigorous probabilistic model for RCC, experiments across large datasets, and a detailed complexity analysis, highlighting RCC's suitability for scalable, labeling-free clustering storage in similarity search systems.
Abstract
We present an optimal method for encoding cluster assignments of arbitrary data sets. Our method, Random Cycle Coding (RCC), encodes data sequentially and sends assignment information as cycles of the permutation defined by the order of encoded elements. RCC does not require any training and its worst-case complexity scales quasi-linearly with the size of the largest cluster. We characterize the achievable bit rates as a function of cluster sizes and number of elements, showing RCC consistently outperforms previous methods while requiring less compute and memory resources. Experiments show RCC can save up to 2 bytes per element when applied to vector databases, and removes the need for assigning integer ids to identify vectors, translating to savings of up to 70% in vector database systems for similarity search applications.
