WorksComputer Science
Sliced Wasserstein Sketches with Error Certificates
Abstract
Compact representations that support geometrically meaningful comparisons are valuable for learning from probability distributions. We study optimal, free-weight -atom quantization of one-dimensional probability measures in quadratic Wasserstein distance and extend it to higher dimensions via slicing. Using shared projections yields a sketch with comparison time. Our main result is an exact decomposition of squared distance error into residual and partition-mismatch terms, yielding computable certificates for arbitrary centroid sketches. For optimal sketches, a finite moment for some guarantees error in the finite-direction sliced distance, while equal-mass sketches can converge more slowly. Each slice preserves its mean, while storing residual energies enables covariance recovery from sufficiently many generic directions. Experiments on document, point-cloud, and flow-cytometry benchmarks show that optimal sketches substantially reduce storage while preserving the classification performance of uncompressed sliced distances. They also improve generalization from few labelled subjects and support end-to-end learning as compact pooling layers.
Introduction
A document represented by word embeddings and a shape represented by a point cloud are naturally compared as probability distributions. In retrieval, clustering, and other tasks involving many such objects, repeatedly computing transport distances on the original samples can dominate the cost. A useful summary should therefore be built once, occupy little memory, support many cheap comparisons, and quantify how far those comparisons can deviate from the true distances.
Sliced Wasserstein distances, introduced by Rabin et al. [51], compare distributions by averaging one-dimensional transport costs over projection directions. In one dimension, quadratic Wasserstein distance is the distance between quantile functions. This representation underlies sketches based on quantile grids [28, 40, 37, 10], streaming rank summaries [43], and parametric fits [42, 34]. A fixed grid of quantile levels is particularly convenient because comparison reduces to a Euclidean distance. However, its allocation of resolution is less flexible because cells of equal probability can cover very different spatial scales, and tail cells or cells crossing gaps in the support can dominate the approximation error.
In this work, we instead summarize each projection by the measure supported on at most atoms that minimizes its quadratic Wasserstein error. Both atom locations and weights are free to adapt to the projected distribution. For a weighted point measure, this is exactly one-dimensional weighted -means, which admits a globally optimal dynamic program [57, 23]. Applying it on shared directions gives a reusable sketch with storage and comparison time. The construction also returns the quantization error of every slice, and it is exact on any projection with at most distinct values. Figure 1 illustrates the construction and comparison.
Figure 1. Sketch construction. Top: two bags in (one weighted) and two shared directions. Middle: projected atoms, optimal contiguous cells (dotted), and weighted centroids per direction; marker area is proportional to cell mass, and cells differ between bags. Bottom: sketch step quantiles over mass , with original quantiles in the background and shading marking coupled pairs at each mass level. This monotone coupling has quadratic cost ; the squared sketch distance averages these costs over directions.
The central question is how these individually optimal summaries affect the distance between two distributions. With a shared partition of the quantile domain, replacing each quantile by its cell means is an orthogonal projection and contracts . Adaptive quantizers generally choose different partitions, so this contraction argument no longer applies. The triangle inequality still bounds distance error by the sum of the two quantization errors, but does not describe the effect of the mismatched cells. We resolve this gap with an exact identity for arbitrary centroid sketches: summaries whose atoms are the means of their quantile cells. The identity isolates the boundary terms that can expand distances and yields sketch-computable certificates.
Our contributions are:
Distance certificates for adaptive partitions. The partition-mismatch identity (Theorem 2) yields two-sided bounds, shared-partition contraction, and squared-distance error when quantiles are Lipschitz and cell masses are (Theorems 3 and 7). An explicit family shows that a larger error is possible for general centroid sketches (Theorem 10).
Sliced approximation rates. Combining the certificates with classical quantization bounds gives error in the finite-direction sliced distance under a finite moment for some (Theorems 4 and 5). Gaussian projections and projections of uniform balls in dimensions exhibit slower equal-mass rates, illustrating the benefit of adaptive weights (Theorem 11).
Moment recovery. Classical centroid identities give exact directional means and a second-moment deficit equal to the residual energy. We use these identities to recover means and covariances from finitely many directions, and to bound higher-moment tensor errors, with a per-cell correction that improves the rate (Theorem 6).
Compression at matched accuracy. On document, point-cloud, and flow-cytometry benchmarks the sketch reproduces the accuracy of the uncompressed sliced distance with 1.5 to more than 3000 times fewer stored numbers, and learned slices make the sketched distance competitive with full-dimensional transport (§ 5). We also report where equal-mass cells are the better centroid sketch (Section D.1).
The exact solver and underlying quantization and moment identities are established results. Our analysis concerns their use in distribution sketches and, particularly, the effect of mismatched partitions on pairwise distances. The target is the sliced distance on the chosen directions; approximation of population sliced Wasserstein and comparison with are separate questions ([41] (Bonnotte 2013)).
Related Work
Exact one-dimensional quantization. Free-weight -atom quantization of a weighted point measure is equivalent to one-dimensional weighted -means with contiguous clusters. An early dynamic program for scalar quantization is due to Bruce [9]; Wu [57] obtained time after sorting using matrix searching ([1]). Grønlund et al. [23] show how to achieve time after sorting using only space, and also describe a divide-and-conquer alternative with running time. Lloyd–Max iterations provide an alternative to dynamic programming by repeatedly updating cell boundaries and centroids ([39, 36]). Whether they recover a global optimum depends on the distribution. Fleischer [16] studied sufficient conditions for optimality, and subsequent work showed that log-concave densities admit a unique optimal quantizer to which the iterations converge ([56, 27]). For more general distributions, however, cell boundaries and centroids can stabilize at a suboptimal partition.
Quantization theory. Classical centroid stationarity ([39, 36]) yields the numerical-integration bound
for residual energy ([47, 48]), with extensions by Lemaire et al. [32]. We use Zador’s asymptotic formula ([60, 61]) in its general formulation ([22]) and the extended Pierce bound ([50, 38]). Separate theories address equal-mass rates ([18, 59, 4]) and empirical-quantizer consistency and stability ([3, 35] (Levrard 2015)). Gauss quadrature matches polynomial moments ((NIST, n.d., Section 3.5(v))), with nodes and weights computable by an eigenvalue algorithm ([20]).
Sliced transport and compressed comparisons. Sliced transport ([51]) led to sliced and Radon barycenters ([7]), analytic comparisons with full-dimensional Wasserstein distances ((Bonnotte, 2013)), and statistical and projection-sampling guarantees ([41, 44, 55] (Nierte et al. 2022)). Closest to our analysis are Gaussian projection summaries ([42]), transport between -means summaries ([5]), common-codebook quantization ([17]), and Voronoi and other structured approximations of individual measures ([24]). These approaches control individual approximation errors, yielding pairwise-distance bounds through the triangle inequality. Our identity instead resolves residual and boundary contributions for centroid sketches with different mass partitions.
Distribution sketches and embeddings. Stream-SW ([43]) combines shared directions, KLL rank sketches ([26]), and exact one-dimensional transport, supporting streaming updates with probabilistic bounds involving the support diameter. We instead solve offline quantization and record its distortion. Sliced Wasserstein kernels and continuous feature maps ([29]) precede finite quantile-grid embeddings with Euclidean comparison ([40, 37, 10]); the cumulative distribution transform uses transport maps relative to a reference. [49]. Equal-mass cell means minimize quadratic transport error under prescribed equal weights [59, 4]. Related summaries include midpoint grids and smooth piecewise-linear reconstruction for federated statistics [11], geometric coresets using one-dimensional clustering [25], and full-dimensional uniform-weight Wasserstein coresets [12]. Directional moment reconstruction is polynomial recovery [6], combined with GMM summaries and least squares by Liu et al. [34]; it differs from identifying an entire law through projections [13, 14].
W2-Optimal Sketches
Notation. Let denote probability measures with finite second moment. For let be its distribution function and , , its quantile function, so that is nondecreasing and, for ,
where and denote the norm and inner product. This is the classical monotone-coupling formula [15]; see Santambrogio [52] for a modern treatment.
One-dimensional building block
For and , we denote an optimal -atom quantizer by , with optimal error :
Write , where , , and . Nearest-neighbor cells are intervals, separated by midpoints of adjacent atoms; a consistent assignment handles ties. Their preimages under are consecutive mass intervals . Optimality gives the centroid condition
For weighted input , the problem is exactly weighted -means on after sorting and merging duplicate locations. Exact dynamic programming takes time after sorting using SMAWK to exploit the Monge cost structure [57, 23, 54]. Our implementation uses the simpler divide-and-conquer variant, retaining traceback storage per slice, and includes an oracle for verification (Section B). This gives a global optimum of the discrete objective, whereas Lloyd–Max iterations need additional assumptions for such a guarantee [16, 56, 27]. Figure 2 compares prescribed and optimized cell masses on a real projection.

