Manuscript Offprint
arXiv:2611.11967Pairwise distortion distribution for compression and quantization
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Choosing the latent dimension is a critical challenge in data compression, where conventional hyperparameter optimization is costly and ad hoc. Intrinsic dimension provides a good alternative, which connects information-theoretic notions such as Renyi information dimension (RID) to rate-distortion dimension and random codebook compression. In this work, we introduce the pairwise distortion distribution (PDD) and its asymptotic limit, pairwise dimension (PD), which generalize the correlation integral to general distortion measures. We show that PD bounds RID, and PDD provides a lower bound for random codebook quantization performance, which can guide a practical use for compression, quantization, and dimensionality reduction applications.
Index Terms— Data compression, Information dimension, Latent dimension, Quantization, Rate-distortion
1. INTRODUCTION
Many applications such as representation learning, compression, and quantization rely on data having an intrinsic dimension much lower than the raw, or extinsic dimension. [1–4]. Machine learning is a useful tool for finding such representations, in which the assumed intrinsic dimension is a key hyperparameter [5]. Conventional approaches address this by exhaustive search, which are computationally expensive and provides little insight on the geometry of the data [6, 7].
To address this, a large body of work focuses on estimating the intrinsic dimension (ID) of sets and of probability distributions, under various definitions [8]. Estimators for sets include maximum likelihood estimation (MLE) [9], TWO-NN [10], and PCA-based approaches [11], which leverage the local or global data statistics. Two well known definitions for ID are the Hausdorff dimension and the box counting dimension [11–13]. The information dimension, or the Hausdorff information dimension (HID), is the smallest Hausdorff dimension among sets having probability 1.
In information theory, an important quantity is the Renyi information dimension (RID) [14, 15]. The RID of a random vector , for , is defined in terms of a series of quantized versions as
when the limit exists, where is the Shannon entropy. The RID is connected in [8] to the asymptotic scaling of the rate distortion curve as distortion approaches zero, for a wide class of distortion measures. In [16], the authors introduce the correlation integral and corresponding correlation dimension as computationally simpler alternatives to HID for quantifying the dimension of a distribution.
In this paper, we make connections between the correlation integral, the RID, and compression by generalizing the correlation integral from Euclidean distances to a general distortion measure. To this end, we introduce a new function called the pairwise distortion distribution (PDD), whose asymptotic limit defines a distortion-dependent notion of dimension referred to pairwise dimension (PD). Both PDD and PD are relatively easy to estimate from data and to derive analytically for known distributions.
We show that when distortion is a power of a vector norm, the PD gives a lower bound on the RID, and thus on the asymptotic behavior of the rate-distortion curve for a wide class of distortion functions. A simple PDD-based computation also yields a lower bound on the quantization performance of random quantization codebooks. Taken together, these properties suggest that the PDD-derived rate-distortion curve can be a good guide to the quantization performance, which we confirm via empirical experiments.
Definition 1 (Correlation Integral and Correlation Dimension [16]). Let be a random vector on . For , the correlation integral is defined as
where and are independent realizations of . The correlation dimension of , if the limit exists, is given as
is the cumulative distribution function of the random variable , which represents the distance between two independent samples drawn from . In particular,
Funded by one or more of the following grants: ARO W911NF1910269, ARO W911NF2410094, NSF CIF-2311653, NSF CIF-2148313, NSF RINGS 2148313, ONR N00014-22-1-2363, NSF DBI-2412522, and Resilient & Intelligent NextG Systems (RINGS) program if has an absolutely continuous distribution supported on a -dimensional subset of , then .
While optimal codebooks achieve rate-distortion limits, its structure is difficult to characterize. Instead, we focus on the random codebook quantization scheme (RCQ), which provides a mathematically tractable baseline for PDD analysis. Let denote a quantization codebook with codewords. For a distortion measure , a quantizer maps an input to its nearest codeword, . The mean distortion of the codebook is . When the codebook is generated randomly, with each codeword drawn independently from , the expected distortion over random codebooks is .
3. PDD-BASED FRAMEWORK
We introduce a new distribution and its corresponding notion of dimension, which generalize the correlation integral by replacing the Euclidean distance with an arbitrary distortion measure .
Definition 2 (Pairwise Distortion Distribution and Pairwise Dimension). Let be a random vector on , and let be a distortion measure. For , the pairwise distortion distribution (PDD) of with respect to is defined as . The corresponding notion of dimension, the pairwise dimension (PD), is defined as
We now develop a tool for compression analysis, built upon two key fundamental relationships: (i) between the pairwise distortion distribution (PDD) and the Renyi information dimension (RID), and (ii) between PDD and random codebook quantization (RCQ).
3.1. Connection between PDD and RID
Proposition 4 in [17] shows an alternative representation for the RID that is closely related to PDD. For -norm on with ,
This connects the RID to probabilities of balls of size r around random centers. We show that PDD provides a lower bound for RID.
Proposition 1. For distortion functions of the form , for and , if both limits exist,
Proof: For each r,
Taking so that , dividing through by on both sides, and taking the limit as gives the result.
The rate-distortion dimension of a distribution is defined in [8] for distortions of the form , as
where is the Shannon rate-distortion function for distribution . The authors show that for any and any norm equivalent to (including for any ). Combining this result with Proposition 1, we see that the asymptotic increase of for small distortion can be lower bounded based on . Thus, the PDD curve near yields useful information about the effective dimension of a distribution from a rate-distortion point of view.
3.2. Connection between PDD and RCQ
We next show a connection between the PDD and the performance of random codebook quantization.
Proposition 2. Let on be a random vector. Generate a quantization codebook by drawing codewords independently from . For a given distortion function , the expected distortion over random codebooks, , satisfies
Remark. can be computed or bounded analytically for simple distributions (See e.g. Corollary 1 and 2) or estimated empirically from sufficiently many samples from a dataset.
Proof: For given , define non-negative random variables with drawn independently from . Denoting the CDF of as , the CDF of is . We have
thus,
where the second line uses Jensen's inequality.
3.3. Additional analysis
The pairwise dimension of equals when for small . More generally, bounds on the behavior of the PDD near bound the behavior of the distortion of the random codebook as .
Lemma 1. Let on and suppose that for some , . Then
In particular, scales as for large L.
Proof.
When the distortion function is a function of the difference between its arguments, , and when X has an absolutely continuous and symmetric distribution on with pdf , the bound on random codebook quantization can further be related to the volumes of balls in under the given distortion function.
Proposition 3. Let have absolutely continuous distribution with density . Define distortion function for non-negative integrable . Then if , the density of satisfies , and we have
where is the volume of the set .
Proof. Defining for iid , the distribution of is of the form . Considering the integral of nonnegative quantity over , establishes that if that expectation exists. Finally, .
Combining Proposition 3 and Lemma 1, the pairwise dimension and asymptotic quantization behavior can be characterized in terms of the scaling of volumes in under different distortion measures.
For example, for a distortion measure , we have where is the volume of the -norm ball in . For mean-squared error distortion , in particular, we have
In the following, we analytically compute the corresponding lower bound for various types of distributions for on .
Corollary 1 (Multi-variate Gaussian distribution). Suppose . Then,
Proof: The difference of two independent variables from the distribution is distributed as . Then, is , and applying Lemma 1 gives the result.
This MSE lower bound scales with , i.e., the geometric mean of the eigenvalues of .
Corollary 2 (k-sparse vectors). Suppose is a k-sparse random vector with , where the k nonzero elements are chosen uniformly at random from the set , and the non-zero coefficients are independent and identically distributed as . Then under MSE distortion, .
Sketch proof: The supports of two variables can intersect on anywhere from 0 to 2k elements. Enumerating these possibilities, one can show that
Considering the behavior of for small r and applying Lemma 1 yields the result.
3.4. Empirical estimation of the PDD
Part of the motivation for using the PDD is that it is relatively easy to estimate from data. When data is limited to a relatively small number of samples , it can make sense to use all pairs (as in [16]), . When many data samples are cheaply available, samples can be used to form the estimate
which converges faster for a given number of distortion evaluations and is more easily analyzed, as the sum of K independent Bernoulli random variables. For this estimator, the