Figure 2. Equal-mass and optimal cells () for one AML cytometry subject’s side-scatter channel ( cells; § 5). Atoms are cell means of ; the shaded residual has energy . At the equal-mass boundary, differs from the atom midpoint, so the cells are not nearest-neighbour cells. The optimal boundary satisfies the midpoint condition and lowers energy by 63%.
Centroid sketches
The distance analysis uses only the centroid condition, covering summaries with prescribed mass partitions.
Definition 1 (centroid sketch). A centroid sketch of with cells is a partition of into intervals together with the cell means , . Its step quantile is , its measure is , its residual is , its quantization error is , and its residual energy is .
Since is nondecreasing, so is , and moreover . The monotone coupling gives , and the residual integrates to zero on every cell. We use to denote the chosen sketch, suppressing its dependence on the partition and cell count. Every -cell sketch satisfies . Equality holds for the optimal quantizer , whose cells are optimal clusters. The equal-mass sketch (the optimal equal-weight approximation; [59, 4]) and all Lloyd fixed points are centroid sketches.
Sliced sketch and comparison
For and a fixed set of shared directions , write and define
With atoms per slice, the sketch stores scalars: atom locations and all but one weight per slice, in addition to the shared directions. Recording one residual energy per slice increases this to scalars; recording all per-cell energies instead requires . Each projection is quantized independently, and comparisons use the resulting one-dimensional summaries directly, making it ideal for parallel computing.
Each summand in (3) compares sorted weighted atoms. Its monotone coupling has at most nonzero flows and is computed by a two-pointer sweep in time, giving per query. For input points, construction using the SMAWK-based exact solver takes time, with the three terms accounting for projection, sorting, and quantization, respectively ([57, 23]). We note that the divide-and-conquer implementation in Grønlund et al. [23] takes for the quantization step.
The reference distance uses the same directions:
§ 4 bounds its discrepancy from . This separates sketching error from the approximation incurred by using finitely many directions [41].
Choice of slices. The distance analysis of § 4 is carried out slice by slice and uses no property of the maps beyond their being shared by all measures. The identity, the certificates, and Theorem 4 therefore hold unchanged when the directions are learned from data, or when the linear maps are replaced by shared measurable maps with ; the reference is then the sliced distance on those slices. Theorem 5 holds for learned unit directions. The moment recovery of Theorem 6 requires linear slices in general position.
Theory
Throughout, have centroid sketches with cells , atoms (for ) and , atoms (for ), written with cells each to simplify notation. For unequal cell counts, each sum runs over the boundaries of its own sketch. Let be the squared sketch distance and
Because each residual has zero mean on each of its own cells, vanishes at every and at every ; for one has .
Exact sketch distance identity
Theorem 2 (partition-mismatch identity). *For any two centroid sketches of ,
Proof. By (1), . Since is constant on each and integrates to zero there, ; likewise . Hence the cross term is . Abel summation with gives , and symmetrically for .
Figure 3 illustrates the identity. The residual term is nonnegative and at most . The boundary terms have the opposite sign since monotonicity of each quantile implies , while the atom increments are nonnegative. These terms vanish on a shared partition and account for possible expansion of the sketch distance when partitions differ. Unlike a triangle-inequality bound [5, 42], the identity (5) distinguishes underestimation from overestimation.
Figure 3. Partition-mismatch identity (5) for forward-scatter projections of a normal and a leukaemia subject in the AML cytometry data ( cells each; § 5), with optimal sketches. Top and middle: quantiles, step quantiles, and shaded residuals; sketch cells differ. Bottom: residual primitives (4), each zero at its own cell boundaries. Dots pair each sketch’s jumps with the other’s primitive at the same boundary. Here , comprising and boundary terms and .
Corollary 3 (computable distance certificates). Write , , , and let be the largest cell masses. Define
If per-cell energies are stored, define, for ,
with value zero at cell boundaries, and define analogously. The refined boundary budget is
For , or when available,
and, writing ,
For unequal cell counts, each sum runs over the interior boundaries of its own sketch.
The general budget uses one residual energy per slice; the refinement uses per-cell energies and a linear sweep of both mass partitions. Per-cell energies also support higher-moment correction (Theorem 6). Lipschitz quantiles with maximum cell mass yield squared-distance error. Section A.2 gives explicit bounds and verifies these conditions for optimal quantizers of densities bounded above and away from zero on compact intervals. The proof is in Section A.1.
The boundary budget is not generally : Theorem 10 (Section A.3) attains the scale allowed by when .
Sliced certificates
Theorem 4 (sliced certificate). Let be shared, and equip each with centroid sketches having residual errors . Write for their comparison and let be any corresponding boundary budget from Theorem 3 or Theorem 7. With and defined analogously,
The squared bounds follow by averaging the per-slice certificates and applying Minkowski’s inequality. The unsquared bound is the triangle inequality in the product of the slice spaces, as in Nadjahi et al. [42].
Sampling and direction error. If the inputs are empirical measures , the sketches are built from them, and their comparison differs from the population distance for two reasons: the quantization of the empirical slices, and the sampling error of the slices themselves. Let be the residual errors of the sketches of , and let
be the sliced distance between the empirical and population projections of , with defined similarly. Theorem 4, applied to the empirical inputs, bounds the quantization error by , and the triangle inequality for bounds the sampling error by :
The first two terms are read off the sketches; the last two are not observable and depend on the sample sizes and the data. This deterministic decomposition therefore leaves sampling rates to the assumptions on the data (Nadjahi et al. [41]; Nietert et al. [45]). For independent uniformly sampled directions, put . The Monte Carlo estimate satisfies (Nadjahi et al. [41])
Finite second moments suffice here because is bounded uniformly in . The corresponding expected unsquared error is also , with a moment-dependent constant; details are in Section A.
Rates: free weights vs. equal-mass cells
Theorem 5 (sliced quantization complexity). If satisfies for some , then for the optimal-quantizer sketch
hence for every , for a universal constant .
See Theorem 11 in Section A.6 for more details.
Moments
A sketch is also a summary of each projected distribution, so a natural question is how well its directional moments, and the moment tensors of assembled from them across directions, match those of the input. The next proposition shows that the mean of every slice is exact, that the second-moment deficit equals the stored residual energy, and that the error in higher moments is controlled by that energy, with a sharper bound when per-cell energies are stored; combining the slices by least squares then bounds the error of the recovered moment tensors.
Proposition 6 (moment recovery). Let and, for a unit direction , couple in law with its centroid sketch through their quantiles. Write ; on the chosen directions, as in Theorem 4. Then
and for with bounded second derivative. If almost surely, with , then for every integer , writing and ,
with for even . For quantile cells with centroids , let
If these per-cell energies are stored, define
Then and, whenever almost surely, for ,
For , let on symmetric -tensors. If has full column rank, the least-squares reconstructions from the uncorrected and corrected moment vectors satisfy
Full rank holds for generic directions [6]. Without bounded support, the mean is still recovered exactly from spanning directions, and storing one total residual energy per slice recovers the covariance exactly from slices.
The centroid identities and the weak-error bound are classical [48, 32]. For every fixed order, gives moment error; the correction improves this if also , as under the bounded-density hypotheses of Theorem 8. Per-cell energies are the metadata used in Theorem 3; no higher residual moments are required. Combining the identities with least squares gives a deterministic error bound for the sliced-moment construction also used by Liu et al. [34]. Exactness concerns the measure being sketched, hence empirical moments for empirical inputs.
Experiments
Classification. We evaluate distribution classification on five document datasets [30, 53], AML patient samples [2 ) represented by cell measurements, and ModelNet40 {citep}][58] point clouds (Table 1). All sliced methods use the same linear projections, learned and then frozen. We compare the uncompressed sliced distance, optimal sketches, and equal-mass sketches with the same number of atoms . Equal-mass sketches use quantile intervals of fixed mass , while ours adapt the interval masses to minimize quantization error. Classification uses nearest neighbours on each distance. For each benchmark, we select the smallest for which the optimal sketch is within 0.5 percentage points of the uncompressed validation accuracy. Optimal and equal-mass sketches store and values, respectively, compared with for uncompressed projections. We also report exact optimal transport with Euclidean ground cost (Word Mover’s Distance for documents) and the Bures–Wasserstein distance (BW) between Gaussian approximations defined by each distribution’s mean and covariance. These baselines are unsupervised, whereas our projections use training labels. We provide implementation details for all experiments in Section B, and ablations in Section D.1.
| benchmark | BW | Exact OT | unc. | equal-mass | ours | error ratio | |
| \multicolumn{8}{c}{test error ()} | |||||||
| BBCSport | |||||||
| Classic | |||||||
| Recipe | |||||||
| Reuters | |||||||
| \multicolumn{8}{c}{accuracy ()} | |||||||
| AML | |||||||
| ModelNet40 |
Table 1. Classification with shared learned slices. : points per distribution (mean distinct words for documents); : smallest optimal-sketch size matching uncompressed validation accuracy within 0.5 percentage points, also used for equal mass sketches. Scores are percentages. Bold marks the best method, and * a significant paired difference between ours and equal-mass. Error ratio: median equal mass/optimal quantization energy. (error ratio shows that equal-mass results in larger error compared to ours.)
Optimal sketches store only 48–240 values per distribution while remaining within 0.3 percentage points of the uncompressed test score on all seven benchmarks. This corresponds to storage reductions of 1.5–18× for documents, 68× for point clouds, and over 3000× for AML samples. At the same , optimal sketches outperform equal-mass sketches on all seven benchmarks, with statistically significant differences on Classic, Recipe, AML, and ModelNet40. Optimal sketches also outperform the exact transport baselines on five benchmarks. Sketches are also more accurate than BW on six benchmarks.
Learning from few subjects. Sketch embeddings also support classification when labelled distributions are scarce. On AML, each subject is represented on random slices of its cells, either by the uncompressed sorted projections or by a sketch: the atoms and masses of every slice for the optimal sketch, and cell means, the same number, for equal-mass cells. We report results for and , resulting in stored values 96 and 480, respectively. As a baseline, we concatenate each subject’s empirical mean and the unique entries of its covariance matrix in the original cell-feature space. Inside each of the 25 training folds of Table 1 we draw 2, 4, 8 or 16 AML subjects with normal subjects in the ratio of the dataset, ten times, and fit class-balanced -regularized logistic regression. Table 2 reports the test AUC, and a linear SVM leads to the same conclusions (Section D.2). Every representation reaches a training AUC of 1, while their test AUCs reveal differences in generalization to held-out subjects.
| summary | stored values | 2 | 4 | 8 | 16 | all |
| AML subjects in training | ||||||
| uncompressed | 320,000 | |||||
| mean, covariance | 35 | |||||
| equal-mass | 96 | |||||
| ours | 96 | |||||
| equal-mass | 480 | |||||
| ours | 480 |
Table 2. AML, logistic regression from few labelled subjects. Test AUC (%), mean standard error over the 25 folds, with ten draws of the training subjects per fold. random slices (seed 0), cells. Normal subjects are added in the ratio of the dataset; “all” is the whole training fold, about 34 AML subjects. Stored values: number of values stored per subject. Linear SVM in Table 5.
The optimal sketch has a higher test AUC than the uncompressed representation at every training size, demonstrating an advantage when labelled subjects are scarce. The sketch provides a compact, adaptive representation that generalizes better with the same linear classifier. The improvement is not explained by feature count alone. Equal-mass cells at matched storage remain within 1.2 points of the uncompressed representation, and mean and covariance features do not consistently improve on it. These results suggest that the adaptive representation contributes to the observed generalization gains beyond dimensionality reduction alone.
Sketches as a pooling layer. The sketch can also serve as the pooling layer of a network trained end to end. We follow the ModelNet40 protocol and official code of Naderializadeh et al. [40]. We use a per-point MLP, or no backbone (Identity)([62]), learned linear slices of its output, a pooling layer, and a linear classifier. Their PSWE layer is an equal-mass summary at full resolution (1024 cells per slice) followed by learned rank weights that reduce each slice to one number. We apply the same layer, with the same reference and rank weights, to a sketch with 4 cells per slice, either equal-mass cells or the optimal sketch, so the two sketches differ only in their partition. For both sketches reproduce PSWE. We therefore only compare the two sketches at . The optimal sketch is computed exactly in every forward pass; gradients flow through its atoms, which are cell means, while the partition is held fixed.
Without a backbone the slices act on the raw coordinates, and the optimal sketch is more accurate than equal-mass cells at every , by 1.7 to 4.6 points (Figure 4). With the MLP backbone it is more accurate for , by 0.4 to 1.5 points, and less accurate at , where it varies most across seeds. With the MLP backbone, the optimal sketch comes within 2.5 points of PMA and 1.8 points of FSPool [63] at , against 4.0 and 3.4 points for equal-mass cells, while representing each projected distribution with four cells. Without a backbone, these layers output only three numbers per cloud and reach at most 34%, while the optimal sketch reaches 80% at .