Fig. 1. Rate-distortion performance comparison for Gaussian normal vectors and MNIST data.
coefficient of variation is , from which confidence intervals may easily be computed. To estimate the PDD accurately for small values of r, we need pairs of samples. Future work will consider using methods such as importance sampling to increase the efficiency of estimating small values of the PDD.
4. NUMERICAL RESULTS
We illustrate the proposed framework on both synthetic and empirical datasets to begin to address two key questions: (1) Does PDD provide a meaningful lower bound on quantization error? and (2) Can PDD be used to estimate an appropriate latent dimension for data compression? For the synthetic case, independent gaussian vectors drawn from are generated with an ambient dimension of N = 2, 10. For the empirical dataset, we employ the MNIST database of handwritten digits [18], representing each data sample with dimension N = 784.
Synthetic Data: Gaussian Vectors. We compare against two baselines: the random codebook scheme described in Section 2 and the optimal rate–distortion curve [19,20]. For the random codebook scheme, we generate a codebook of size , where and denotes the bit rate. Each codeword is constructed as a gaussian vector drawn from . For each bit rate and , we analytically compute PDD in Corollary 1 with parameters , and . The optimal rate–distortion curve for a Gaussian distribution is the classical result from Shannon's rate–distortion theory [20], that is .
Empirical Data: MNIST with ViT-Based Autoencoder. We implement a Vision Transformer-based autoencoder (ViT-AE) [21,22] tailored for MNIST images of size . Each image is divided into 28 patches of length 28, which are projected into a 128-dimensional embedding space. The encoder consists of 5 Transformer layers with 16 attention heads and MLP blocks of hidden size 256, producing a compact latent representation. For the latent dimension , we experiment with multiple settings, specifically .
This latent vector is quantized using a 2-bit uniform quantizer, restricting activations to four discrete levels, and then decoded through a symmetric Transformer to reconstruct the input while achieving efficient compression. Next, we compute the lower and upper bounds of the PDD framework. We sampled pairs of points from the MNIST dataset and estimated the PDD for various values of r using (8). The 95% upper and lower confidence intervals of the PDD estimate were then integrated to obtain upper and lower estimates of the right side of (4).
Performance analysis. Fig. 1 illustrates rate-distortion (MSE) curves for gaussian vectors and MNIST dataset. In the case of gaussian vectors, on a log vs bits scale, the optimal R(D) curves decay linearly with slope -2/N. The slope directly reflects the intrinsic dimension of the gaussian data, which is N. Thus, when N = 2, the curve shows steeper slope than N = 10. The PDD curves are almost parallel to the optimal R(D) curves, consistent with Proposition 1. This confirms that PDD captures the correct asymptotic scaling behavior. In addition, PDD provides a lower bound for the random codebook scheme, in alignment with Proposition 2.
Next, we introduce our method for identifying an appropriate latent dimension using PDD by leveraging its MSE performance estimate. For the MNIST dataset, the upper bound (ub) of PDD curve provides an accurate approximation of the MSE observed with a latent dimension in the ViT-based autoencoder, demonstrating its effectiveness as a performance predictor. One practical use of MSE estimate is predicting achievable distortion at a given bit rate. For example, with 20 bits (corresponding to a latent dimension at least 10), we expect MSE at least 0.1 for compression models. The gap between ViT-AE performance and PDD estimates suggests that the predictive MSE is more accurate at lower bits (smaller latent dimension), while at higher bits, we see room for improvements in ViT-AE. This predictive capability is powerful, as it enables us to anticipate both the latent dimension and the corresponding MSE prior to training.
5. CONCLUSIONS
We introduced the pairwise distortion distribution (PDD) as a novel proxy to analyze data geometry, intrinsic dimension, and compression performance. We demonstrated that (1) PD provides a lower bound for Renyi information dimension (RID) and (2) PDD yields a tractable lower bound on the random codebook quantization error, providing the direct performance estimate without model training. Our numerical results on gaussian vectors and MNIST dataset show that PDD can capture the right intrinsic scaling behavior as RID and predicts achievable distortion, providing a practical framework to estimate a good latent dimension for autoencoders.
6. REFERENCES
[1] Rázvan Andonie, "Hyperparameter optimization in learning systems," Journal of Membrane Computing, vol. 1, no. 4, pp. 279–291, 2019.
[2] Lizhi Liao, Heng Li, Weiyi Shang, and Lei Ma, "An empirical study of the impact of hyperparameter tuning and model optimization on the performance properties of deep neural networks," ACM Transactions on Software Engineering and Methodology (TOSEM), vol. 31, no. 3, pp. 1–40, 2022.
[3] Paola Campadelli, Elena Casiraghi, Claudio Ceruti, and Alessandro Rozza, "Intrinsic dimension estimation: Relevant techniques and a benchmark framework," Mathematical Problems in Engineering, vol. 2015, no. 1, pp. 759567, 2015.
[4] Stefan Berchtold, Christian Bohm, Hosagrahar V Jagadish, H-P Kriegel, and Jörg Sander, "Independent quantization: An index compression technique for high-dimensional data spaces," in Proceedings of 16th International Conference on Data Engineering (Cat. No. 00CB37073). IEEE, 2000, pp. 577–588.
[5] Sixue Gong, Vishnu Naresh Boddeti, and Anil K Jain, "On the intrinsic dimensionality of image representations," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019, pp. 3987–3996.
[6] James Bergstra and Yoshua Bengio, "Random search for hyper-parameter optimization," The journal of machine learning research, vol. 13, no. 1, pp. 281–305, 2012.
[7] Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren, Automated machine learning: methods, systems, challenges, Springer Nature, 2019.
[8] T. Kawabata and A. Dembo, "The rate-distortion dimension of sets and measures," IEEE Transactions on Information Theory, vol. 40, no. 5, pp. 1564–1572, 1994.
[9] Elizaveta Levina and Peter Bickel, "Maximum likelihood estimation of intrinsic dimension," Advances in neural information processing systems, vol. 17, 2004.
[10] Elena Facco, Maria d'Errico, Alex Rodriguez, and Alessandro Laio, "Estimating the intrinsic dimension of datasets by a minimal neighborhood information," Scientific reports, vol. 7, no. 1, pp. 12140, 2017.
[11] Francesco Camastra and Antonino Staiano, "Intrinsic dimension estimation: Advances and open problems," Information Sciences, vol. 328, pp. 26–41, 2016.
[12] Patrick Billingsley, “Hausdorff dimension in probability theory,” Illinois Journal of Mathematics, vol. 4, no. 2, pp. 187–209, 1960.
[13] Jian Li, Qian Du, and Caixin Sun, “An improved box-counting method for image fractal dimension estimation,” Pattern recognition, vol. 42, no. 11, pp. 2460–2469, 2009.
[14] Alfréd Rényi, “On measures of entropy and information,” in Proceedings of the fourth Berkeley symposium on mathematical statistics and probability, volume 1: contributions to the theory of statistics. University of California Press, 1961, vol. 4, pp. 547–562.
[15] Yihong Wu and Sergio Verdú, “Rényi information dimension: Fundamental limits of almost lossless analog compression,” IEEE Transactions on Information Theory, vol. 56, no. 8, pp. 3721–3748, 2010.
[16] Peter Grassberger and Itamar Procaccia, “Measuring the strangeness of strange attractors,” Physica 9D, pp. 189–208, 1983.
[17] Yihong Wu and Sergio Verdú, “Rényi information dimension: Fundamental limits of almost lossless analog compression,” IEEE Transactions on Information Theory, vol. 56, no. 8, pp. 3721–3748, 2010.
[18] Yann LeCun, Corinna Cortes, and Christopher J.C. Burges, “The MNIST database of handwritten digits,” http://yann.lecun.com/exdb/mnist/, 2010.
[19] J. Max, “Quantizing for minimum distortion,” IRE Transactions on Information Theory, vol. 6, no. 1, pp. 7–12, 1960.
[20] Thomas M. Cover and Joy A. Thomas, Elements of Information Theory, Wiley-Interscience, 2 edition, 2006.
[21] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin, “Attention is all you need,” Advances in neural information processing systems, vol. 30, 2017.
[22] Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang, “Transformer in transformer,” Advances in neural information processing systems, vol. 34, pp. 15908–15919, 2021.