Figure 4. ModelNet40, following [40]: no backbone (top), and MLP backbone (bottom). Test accuracy (%), mean and standard deviation (error bars) over 3 seeds. Equal-mass and ours: sketches with cells per slice; the number above each pair is ours minus equal-mass. Lines: GAP, PMA and FSPool, which use no slices, with one standard deviation shaded.
Conclusion
We studied compact sliced-Wasserstein sketches via optimal one-dimensional quantization. Our partition-mismatch identity characterizes how independently chosen cells affect pairwise distances and yields error certificates for centroid sketches. Experiments show that optimal sketches can preserve uncompressed sliced-distance classification performance under substantial compression. Minimizing quantization error does not guarantee the best distance approximation or downstream performance, and adaptive sketches require more storage than equal-mass sketches at the same atom count. Future work targets faster construction and sharper distance-error guarantees for optimal quantizers.
Acknowledgments
This work was supported in part by NSF CAREER Award No. 233989 and NSF DMS Award No. 2603773. The authors also gratefully acknowledge the computing resources provided by the NVIDIA Academic Grant Program.
Proofs
Proof of cor:certificates
Write the boundary term of (5) as
so that . For a cell with centroid , the zero-cell-mean condition gives for . For , the average of a nondecreasing function over is no larger than its average over , so ; the primitive is zero at both endpoints. The same holds for . Since all atom increments are nonnegative, .
Using , write
The squared norm of the function in parentheses is . Cauchy–Schwarz therefore gives
and the analogous bounds hold for . Summing against the nonnegative atom increments, whose sums are and , yields and . Together with , this proves (8) for either budget. Taking square roots yields , and the triangle inequality gives , proving (9). To evaluate , each boundary of must be located in its containing cell of . Since both boundary lists are sorted, is nondecreasing in , so a single merge of the two lists finds every ; the same merge with the roles of and exchanged locates every in a cell of . Hence costs time. □
Regularity refinements of cor:certificates
Here we illustrate how Theorem 3 can be strengthened when more assumptions are made on the quantiles. While this is not directly applicable to discrete measures, it provides some intuition for the more general approximation scheme considered here.
Corollary 7 (Lipschitz quantiles). Suppose are Lipschitz with constants . Then the boundary budget
may replace in (8) and (9). Furthermore, for , and consequently
For fixed Lipschitz constants, this is whenever both largest cell masses are .
Proof. Write for the sum of the two boundary terms in (5), so that . On a cell , the centroid formula gives
Since and the atom increments are nonnegative with sum ,
The same argument with the roles of and exchanged bounds the second sum in by . Adding the two bounds gives , so the proof of Theorem 3 applies with in place of . For the energy, the variance identity on a cell of mass gives
Summing over cells and using yields ; the argument for is identical. The absolute bound follows from (8) and the resulting bound on .
Lemma 8 (widths of optimal quantization cells). Let have density with almost everywhere on an interval of length , vanishing outside it. For , every optimal free-weight -atom quadratic quantizer has clipped Voronoi cells of width at most , where . Thus
where is the quantile coupling of with its sketch. Also, is -Lipschitz.
Proof. An optimum uses exactly nonempty cells: otherwise, splitting any positive-width cell into two and replacing its centroid by the two conditional centroids strictly reduces the error while using at most atoms. The cells partition the support interval, up to endpoints, and each atom is its cell centroid.
Fix a cell of width and mass . Split it at its midpoint into halves with masses and centroids . On a half of length , the centroid’s distance from the inner endpoint is at least , so . By the decomposition , where is the centroid of , replacing by its two halves decreases the distortion by
Excluding , the remaining cells form at most two chains and contain at least disjoint adjacent pairs. Their widths sum to at most , so one pair has combined width , using . Merging that pair into one cell at its centroid increases the distortion by . Splitting and merging this disjoint pair gives a competitor with cells, so optimality forces , hence . Its mass is at most , proving the mass bound. As the centroid lies in its cell, the same width bound controls almost surely. Finally, equally spaced midpoint representatives on the support interval have pointwise nearest-neighbour error at most ; assigning each point to its nearest representative gives an admissible free-weight quantizer, so optimality gives . The lower density bound gives on the support interval, and inverting gives the Lipschitz bound on .
Corollary 9 (optimal sketches of bounded densities). For , suppose has density almost everywhere on an interval of length , vanishing outside it. Put and . If both sketches are optimal free-weight quantizers with atoms, then , where
Proof. Theorem 8 gives , a Lipschitz constant for , and . Since every centroid is in the support interval, . Thus and , and (8) with the budget of Theorem 7 gives the result.
Sharpness of the boundary budget
The following example shows that the boundary budget of Theorem 3 cannot in general be replaced by a constant multiple of .
Example 10 (sharpness for general centroid sketches). Let and use its equal-mass sketch with even. The middle boundary is , with atom jump . Set and
For the equal-mass sketch of with cells, the middle cell consists exactly of the two added atoms. Its centroid is zero, so . The other boundary terms together are : away from the central jump the quantiles are linear with bounded slopes, while the two central boundaries of the second sketch lie in cells of with residual integrals . The residual term is also . Thus
whereas and . This is a sequence of pairs with general centroid sketches, checked numerically in Section C. Whether an gap holds for all pairs of optimal sketches with remains open.
Proof of Theorem 4
Average (8) over the slices. Minkowski’s inequality gives
which proves the signed squared bounds. For the unsquared bound, apply the reverse triangle inequality to the Euclidean norms of the vectors of slice distances, and then use the fact that .
For empirical inputs, the same product-space triangle inequality gives
This holds for any empirical measures; independence and sampling assumptions enter only when bounding statistically.
For the Monte Carlo statement, put and . Independence gives . Also
so . Cauchy–Schwarz gives the squared-error claim. If ,
If , almost surely and the error is zero. These are the usual projection-sampling bounds [41].
Proof of thm:rate
Fix and let . The extended Pierce lemma [38 Lemma 1] states that for every there is a constant such that for every real random variable and every ,
where is the nearest-neighbour projection onto the finite set ; the left side is . Apply it to and use , so uniformly in . Averaging over gives the bound on . (Translating by any fixed vector does not change , so may be replaced by ; see [32 Thm. 1.9(b].) The limit statement is Zador’s theorem in one dimension [22 Thm. 6.2], valid under the same moment condition, which also guarantees . Note that a finite second moment alone does not guarantee the stated rate [22].
Equal-mass approximation rates
The following proposition compares the equal-mass sketch with the optimal quantizer of a single one-dimensional law , such as a projection . Write for the error of its -cell equal-mass sketch and for the optimal -atom error. Since equal weights are admissible, for every .
Proposition 11 (equal-mass and optimal rates). Let have density and an absolutely continuous quantile function.
(a) If , then
(b) If, in addition, has a finite moment of order for some , then
with equality if and only if is uniform on an interval.
(c) If is a nondegenerate Gaussian, then
whereas
(d) If is the projection of the uniform distribution on the unit ball of onto a line, so that on , then
and
with constants depending on .
In (c), and in (d) for , , so (a) does not apply and the equal-mass rate is slower than . The cost comes from low-density cells: in the Gaussian tail and near the endpoints of the ball projection, a cell of mass must be wide. The Gaussian rate in (c) is sharp along by Giles et al. [18].
Proof. (a): For prescribed cell masses, the best approximation uses cell means of the quantile function [59 Theorem 5.5]. Indeed, these are the projection onto the space of functions constant on the prescribed intervals, and the resulting cell means remain nondecreasing. Hence the equal-mass residual error is the optimal error among measures with equal weights. Absolute continuity of the quantile and the stated integrability condition allow [59 Theorem 5.15] to be applied with .
(b) Under the moment condition, Zador’s theorem in one dimension [22 Thm. 6.2] gives
To compare this constant with the one in (a), apply Hölder’s inequality with exponents 3 and to on :
Cubing gives the stated inequality; it is trivial when . Equality in Hölder’s inequality holds if and only if and are proportional on , that is, is constant there. An absolutely continuous quantile function has no jumps, so is an interval up to a null set, and equality holds exactly when is uniform on an interval. This comparison concerns the limiting constants, not the errors at finite .
(c) By symmetry and scaling it suffices to treat the upper tail of . Number the equal-mass cells from the right, so that cell has tail probabilities . The outermost cell is the tail beyond , with , and the conditional variance of a Gaussian tail beyond is for large . This cell alone contributes , which gives the lower bound. For , cell lies to the right of , and for . By the Mills-ratio bounds
for [21], its width is , and its conditional variance is at most the square of its width. The cells with lie in , where the density is at least , so each has width and together they contribute . Hence
since the sum is dominated by , where .
(d): For the uniform ball, symmetry reduces the calculation to . There , with constants depending on . Thus the upper-tail mass satisfies . Put and number the equal-mass cells from the right. For , cell covers tail probabilities and has width
For this follows directly from the tail-mass relation. For , it follows by integrating the derivative of the inverse tail function, whose magnitude is comparable to . The conditional variance on each cell is comparable to : its upper bound is , and a lower bound with a positive -dependent constant follows by comparison with the density and rescaling the cell. For this power density the normalized variance is bounded away from zero, including at the endpoint.
Each cell has mass , so symmetry yields
where any remaining central cell has bounded density and contributes at most . The sum is bounded for , grows like for , and grows like for . Substitution gives the three stated squared-error rates. Zador’s formula gives with a finite positive constant for every fixed .
Proof of prop:moments
Fix and suppress it from the notation for simplicity. Let be uniform on and set and . Thus has the law of , has the sketch law, and this coupling realizes the one-dimensional quadratic Wasserstein distance. Let when , write , and let . By the centroid condition,
For , it follows that . Conditional Jensen gives ; hence . Consequently,
These prove (12), since [32 Prop. 1.7, Cor. 1.8].
For with bounded second derivative, Taylor’s formula with integral remainder gives
Bounded implies that has at most linear growth and at most quadratic growth. Thus all terms are integrable, and
Taking expectations and using proves [47, 48, 32]. This argument uses only the centroid condition, not global optimality.
Now assume almost surely. Since is a unit vector, almost surely, and (18) implies almost surely. The segment between and therefore lies in . Applying the same Taylor argument to on this interval, where , proves (13). For even , is convex on , so conditional Jensen also gives
Taking expectations proves the asserted one-sided inequality.
To establish the correction, observe that
In particular, these are unnormalized per-cell energies; the conditional variance in cell is . Since on ,
For , formula (14) therefore coincides with (12) and is exact. For , Taylor’s formula through the quadratic term gives
As and ,
The linear term again has zero expectation. The expectation of the first and quadratic terms is exactly , and hence
If almost surely, then , which proves (15). Such a bound always exists under bounded support, since ; the sharper rate below requires a bound that decreases with .
For completeness, the exact moment decomposition underlying this correction is
It follows by binomial expansion and . The correction retains only the term, and (20) bounds the omitted terms jointly. It therefore requires no evaluation of residual moments of order three or higher.
Next let carry the Frobenius inner product, and let carry the Euclidean inner product. For
Thus the true moment vector satisfies . Define
If has full column rank, then is the identity on . Therefore, for either input moment vector and its least-squares reconstruction ,
Applying the coordinatewise bounds (13) and (15) proves (16) and (17), respectively. Here .
To verify the generic rank claim, put . The tensors , , span this space. Indeed, a symmetric tensor orthogonal to all of them defines the homogeneous polynomial , which vanishes on the sphere. Homogeneity implies that vanishes on all of , and uniqueness of polynomial coefficients gives . Consequently, some directions yield an invertible evaluation matrix. In a fixed basis, its determinant is a polynomial in the direction coordinates and does not vanish identically on . For , its zero set is a proper algebraic subset of this product and has product surface measure zero; this is the exceptional set excluded by “generic.” For , and every unit direction already gives a nonzero evaluation. Adding rows preserves full column rank. This is the polynomial reconstruction argument of Bodmann et al. [6].
Finally, exact mean and covariance recovery require only . The directional means are , so spanning directions determine uniquely. From the stored total residual energies and (12), the directional second moments are known exactly. If is injective, these determine exactly. Injectivity of also implies that the directions span : otherwise, for a nonzero orthogonal to every direction,
contradicting injectivity. The mean is therefore also recovered, and is exact. The generic rank result with requires .
For the stated rates, fix , , and the directions. The bound in (13) gives error, while together with (15) gives error. Under the bounded-density assumptions of Theorem 8, every optimal Voronoi cell intersected with the support has width . Each centroid lies within its cell, so almost surely. A uniform grid on the bounded support gives squared distortion ; optimality gives the same upper bound for the optimal quantizer. Thus both conditions hold in that setting. For fixed directions with injective, the corresponding tensor bounds inherit the same rates. All identities refer to the law being quantized; if that law is empirical, they recover or approximate its empirical moments.
Implementation details
This section gives the implementation details needed to reproduce the experiments of § 5. Benchmark experiments ran on a server with 128 logical cores and four NVIDIA RTX A5000 GPUs.
Main components. The optimal sketch of a slice is computed by exact dynamic programming. Weights are normalized to sum to one, zero-weight points are removed, and duplicate locations are merged after sorting; if at most distinct locations remain, the slice is returned unchanged. Sketch distances are computed by a monotone sweep that transports the smaller of the two current atom masses and advances the exhausted atom, in time per slice. Uncompressed sliced distances use the same sweep on the sorted projections, or the mean squared difference of sorted projections when all distributions have the same number of equally weighted points.
Classification (Table 1). Documents (Kusner et al., [30]) are bags of 300-dimensional word embeddings, normalized to unit length and weighted by normalized word counts. We use the five provided train/test splits (one for Reuters) and hold out 20% of each training split for validation. AML subjects (Aghaeepoor et al., [2]) are represented by randomly subsampled cells of tube 6 with all 7 channels, each standardized with the mean and standard deviation of the training subjects of the fold. Validation scores come from a stratified 5-fold cross-validation inside each training fold. For ModelNet40 shapes (Wu et al., [58]) we use the official train/test split and hold out 20% of the training shapes for validation. Table entries are means and standard deviations over splits or folds. A star marks a paired difference between ours and equal-mass: a paired -test over the five document splits (5% level), a mean difference larger than two standard errors over the 25 AML folds, and a 95% paired bootstrap interval over the test shapes of ModelNet40 (1000 resamples) that excludes zero. The error ratio is the median over distributions and slices of the ratio of the equal-mass to the optimal residual energy, averaged over splits or folds.
The slices are linear maps with rows normalized to unit length, trained on the training split only (without the validation part) with the neighbourhood-component loss (Goldberger et al., [19]): a softmax over to the other distributions of the batch, with a learned scale . We use Adam with learning rate . For documents and ModelNet40, batches have 256 distributions, distances during training use 64 quantile levels, and training runs for at most 3000 steps with early stopping on the validation NN error. For AML, the slices are trained on the training part of the first inner fold, with early stopping on its validation part. Each step uses all of these subjects, represented by random subsets of 512 cells, for at most 300 steps. The five-fold validation scores used to choose and therefore include subjects seen during slice training, and test subjects are never used. The slices are then frozen and shared by all methods. Each distance is used in a -nearest-neighbour classifier, with chosen on validation.
For documents, WMD uses the precomputed distances of Sato et al. [53]. For AML and ModelNet40, exact with Euclidean cost is computed by a network-simplex solver on the first cells and the first 256 points, respectively. All baselines use the same splits, validation and NN classifier.
Learning from few subjects (Table 2 and Table 5). This experiment uses the AML subjects ( cells) and the 25 folds of Table 1, with random directions (seed 0) shared by all subjects. A subject is represented by a feature vector: its sorted projections (uncompressed); for every slice, the atoms and masses of the optimal sketch (ours) or the cell means of equal-mass cells (equal-mass). Inside each training fold, we draw 2, 4, 8 or 16 AML subjects together with normal subjects in the ratio of the dataset, ten times per size; “all” uses the whole training fold. On each draw we fit a class-balanced, -regularized logistic regression with penalty or linear SVM, with one regularization setting for all representations, and compute the AUC on the test subjects of the fold. Tables report the mean and standard error over the 25 folds.
| summary | stored values | 2 | 4 | 8 | 16 | all |
| AML subjects in training | ||||||
| uncompressed | 320,000 | 92.2 ± 0.6 | 94.9 ± 0.4 | 96.8 ± 0.4 | 97.9 ± 0.4 | 98.5 ± 0.4 |
| mean, covariance | 35 | 92.6 ± 0.7 | 95.4 ± 0.6 | 96.1 ± 0.7 | 97.0 ± 0.6 | 97.2 ± 0.5 |
| equal-mass | 96 | 91.2 ± 0.7 | 93.7 ± 0.4 | 95.7 ± 0.5 | 96.7 ± 0.5 | 97.8 ± 0.5 |
| ours | 96 | 96.1 ± 0.4 | 97.4 ± 0.3 | 98.4 ± 0.2 | 99.0 ± 0.2 | 99.4 ± 0.2 |
| equal-mass | 480 | 92.0 ± 0.6 | 94.7 ± 0.4 | 96.7 ± 0.4 | 97.8 ± 0.4 | 98.4 ± 0.4 |
| ours | 480 | 96.2 ± 0.4 | 97.5 ± 0.3 | 98.2 ± 0.3 | 98.8 ± 0.3 | 98.9 ± 0.3 |
Table 5. AML, linear SVM from few labelled subjects. As Table 2, with a class-balanced linear SVM in place of logistic regression. Stored values: number of values stored per subject.
Pooling layer (Figure 4). We use the official code and ModelNet40 protocol of Naderializadeh et al. [40] and change only the pooling layer. We report the test accuracy after the last epoch, computed as in their code (mean over test batches of 32 shapes), as mean and standard deviation over three seeds. The PSWE layer compares the sorted projections of each slice with a learned reference of 1024 values and reduces the differences with 1024 learned weights to one number per slice. Our variants replace the sorted projections by the step quantile of a sketch with cells, i.e., each projected point is replaced by the mean of its cell, using equal-mass cells (256 points each) or the optimal partition. GAP, PMA (Lee et al. [31]) and FSpool (Zhang et al. [63]) are taken from the same code and pool the backbone features directly.
Numerical validation of the theoretical results
We give a separate numerical check of every theorem, proposition, corollary, lemma and example in the paper. These experiments check exact identities and finite inequalities, and illustrate the asymptotic statements on distributions whose assumptions are known analytically. Finite computations do not establish a universal bound or an asymptotic theorem. In particular, an upper bound need not be attained. Table 3 maps the results to the experiments and their recorded data.
| Result | Numerical check | Recorded CSV files |
| Theorem 2 | Independent residual/boundary decomposition; both signs of the distance gap | certificates_atomic |
| Theorem 3 | , signed bounds and complete distance interval | certificates_atomic |
| Theorem 4 | Averaged signed and unsquared bounds; shared linear and nonlinear maps | certificates_sliced |
| Theorem 5 | Pierce scaling, Gaussian sphere supremum, Zador constants | continuous_rates, sliced_rate |
| Theorem 11 | Gaussian and all three ball-projection rate regimes | continuous_rates |
| Theorem 7 | Known quantile Lipschitz constants and nonmatching cells | lipschitz |
| Theorem 8 | Optimal-cell width, mass, pointwise error and residual bounds | cell_widths |
| Theorem 9 | Squared-distance gap and the stated constant | bounded_density |
| Theorem 10 | ; expansion exceeds | sharpness |
| Theorem 6 | Scalar/tensor bounds, correction, exact recovery, rank and conditioning | moments_scalar, moments_tensor, moments_rates, moments_gaussian_recovery, moments_rank, moments_conditioning |
| Sampling/directions | Empirical-population decomposition and Monte Carlo errors | certificates_sampling, certificates_directions |
Table 3. Theory-to-experiment correspondence. CSV files are in results/theory_validation/; all are regenerated by one command.
Partition mismatch and computable certificates
Identity (Theorem 2). We generate weighted Gaussian, separated-mixture, Student-, atomic and degenerate pairs, with 37–60 and 48–71 input points. The inputs include duplicate locations and zero weights. For each of 24 trials per family, we use optimal sketches, equal-mass sketches, a shared nonuniform mass partition, and two independently chosen nonuniform partitions. The first cell count cycles through 1, 2, 4, 8; the optimal and independent-partition pairs use one additional cell for the second measure. Nonuniform
masses are Dirichlet with parameter 2 per cell. Optimal sketches may use fewer atoms when the input support is small.
All quantile integrals are finite sums on the common refinement of the two input and two sketch partitions. The distance gap, residual norm, boundary terms and per-cell energies are evaluated separately, and the resulting energies and transport costs are checked against the production routines. Across 480 pairs, the largest identity discrepancy divided by is . There are 142 expansions and 230 contractions exceeding absolute tolerance , with the remaining cases numerically exact. Residual primitives are nonpositive and vanish at their own cell boundaries; shared partitions have zero boundary term and contract the distance. As construction checks, 24 small problems agree with exhaustive contiguous-partition enumeration, and an atomic input is recovered exactly once the budget reaches its support size.
Certificates (Theorem 3). On the same pairs we independently evaluate , , both signed inequalities and both endpoints of (9). No inequality is violated beyond the scaled tolerance ; the largest positive scaled discrepancy is . Figure 5 displays the identity and the location of each nonexact optimal-sketch gap within its certified interval. Pairs with below the tolerance, which are recovered exactly, remain checked but are omitted from both normalized panels.
Figure 5. Exact atomic identity and certificate checks, and direction sampling. Left: independently computed sides of the identity coincide. Middle: the signed gap lies in , rescaled to . Right: Monte Carlo mean absolute errors with bars of two standard errors over 8, 192 independent direction sets; the dashed line is the analytic squared-distance bound.
Sliced, sampling and direction certificates
Sliced bounds (Theorem 4). We use 16 weighted pairs in , with 67 and 83 points, and eight shared slices. Three choices give 48 comparisons: random linear directions, linear directions fitted from the mean difference of separate synthetic training samples and then frozen, and shared nonlinear maps . Optimal four-atom sketches are paired with equal-mass five-cell sketches. Both averaged signed bounds and the unsquared bound pass in every case. The data-dependent directions test the theorem’s applicability after selecting shared maps; this is not a test of the equality of a learning algorithm.
Sampling and direction errors. For the deterministic sampling decomposition, two finite weighted populations of 9 and 11 points in make the population reference exactly computable. We draw observations, with 16 repetitions at each size, and build four-atom sketches on eight directions. All 64 errors are below ; the largest ratio is 0.364. This checks the decomposition without imposing a sampling-rate claim.
For direction sampling alone, let and with . Then , and are known exactly. For , we use 8, 192 independent sets of directions. Log–log slopes over are for the squared-distance mean absolute error and for the distance error, consistent with . The script checks the Monte Carlo estimates against the analytic expectation bounds with a five-standard-error allowance; the plot reports two-standard-error bars.
Optimal and equal-mass quantization rates
Continuous numerical protocol. We use and the one-dimensional projections of uniform balls in . Thus there is no empirical quantile grid or sampling floor. Cell masses and first moments are analytic. Optimal quantizers solve the continuous centroid/Voronoi equations for ; global optimality of an exact solution follows from log-concavity for these particular laws [56, 27]. We report finite-precision solutions, not interval-certified optima. The largest centroid residual is . Centered cell integration uses 32 and 64 Gauss nodes, analytic Gaussian tail variances and a change of variables at ball endpoints. The largest relative energy change is . A perturbed initialization, tighter root tolerance and 96 nodes at change optimal energies by at most . These checks are recorded in continuous_refinement.csv.
Free weights (Theorem 5). We plot , where is evaluated analytically. All six curves approach one (Figure 6 and Table 4). For the standard Gaussian . We also compare and on seven equally spaced directions in the plane. Direct transport between the scaled Gaussian centroid sketches is compared with the analytic sliced distance. Its error is below , and stabilizes; the actual error in this example decays faster. For the first Gaussian the sphere supremum is exactly and , so the recorded ratio also directly checks the uniform-direction scaling. We do not estimate the universal Pierce constant from these examples.
Figure 6. Continuous quantization rates. Top left: comparison with analytic Zador constants. Top right: Gaussian squared errors. Bottom left: equal-mass errors under the law-specific normalizations in Table 4; colors match the top-left legend. Bottom right: the cost of prescribing equal masses at the same , on the common range .
| Law | Equal-mass normalization | Rescaled equal-mass error | |
| Gaussian | 0.99597 | 1.07909 | |
| Ball | 1.00000 | 0.33333 | |
| Ball | 0.99939 | 0.40858 | |
| Ball | 0.99892 | 0.07224 | |
| Ball | 0.99827 | 0.11563 | |
| Ball | 0.99755 | 0.03175 |
Table 4. Endpoints of the continuous rate experiment: for optimal quantizers and for equal-mass cells. The last column is the equal-mass squared error multiplied by the stated normalization; it is not claimed to equal its limiting constant.
Equal masses (Theorem 11). Using the same continuous laws, with exact cell boundaries , we extend the equal-mass experiment to . The normalization of the squared error is for the Gaussian, for balls in , for , and for . The rescaled curves remain of constant order, while the equal/free error ratio grows for the Gaussian and . These are finite-range illustrations; logarithmic corrections converge slowly. The uniform law gives identical free and equal-mass errors and the exact rescaled value . For , the finite equal-mass limit is ; the observed at is 0.40858, approaching this constant from below.
Regularity and optimal-cell geometry
Lipschitz quantiles (Theorem 7). Take and , with known constants , . Use equal-mass cells for and alternating masses proportional to
, , for . Polynomial quadrature evaluates the energies and true distance exactly up to rounding. For , both energy bounds and both signed distance bounds hold. Figure 7 shows the predicted squared-distance scale with genuinely mismatched partitions.
Figure 7. Checks under analytic regularity assumptions: polynomial quantiles and their Lipschitz certificate; optimal widths and masses for ; and the squared-distance gap between and with the Lipschitz boundary budget. No empirical quantile is treated as Lipschitz.
Cell widths (Theorem 8). For and on , and are analytic density bounds. For each optimum at , we check the largest clipped Voronoi width, cell mass, pointwise residual and total residual against the lemma’s stated constants. All checks pass. For at , and , illustrating the asserted scales. The quantile Lipschitz bound follows directly from the known density minimum; it is not estimated from samples.
Bounded densities (Theorem 9). We compare the two preceding optimal quantizers and integrate the true quantile distance independently. The explicit constant is , and every squared gap is below . At , . The general constant is conservative: the plot additionally gives the much smaller computable , while the CSV retains the explicit .
Sharpness of the boundary budget
For Theorem 10, we use exactly the stated -dependent pair, with even, , , and equal-mass sketches with and cells. The two quantiles are piecewise affine or constant. Splitting at every atom and cell boundary makes two-point Gaussian quadrature exact for the squared quantities; four-point integration independently checks the result. The energies also agree with the closed forms
For , the rescaled signed gap approaches . At , it equals , while (Figure 8). The remaining terms after the central boundary contribution have bounded scaling, as recorded in the CSV. This experiment concerns general centroid sketches; it does not establish a counterexample for optimal quantizers.
Figure 8. Exact integration of the sharpness family. The expansion decays more slowly than the residual-only budget, its rescaling approaches , and its ratio to grows. The target varies with .
Moment fidelity, correction and recovery
Finite scalar and tensor bounds (Theorem 6). We use three weighted clouds of 181 bounded points in , 30 generic directions, , and optimal, equal-mass and nonuniform prescribed cells. Exact atom/cell intersections give per-cell energies and the actual largest residual . The 17,280 scalar checks cover means, second moments, raw and corrected orders 2–6, even-moment signs, and the bound for , , and . The largest centroid-identity discrepancy is ; all inequalities pass, and the largest corrected-error/bound ratio is 0.192. For the 108 tensor configurations of orders 2–4, the largest uncorrected and corrected ratios are 0.558 and 0.0363. Tensor coordinates use the Frobenius-orthonormal symmetric basis with factors ; the norm is checked independently against explicitly accumulated full tensors.
Moment rates. Let be uniform on and . Twelve directions with angles equally spaced between 0.06 and give increasing polynomial quantiles. We use equal-mass cells for , and degree-exact Gaussian quadrature for all moments. The code directly checks and on this range. For the fourth directional moment, fitted error slopes over are without correction and with correction; the tensor slopes are and . The plotted theoretical budgets scale as and , respectively. The observed corrected error is faster than the asserted upper bound, as can occur for smooth cells.
Exact recovery, rank and conditioning. For an unbounded three-dimensional Gaussian with prescribed mean and positive definite covariance, analytic truncated-normal cell integrals include the two infinite tail cells. With directions and , adding one residual energy per slice recovers the covariance with maximum Frobenius error against the independently specified matrix. Three spanning directions recover the mean with error . The 144 random-direction checks for tensor orders 1–4 give rank . A saved counterexample below the covariance threshold consists of two positive definite Gaussian covariances at Frobenius distance 0.5 with identical variances on five directions up to rounding. Finally, nearly aligned directions remain full rank but amplify perturbations; perturbing in the least singular direction reproduces . The witness matrices, directions and conditioning data are saved.
Figure 9. Moment checks. Left and middle: fourth-order scalar and tensor errors with the bounds of Theorem 6; corrected errors decrease faster than their bounds in this smooth example. Right: covariance errors before and after adding residual energies for an unbounded Gaussian.
Additional experiments
Sweeps over and
Figure 10 to Figure 13 compare the optimal sketch with atoms and equal-mass cells with cells at the same , as in Table 1, on the learned slices and runs behind Table 1, for every and . Every configuration is shown, each with its own chosen on validation, and no further selection is made. The optimal sketch stores numbers per distribution and equal-mass cells . Figure 10 and Figure 11 fix and sweep ; Figure 12 and Figure 13 fix and sweep . Bands are standard errors over splits or folds (documents, AML) and bootstrap 95% intervals over test shapes (ModelNet40); the dotted line is the uncompressed on the same slices. Over the 23 pairs of benchmark and , the optimal sketch is more accurate in all 23 at and in 21 at , by 0.8 and 0.6 points on average; six differences at each are distinguishable in its favour, and one at in favour of equal-mass cells. At it is ahead in 15 pairs, by 2.0 points on average and by 10 points on ModelNet40, but behind on Recipe at every , by 2.3 points. From on, the mean difference is 0.1 points or less, and both rules are close to the uncompressed distance.
Figure 10. Documents, learned slices: optimal sketch with atoms against equal-mass cells with cells, fixed (rows), sweep over ; test error.
Figure 11. AML and ModelNet40, learned slices: optimal sketch with atoms against equal-mass cells with cells, fixed , sweep over ; test accuracy.
Figure 12. Documents, learned slices: optimal sketch with atoms against equal-mass cells with cells, fixed (rows), sweep over ; test error.
Figure 13. AML and ModelNet40, learned slices: optimal sketch with atoms against equal-mass cells with cells, fixed , sweep over ; test accuracy.
Few labelled subjects: linear SVM
Table 5 repeats the comparison of Table 2 with a class-balanced linear SVM in place of logistic regression, on the same slices, folds and draws of training subjects. The conclusions are those of logistic regression. The optimal sketch has a higher test AUC than the uncompressed representation at every training size, and the paired difference falls from points with two AML subjects to with the whole fold.
References
- [1]Alok Aggarwal, Maria M. Klawe, Shlomo Moran, Peter Shor, and Robert Wilber. Geometric applications of a matrix-searching algorithm. Algorithmica, 2:195–208, 1987. doi: 10.1007/BF01840359.DOI
- [2]Nima Aghaeepour, Greg Finak, FlowCAP Consortium, Dream Consortium, Holger Hoos, Tim R Mosmann, Ryan Brinkman, Raphael Gottardo, and Richard H Scheuermann. Critical assessment of automated flow cytometry data analysis techniques. Nature methods, 10(3):228–238, 2013.
- [3]Peter L. Bartlett, Tamás Linder, and Gábor Lugosi. The minimax distortion redundancy in empirical quantizer design. IEEE Transactions on Information Theory, 44(5):1802–1813, 1998. URL https://econ-papers.upf.edu/papers/198.pdf.
- [4]Oumaima Bencheikh and Benjamin Jourdan. Approximation rate in Wasserstein distance of probability measures on the real line by deterministic empirical measures. Journal of Approximation Theory, 274:105684, 2022. doi: 10.1016/j.jat.2021.105684. URL https://arxiv.org/abs/2012.09729.
- [5]Gaspard Beugnot, Aude Genevay, Kristjan Greenewald, and Justin Solomon. Improving approximate optimal transport distances using quantization. In Proceedings of the Thirty-Seventh Conference on Uncertainty in Artificial Intelligence, volume 161 of Proceedings of Machine Learning Research, pages 290–300, 2021. URL https://proceedings.mlr.press/v161/beugnot21a.html.arxiv.org/abs/2102.12731
- [6]Bernhard G. Bodmann, Martin Ehler, and Manuel Gräf. From low- to high-dimensional moments without magic. Journal of Theoretical Probability, 31(4):2167–2193, 2018. doi: 10.1007/s10959-017-0785-x. URL https://link.springer.com/article/10.1007/s10959-017-0785-x.DOI
- [7]Nicolas Bonneel, Julien Rabin, Gabriel Peyré, and Hanspeter Pfister. Sliced and Radon Wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision, 51(1):22–45, 2015. doi: 10.1007/s10851-014-0506-3. URL https://link.springer.com/article/10.1007/s10851-014-0506-3.DOI
- [9]James Donald Bruce. An investigation of optimum quantization. Sc.d. thesis, Massachusetts Institute of Technology, 1964. URL https://dspace.mit.edu/entities/publication/2a8e5a17-f2f9-4ded-a129-c99ec123a7e8.
- [10]Raphaël Carpintero Perez, Sébastien Da Veiga, Josselin Garnier, and Brian Staber. Gaussian process regression with sliced Wasserstein Weisfeiler–Lehman graph kernels. In Proceedings of the 27th International Conference on Artificial Intelligence and Statistics, volume 238 of Proceedings of Machine Learning Research, pages 1297–1305, 2024. URL https://proceedings.mlr.press/v238/carpintero-perez24a.html.arxiv.org/abs/2402.03838
- [11]Arthur Charpentier, Agathe Fernandes Machado, Olivier Côté, and François Hu. Federated measurement of demographic disparities from quantile sketches. arXiv preprint arXiv:2602.18870, 2026. URL https://arxiv.org/abs/2602.18870.
- [12]Sebastian Claici, Aude Genevay, and Justin Solomon. Wasserstein measure coresets. arXiv preprint arXiv:1805.07412, 2018. URL https://arxiv.org/abs/1805.07412. Revised 2020.
- [13]H. Cramér and H. Wold. Some theorems on distribution functions. Journal of the London Mathematical Society, s1-11(4):290–294, 1936. doi: 10.1112/jlms/s1-11.4.290. URL https://londonmathsoc.onlinelibrary.wiley.com/doi/abs/10.1112/jlms/s1-11.4.290.DOI
- [14]Juan Antonio Cuesta-Albertos, Ricardo Fraiman, and Thomas Ransford. A sharp form of the Cramér–Wold theorem. Journal of Theoretical Probability, 20(2):201–209, 2007. doi: 10.1007/s10959-007-0060-7. URL https://link.springer.com/article/10.1007/s10959-007-0060-7.
- [15]Giorgio Dall’Agllio. Sugli estremi dei momenti delle funzioni di ripartizione doppia. Annali della Scuola Normale Superiore di Pisa, Classe di Scienze, 10(1-2):35–74, 1956. URL https://www.numdam.org/item/ASNSP_1956_3_10_1-2_35_0/.
- [16]PE Fleischer. Sufficient conditions for achieving minimum distortion in a quantizer. IEEE Int. Conv. Rec, 12:104–111, 1964.
- [17]Erell Gachon, Elsa Cazelles, and Jérémie Bigot. Scalable learning from probability measures with mean measure quantization. arXiv preprint arXiv:2502.04907, 2025. URL https://arxiv.org/abs/2502.04907. Revised 2026.
- [18]Michael B. Giles, Mario Hefter, Lukas Mayer, and Klaus Ritter. Random bit quadrature and approximation of distributions on Hilbert spaces. Foundations of Computational Mathematics, 19(1):205–238, 2019. doi: 10.1007/s10208-018-9382-3.DOI
- [19]Jacob Goldberger, Geoffrey Hinton, Sam Roweis, and Ruslan Salakhutdinov. Neighbourhood components analysis. In Advances in Neural Information Processing Systems, volume 17, 2004.
- [20]Gene H. Golub and John H. Welsch. Calculation of Gauss quadrature rules. Mathematics of Computation, 23(106):221–230, 1969. doi: 10.1090/S0025-5718-69-99647-1. URL https://www.ams.org/journals/mcom/1969-23-106/S0025-5718-69-99647-1/.DOI
- [21]Robert D Gordon. Values of mills’ ratio of area to bounding ordinate and of the normal probability integral for large values of the argument. The Annals of Mathematical Statistics, 12(3):364–366, 1941.DOI
- [22]Siegfried Graf and Harald Luschgy. Foundations of Quantization for Probability Distributions, volume 1730 of Lecture Notes in Mathematics. Springer, Berlin, Heidelberg, 2000. ISBN 978-3-540-67394-1. doi: 10.1007/BFb0103945.DOI
- [23]Allan Grøn(l)und, Kasper Green Larsen, Alexander Mathiasen, Jesper Sindahl Nielsen, Stefan Schneider, and Mingzhou Song. Fast exact k-means, k-medians and Bregman divergence clustering in 1D. arXiv preprint arXiv:1701.07204, 2017. URL https://arxiv.org/abs/1701.07204.
- [24]Keaton Hamm and Varun Khurana. Structured approximations of measures. arXiv preprint arXiv:2310.09149, 2026.arxiv.org/abs/2310.09149
- [25]Sariel Har-Peled and Akash Kushal. Smaller coresets for k-median and k-means clustering. Discrete & Computational Geometry, 37(1):3–19, 2007. doi: 10.1007/s00454-006-1271-x.
- [26]Zohar Karnin, Kevin Lang, and Edo Liberty. Optimal quantile approximation in streams. In 2016 IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS), pages 71–78, 2016. doi: 10.1109/FOCS.2016.17. URL https://arxiv.org/abs/1603.05346.
- [27]John C. Kieffer. Uniqueness of locally optimal quantizer for log-concave density and convex error weighting function. IEEE Transactions on Information Theory, 29(1):42–47, 1983. doi: 10.1109/TIT.1983.1056622.DOI
- [28]Soheil Kolouri, Se Rim Park, and Gustavo K Rohde. The radon cumulative distribution transform and its application to image classification. IEEE transactions on image processing, 25(2):920–934, 2015.DOI
- [29]Soheil Kolouri, Yang Zou, and Gustavo K. Rohde. Sliced Wasserstein kernels for probability distributions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5258–5267, 2016. doi: 10.1109/CVPR.2016.568. URL https://www.cv-foundation.org/opencaccess/content_cvpr_2016/html/Kolouri_Sliced_Wasserstein_Kernels_CVPR_2016_paper.html.DOI
- [30]Matt J. Kusner, Yu Sun, Nicholas I. Kolkin, and Kilian Q. Weinberger. From word embeddings to document distances. In Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 957–966. PMLR, 2015. URL https://proceedings.mlr.press/v37/kusnerb15.html.
- [31]Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 3744–3753, 2019.arxiv.org/abs/1810.00825
- [32]Vincent Lemaire, Thibaut Montes, and Gilles Pagès. New weak error bounds and expansions for optimal quantization. Journal of Computational and Applied Mathematics, 371:112670, 2020. doi: 10.1016/j.cam.2019.112670. URL https://arxiv.org/abs/1903.10330.
- [34]Xinran Liu, Shansita D. Sharma, and Soheil Kolouri. EMPEROR: Efficient moment-preserving representation of distributions. arXiv preprint arXiv:2509.16379, 2025. URL https://arxiv.org/abs/2509.16379.
- [35]Yating Liu and Gilles Pagès. Convergence rate of optimal quantization and application to the clustering performance of the empirical measure. Journal of Machine Learning Research, 21(86):1–36, 2020. URL https://jmlr.org/papers/v21/18-804.html.
- [36]Stuart P. Lloyd. Least squares quantization in PCM. IEEE Transactions on Information Theory, 28(2):129–137, 1982. doi: 10.1109/TIT.1982.1056489. Originally circulated as a Bell Laboratories memorandum in 1957.DOI
- [37]Yuzhe Lu, Xinran Liu, Andrea Soltoggio, and Soheil Kolouri. SLoSH: Set locality sensitive hashing via sliced-Wasserstein embeddings. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pages 2566–2576, 2024. URL https://openaccess.thecvf.com/content/WACV2024/html/Lu_SLoSH_Set_Locality_Sensitive_Hashing_via_Sliced-Wasserstein_Embeddings_WACV_2024_paper.html.arxiv.org/abs/2112.05872
- [38]Harald Luschgy and Gilles Pagès. Functional quantization rate and mean regularity of processes with an application to Lévy processes. The Annals of Applied Probability, 18(2):427–469, 2008. doi: 10.1214/07-AAP459. URL https://arxiv.org/abs/math/0601774.
- [39]Joel Max. Quantizing for minimum distortion. IRE Transactions on Information Theory, 6(1):7–12, 1960. doi: 10.1109/TIT.1960.1057548.DOI
- [40]Navid Naderializadeh, Joseph F. Comer, Reed W. Andrews, Heiko Hoffmann, and Soheil Kolouri. Pooling by sliced-Wasserstein embedding. In Advances in Neural Information Processing Systems, volume 34, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/1bc2029a8851ad344a8d503930dfd7f7-Abstract.html.
- [41]Kimia Nadjahi, Alain Durmus, Lénaïc Chizat, Soheil Kolouri, Shahin Shahrampour, and Umut Şimşekli. Statistical and topological properties of sliced probability divergences. In Advances in Neural Information Processing Systems, volume 33, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/eefc9e10ebdc4a2333b42b2dbb8f27b6-Abstract.html.arxiv.org/abs/2003.05783
- [42]Kimia Nadjahi, Alain Durmus, Pierre E. Jacob, Roland Badeau, and Umut Şimşekli. Fast approximation of the Sliced-Wasserstein distance using concentration of random projections. In Advances in Neural Information Processing Systems, volume 34, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/6786f3c62fbf9021694f6e51cc07fe3c-Abstract.html.arxiv.org/abs/2106.15427
- [43]Khai Nguyen. Streaming sliced optimal transport. In International Conference on Machine Learning (ICML), 2026. URL https://arxiv.org/abs/2505.06835.
- [44]Khai Nguyen, Shujian Zhang, Tam Le, and Nhat Ho. Sliced Wasserstein with random-path projecting directions. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pages 37879–37899, 2024. URL https://proceedings.mlr.press/v235/nguyen24l.html.arxiv.org/abs/2401.15889
- [45]Sloan Nietert, Ziv Goldfeld, Ritwik Sadhu, and Kengo Kato. Statistical, robustness, and computational guarantees for sliced Wasserstein distances. In Advances in Neural Information Processing Systems, volume 35, 2022. doi: 10.52202/068431-2043. URL https://proceedings.neurips.cc/paper_files/paper/2022/hash/b4bc180bf09d513c34ecf66e53101595-Abstract-Conference.html.DOI
- [47]Gilles Pagès. A space quantization method for numerical integration. Journal of Computational and Applied Mathematics, 89(1):1–38, 1998. doi: 10.1016/S0377-0427(97)00190-8. URL https://www.sciencedirect.com/science/article/pii/S0377042797001908.DOI
- [48]Gilles Pagès and Jacques Printems. Optimal quadratic quantization for numerics: the Gaussian case. Monte Carlo Methods and Applications, 9(2):135–165, 2003. doi: 10.1515/156939603322663321. URL https://doi.org/10.1515/156939603322663321.
- [49]Se Rim Park, Soheil Kolouri, Shinjini Kundu, and Gustavo K. Rohde. The cumulative distribution transform and linear pattern classification. Applied and Computational Harmonic Analysis, 45(3):616–641, 2018. doi: 10.1016/j.acha.2017.02.002. URL https://arxiv.org/abs/1507.05936.
- [50]J. N. Pierce. Asymptotic quantizing error for unbounded random variables. IEEE Transactions on Information Theory, 16(1):81–83, 1970. doi: 10.1109/TIT.1970.1054400.DOI
- [51]Julien Rabin, Gabriel Peyré, Julie Delon, and Marc Bernot. Wasserstein barycenter and its application to texture mixing. In Scale Space and Variational Methods in Computer Vision (SSVM 2011), volume 6667 of Lecture Notes in Computer Science, pages 435–446. Springer, 2012. doi: 10.1007/978-3-642-24785-9_37. URL https://link.springer.com/chapter/10.1007/978-3-642-24785-9_37.DOI
- [52]Filippo Santambrogio. Optimal Transport for Applied Mathematicians: Calculus of Variations, PDEs, and Modeling, volume 87 of Progress in Nonlinear Differential Equations and Their Applications. Birkhäuser, Cham, 2015. ISBN 978-3-319-20827-5. doi: 10.1007/978-3-319-20828-2.DOI
- [53]Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Re-evaluating word mover’s distance. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 19231–19249, 2022. URL https://proceedings.mlr.press/v162/sato22b.html.arxiv.org/abs/2105.14403
- [54]Mingzhou Song and Hua Zhong. Efficient weighted univariate clustering maps outstanding dysregulated genomic zones in human cancers. Bioinformatics, 36(20):5027–5036, 2020. doi: 10.1093/bioinformatics/btaa613. URL https://pmc.ncbi.nlm.nih.gov/articles/PMC7755420/.
- [55]Binh Thuan Tran and Nicolas Schreuder. Minimax-optimal two-sample test with sliced Wasserstein. In Proceedings of the 29th International Conference on Artificial Intelligence and Statistics, volume 300 of Proceedings of Machine Learning Research, pages 1927–1935, 2026. URL https://proceedings.mlr.press/v300/tran26c.html.arxiv.org/abs/2510.27498
- [56]A. V. Trushkin. Sufficient conditions for uniqueness of a locally optimal quantizer for a class of convex error weighting functions. IEEE Transactions on Information Theory, 28(2):187–198, 1982. doi: 10.1109/TIT.1982.1056480.
- [57]Xiaolin Wu. Optimal quantization by matrix searching. Journal of Algorithms, 12(4):663–673, 1991. doi: 10.1016/0196-6774(91)90039-2.DOI
- [58]Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguan Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1912–1920, 2015.DOI
- [59]Chuang Xu and Arno Berger. Best finite constrained approximations of one-dimensional probabilities. Journal of Approximation Theory, 244:1–36, 2019. doi: 10.1016/j.jat.2019.03.005. URL https://arxiv.org/abs/1704.07871.
- [60]Paul L. Zador. Development and evaluation of procedures for quantizing multivariate distributions. Technical Report SOL ONR 92, Department of Statistics, Stanford University, December 1963. URL https://purl.stanford.edu/gv272ws3207.
- [61]Paul L. Zador. Asymptotic quantization error of continuous signals and the quantization dimension. IEEE Transactions on Information Theory, 28(2):139–148, 1982. doi: 10.1109/TIT.1982.1056490.DOI
- [62]Manzil Zaheer, Satwik Kottur, Siamak Ravnbakhsh, Barnabás Póczos, Ruslan Salakhutdinov, and Alexander J Smola. Deep sets. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS ’17, page 3394–3404, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.
- [63]Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. FSPool: Learning set representations with featurewise sort pooling. In International Conference on Learning Representations, 2020.arxiv.org/abs/1906.02795










