Any-Dimensional Learning by Sampling

Eitan Levin\(^\dagger\) and Venkat Chandrasekaran\(^{\ddag}\) 1
\(^\dagger\) Department of Statistics
University of Chicago
Chicago, IL 60637
\(^\ddag\) Department of Computing and Mathematical Sciences
Department of Electrical Engineering
California Institute of Technology
Pasadena, CA 91125


Abstract

Many machine learning models are defined for inputs of different sizes, such as point clouds containing different numbers of points, sequences of tokens of different lengths, and graphs on different numbers of nodes. Such models are trained on finitely-many examples of necessarily limited sizes. How well do these models generalize from inputs of small size to larger inputs of size not seen during training? Furthermore, evaluating such models on large inputs is often expensive. How can we sketch large inputs to obtain smaller ones on which the model takes similar values? At the heart of both questions is the need to compare inputs of different sizes and to approximate large inputs by small ones. We present a unified approach to address these questions by using random sampling maps to compare inputs of different sizes. The sampling maps we consider are generalizations of sampling with replacement, random binning, and species sampling. We characterize the application domains in which each type of sampling is appropriate in terms of the symmetries and relations between problem instances of different sizes in the domain. Our framework yields explicit generalization and sketching rates for function classes continuous with respect to a chosen notion of sampling, encompassing large families of functions defined on sequences, graphs, and tensors of different sizes. Specific examples include moment polynomials on measures, homomorphism densities and numbers of graphs, permutation-invariant transformers, and graph neural networks.

Keywords. de Finetti, distribution shift, exchangeability, generalization, partition models, random binning, sketching, species sampling

1 Introduction↩︎

Out-of-sample generalization is a core challenge in machine learning, particularly when there are qualitative differences between the training and test data. An important source for such differences is the dimensionality of the data, which can vary from training to test time in applications involving point clouds containing different numbers of points, graphs on different numbers of vertices, and sequences of tokens of different lengths. In these and other domains, we are given training data consisting of inputs of bounded size, and we aim to learn a function that can be applied at test time to inputs of arbitrary size. In particular, such a learned function must exhibit any-dimensional generalization so that it performs well on inputs of sizes that are not seen during training.

A related problem is one in which we are given a function that is well-defined on inputs of any size, and we wish to evaluate the function on a high-dimensional input. When such a high-dimensional function evaluation is expensive, we seek to suitably subsample, or sketch, the input to obtain a low-dimensional object on which the function can be evaluated efficiently and whose value is close to that of the original input. We call the problem of producing such low-dimensional sketches any-dimensional sketching, as our goal is to produce small approximations of arbitrarily-sized inputs.

Our objective in this paper is to show that the above two problems of any-dimensional generalization and sketching are closely related to each other, and to develop a systematic approach to tackle them. The fundamental challenge in addressing both of these questions is that of comparing inputs of different sizes. In other words, in what sense can a small object be an approximation to a large one? Broadly, we develop a sampling-based approach to represent and compare objects of different sizes. We associate to an object of arbitrary size a sequence of random variables representing increasingly-fine subsamples of the object. By defining an appropriate metric over such sequences, we then obtain a convenient method for comparing objects of different sizes. Building on this sampling-based approach, we identify classes of any-dimensional functions that can be learned from, or approximated on, low-dimensional inputs, and we quantify how small this dimensionality needs to be for a given accuracy. We also discuss applications to a number of domains of contemporary interest. We next outline these contributions in more detail.

1.1 Our Contributions↩︎

Formalizing Any-Dimensional Learning (Section 2.1)↩︎

To frame our discussion concretely, let \((\mathbb{V}_n)\) be a sequence of vector spaces, with the index \(n\) specifying object size, e.g., vectors of length \(n\), adjacency matrices of graphs on \(n\) vertices, and so on. We consider the following two running examples, although our framework also encompasses many others:

  • Sequences of features or tokens, represented as \(n\) vectors in \(\mathbb{R}^d\). Here we set \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) for a fixed \(d \in \mathbb{N}\) and growing \(n\).

  • Weighted and directed graphs on \(n\) vertices, represented by their adjacency matrices. Here we set \(\mathbb{V}_n = \mathbb{R}^{n\times n}\) and let \(n\) grow.

In many applications, it is often the case that the objects of interest belong to some proper subset \(\Omega_n \subseteq \mathbb{V}_n\); for instance, an unweighted graph is precisely one whose adjacency matrix belongs to \(\Omega_n = \{0,1\}^{n \times n}\). In the sequel, we will see that various structural properties of this subset, and indeed of the disjoint union \(\bigsqcup_n \Omega_n \subseteq \bigsqcup_n \mathbb{V}_n\) of subsets containing objects of all possible sizes, play a central role in our framework.

In order to formulate the any-dimensional generalization problem precisely, let \(\Omega_{\leq n} = \bigsqcup_{i\leq n}\Omega_i\) be the set of objects of size at most \(n\). For two functions \(f,g \colon \bigsqcup_n \Omega_n \to \mathbb{R}\) defined on objects of all sizes, i.e., any-dimensional functions, define \(\mathrm{e}_n(f,g)=\sup_{x\in\Omega_{\leq n}}|f(x)-g(x)|\) to be the maximum discrepancy between \(f\) and \(g\) on objects of size \(n\), and \(\mathrm{e}_{\infty}(f,g)=\sup_n\mathrm{e}_n(f,g)\) to be the maximum discrepancy on objects of any size. We then investigate the following question:

Any-dimensional generalization: Under what conditions on \(\bigsqcup_n \Omega_n\) and on any-dimensional functions \(f,g : \bigsqcup_n \Omega_n \to \mathbb{R}\) do we have that: \[\lim_{n\to\infty} \mathrm{e}_n(f,g) = \mathrm{e}_{\infty}(f,g)?\] At what rate does this limit converge? Are there hypothesis classes of any-dimensional functions over which the convergence rate is uniform?

If \(\mathrm{e}_n(f,g)\) converges to \(\mathrm{e}_{\infty}(f,g)\) as \(n \rightarrow \infty\), then we can control the error \(\mathrm{e}_\infty(f, g)\) between a function \(f\) and its estimate \(g\) on objects of arbitrarily-large size by the error \(\mathrm{e}_n(f, g)\) on objects of size at most \(n\). If we further have explicit and uniform rates of convergence over some hypothesis class, then we can obtain a priori bounds on the input size \(n\) needed to accurately approximate the target function, and precise bounds on \(\mathrm{e}_{\infty}(f,g)\) as a function of \(\mathrm{e}_n(f,g)\). We would thereby reduce the problem of approximating a target function on arbitrary-size inputs to approximating it on inputs of a fixed (sufficiently-large) size, which belongs to the realm of traditional generalization theory on which there is a substantial literature.

We have stated any-dimensional generalization in terms of uniform error over inputs of each size. If instead we wish to quantify generalization in terms of the average error with respect to some data distribution, it is essential that we formalize the idea of an any-dimensional data distribution. Merely considering distributions \(\mu\) on \(\bigsqcup_n\Omega_n\) is not sufficient, since any such distribution will be concentrated on bounded-dimensional inputs because \(\sum_n\mu(\Omega_n)=1\). Instead, a more appropriate notion for any-dimensional data distributions is that of a weakly-convergent sequence of distributions \((\mu_n\in\mathcal{P}(\Omega_{\leq n}))\) supported on increasingly larger objects, as we show in Proposition 4.

The second question we consider involves approximating the value of an any-dimensional function on a large input by its value on a small sketch of this input.

Any-dimensional sketching: Under what conditions on \(\bigsqcup_n \Omega_n\) and on an any-dimensional function \(f : \bigsqcup_n \Omega_n \to \mathbb{R}\) can we find a (potentially random) map \(\mathsf{S}_k\colon\bigsqcup_n\Omega_n\to\Omega_k\) satisfying \[\lim_{k\to\infty}\mathrm{e}_{\infty}(f, f\circ\mathsf{S}_k)=0\quad \textrm{almost surely?}\] At what rate does this limit converge? Are there hypothesis classes of any-dimensional functions over which the convergence rate is uniform?

As with any-dimensional generalization, if we have explicit and uniform rates of convergence for the above limit over some hypothesis class, then we can provide a priori bounds on the sketch size required for a desired accuracy in evaluating a function on inputs of any size. In particular, such uniform rates would yield sketch sizes that do not depend on the ambient dimension of the object being sketched.

Already at this stage, it is clear that any attempt to address the above two questions would require some way to evaluate similarity between objects of different sizes in \(\bigsqcup_n \Omega_n\), and for the any-dimensional functions under consideration to be well-behaved with respect to this similarity notion. Indeed, if a model performs well on large inputs of unseen size, then these inputs must in some sense be similar to smaller inputs from the training set. Similarly, if a function takes on similar values on a low-dimensional sketch of a high-dimensional object, then the object and its sketch must be similar to each other. More precisely, we need a distance \(d\) between elements of \(\bigsqcup_n \Omega_n\) that allows us to quantitatively compare objects of different sizes and to consider any-dimensional functions that are continuous in \(d\). We show in Theorem 3 that precompactness of the metric space \((\bigsqcup_n \Omega_n, d)\) plays a central role in addressing the above questions.

A Sampling-Based Approach for Comparing Objects of Different Sizes (Section 2.2)↩︎

To address the preceding questions on any-dimensional learning and sketching, we describe a sampling-based approach to represent and compare objects of different sizes. Specifically, we fix a collection of random sampling maps \((\mathsf{S}_k\colon\bigsqcup_n \mathbb{V}_n \to \mathbb{V}_k)_{k\in\mathbb{N}}\), and we associate to each \(x \in \mathbb{V}_n\) the sequence of random variables \[x \mapsto \left(\mathsf{S}_k(x)\right)_{k\in\mathbb{N}}.\] In words, we form random samples of the object \(x\) of increasing sizes, which we view as increasingly-fine sketches of \(x\). Observe that this map is well-defined for inputs of any size (i.e., \(x \in \mathbb{V}_n\) for any \(n\)), and its output is a sequence of random variables taking values in the vector spaces \((\mathbb{V}_k)\). We then compare any two objects \(x,y\in\bigsqcup_n\mathbb{V}_n\) by comparing the distributions of their samples \(\mathsf{S}_k(x)\) and \(\mathsf{S}_k(y)\) of each size \(k\). To quantify this comparison, we define the sampling metric between \(x,y \in \bigsqcup_n \mathbb{V}_n\) by \[\label{eq:sampling95metric} d_{\mathrm{samp}}(x,y)=\sum_{k\geq 1}2^{-k}W_1(\mathsf{S}_k(x), \mathsf{S}_k(y)),\tag{1}\] where \(W_1\) denotes the Wasserstein-1 distance between two distributions of random variables2 with respect to some norm on \(\mathbb{V}_k\), assumed to satisfy \(\sup_k\mathbb{E}\|\mathsf{S}_k(x)\|<\infty\) for each \(x\) so that \(d_{\mathrm{samp}}(x,y)<\infty\). The coefficients \(2^{-k}\) were chosen for convenience, and any other summable sequence would suit. An appropriately bounded sequence \((x_n)\) converges with respect to the sampling metric 1 if and only if the sequence of fixed-dimensional samples \((\mathsf{S}_k (x_n))_n\) converges weakly for each size \(k\), see Proposition 5. We next present several illustrations of sampling maps.

Example 1 (Sampling columns). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) for a fixed \(d \in \mathbb{N}\). Consider the map \(\mathsf{S}_k\) which samples \(k\) columns from \(x=[x_1,\ldots,x_n]\in\mathbb{V}_n\) uniformly at random with replacement, i.e., sample indices \(J_1,\dots,J_k \overset{iid}{\sim}\mathrm{Unif}([n])\) and set \(\mathsf{S}_k(x)=[x_{J_1},\ldots,x_{J_k}]\in\mathbb{V}_k\). We obtain a sampling metric 1 by using the \(\ell_{\infty}\) norm to define the \(W_1\) distances. Given a compact set \(\Theta \subseteq \mathbb{R}^d\), convergence of a sequence \((x_n \in \Theta^n)\) in \(d_{\mathrm{samp}}\) is equivalent to weak convergence of the uniformly random columns \((\mathsf{S}_1(x_n))\) because the distribution of the size-\(k\) sample is \(\mathrm{Law}(\mathsf{S}_k(x))=\mathrm{Law}(\mathsf{S}_1(x))^{\otimes k}\).

Example 2 (Sampling vertices). Consider \(\mathbb{V}_n=\mathbb{R}^{n\times n}\), viewed as the space of weighted and directed graphs on \(n\) vertices. Let \(\mathsf{S}_k\) be the map that samples \(k\) vertices with replacement and extracts the corresponding induced subgraph, i.e., for \(x \in \mathbb{V}_n\), we have \((\mathsf{S}_k(x))_{i,j}=x_{J_i,J_j}\) for \(J_1,\ldots,J_k\overset{iid}{\sim}\mathrm{Unif}([n])\). Once again, we obtain a sampling metric 1 with the entrywise \(\ell_{\infty}\) norm defining the \(W_1\) distances. Convergence in sampling metric corresponds precisely to the dense graph limits studied in [1][4].

Example 3 (Random binning, hashing). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) and consider the sampling map \(\mathsf{S}_k\) that randomly assigns the \(n\) columns of \(x \in \mathbb{V}_n\) into \(k\) bins and sums the columns in each bin, i.e., we sample \(J_1,\ldots,J_n \overset{iid}{\sim}\mathrm{Unif}([k])\) and set the \(i\)th column of \(\mathsf{S}_k(x)\in\mathbb{V}_k\) to \((\mathsf{S}_k(x))_i=\sum_{\ell: J_\ell=i}x_{\ell}\) for \(i\in[k]\). This random binning map, also called hashing, has found uses in machine learning as a dimensionality reduction method [5], [6] and in information theory as part of source and channel coding protocols [7]. We will consider the associated sampling metric 1 defined with the \(\ell_2\) norm.

Example 4 (Species sampling, random partitions). Suppose \(\mathbb{V}_n=\mathbb{R}^n\). A vector \(x\in\Delta^{n}\) defines a random partition of \([k]\) for each \(k\in\mathbb{N}\) as follows. We view \(x\) as a distribution on indices in \([n]\) and sample \(k\) indices \(I_1,\ldots,I_k\in[n]\) iid from this distribution. This sample defines a partition of \([k]\) in which \(i,j\in[k]\) belong to the same block if \(I_i=I_j\), and we set the entries of \(\mathsf{S}_k(x) \in\Delta^k\) to be the fraction of indices in \([k]\) belonging to each block of the partition. Explicitly, we randomly order the \(\ell\leq k\) distinct indices \(\{I_1,\ldots,I_k\}\) sampled in this way as \(t_1,\ldots,t_{\ell}\), and set \(\mathsf{S}_k (x)_j=|\{i: I_i=t_j\}|/k\); the \(t_j\)’s are sometimes called ‘species’ [8]. This sampling map extends to a general \(x\in\mathbb{R}^n\) by homogeneity, so \(\mathsf{S}_k (x)_j=\|x\|_1\mathrm{sign}(x_{t_j})\mathsf{S}_k(|x|/\|x\|_1)_j\) for \(x\neq0\) and \(\mathsf{S}_k(0)=0\). This notion of sampling and the associated random partition models have been studied extensively, see [8][11] for example.

The sampling metric and associated notion of convergence have been previously widely used in the graph limits literature [12] to compare graphs of different sizes and to take their limits, as highlighted in Example 2. We demonstrate in this paper that the underlying idea is much more broadly relevant to comparing objects of different sizes in many other applications. In particular, we go well beyond the preceding specific illustrations by describing next a combinatorial perspective on sampling based on random maps between finite sets. This viewpoint yields three broad classes of sampling maps that represent a significant generalization of Examples 1-4. As we shall see, the sampling perspective is useful both analytically and methodologically, as it provides sketching maps with which to approximate large inputs by small ones and yields explicit rates for any-dimensional generalization and sketching.

General Sampling Maps (Section 2.3)↩︎

We generalize the sampling maps used in Examples 1-4 and unify their analysis by using maps between finite sets. To motivate our generalization, we note that any map \(f\colon[k]\to[n]\) between finite sets defines a (linear) map \(\rho(f)\colon\mathbb{R}^{d\times n}\to\mathbb{R}^{d\times k}\) extracting the columns \(f(1),\ldots,f(k)\) specified by \(f\), or more formally \([\rho(f) x]_i=x_{f(i)}\) for \(i\in[k]\) where subscripts index columns. Moreover, if we replace a fixed such map \(f\) by a uniformly random map \(F_{n,k} : [k] \mapsto [n]\), with each \(F_{n,k}(i)\) drawn independently and uniformly from \([n]\), then \(\rho(F_{n,k})\) is precisely the random map sampling \(k\) columns as in Example 1.

Likewise, a map \(f\colon[k]\to[n]\) acts on pairs by \((i,j)\mapsto(f(i),f(j))\), and therefore defines a (linear) map \(\rho(f)\colon\mathbb{R}^{n\times n}\to\mathbb{R}^{k\times k}\) between matrices indexed by these pairs via \([\rho(f)x]_{i,j}=x_{f(i),f(j)}\) for \(i,j\in[k]\). Once again, applying a uniformly random map \(\rho(F_{n,k})x\) recovers the vertex sampling map of Example 2.

More generally, we consider a sequence of index sets \((\mathcal{I}_n)\) along with actions \(\theta(f)\colon\mathcal{I}_k\to\mathcal{I}_n\) associated to each map \(f\colon[k]\to[n]\) between finite sets, and we assume that these actions satisfy certain compatibility conditions (see Definition 5). We then consider the sequence of vector spaces \((\mathbb{V}_n = \mathbb{R}^{\mathcal{I}_n})\) consisting of vectors indexed by \((\mathcal{I}_n)\), and associate a (linear) map \(\rho(f)\colon\mathbb{V}_n\to\mathbb{V}_k\) to each map \(f\colon[k]\to[n]\) between finite sets given by \[\label{eq:sampling95action} [\rho(f)x]_i=x_{\theta(f)(i)} \quad \textrm{for } x\in\mathbb{V}_n \textrm{ and } i\in\mathcal{I}_k.\tag{2}\] Finally, we define sampling with replacement maps \((\mathsf{R}_k)\) on these spaces by \[\label{eq:sampling95general} \mathsf{R}_k(x) = \rho(F_{n,k})x\quad \textrm{where } F_{n,k}\colon[k]\to[n] \textrm{ is uniformly random},\tag{3}\] and \(x \in \mathbb{V}_n\). In this manner, we generalize sampling with replacement to more complicated objects such as graph signals (by setting \(\mathcal{I}_n=[n]^2\sqcup[n]\)), hypergraphs and tensors (by setting \(\mathcal{I}_n=[n]^d\)), and polynomials (by setting \(\mathcal{I}_n=[n]^d/\mathfrak{S}_d\) to be the collection of multisets of \([n]\) containing \(d\) elements, where \(\mathfrak{S}_d\) is the group of permutations on \(d\) letters permuting indices in a tuple). Our perspective enables a single unified analysis for general actions \(\theta\), and thereby yields rates in a broad array of applications.

Our generalization of random binning also proceeds via an action of maps on index sets. Indeed, any function \(f\colon[n]\to[k]\) can be viewed as binning \(n\) indices into \(k\) bins, and defines a map \(\beta(f)\colon\mathbb{R}^{d\times n}\to\mathbb{R}^{d\times k}\) by binning columns in this way and summing the columns in each bin \([\beta(f) x]_i=\sum_{j\in f^{-1}(i)}x_j\). Applying a uniformly random map \(\beta(F_{k,n})\) in this way yields the random binning map of Example 3. More generally, we consider a sequence of index sets \((\mathcal{I}_n)\) with action \(\theta\) and associated sequence of vector spaces \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) as above. We associate a (linear) map \(\beta(f)\colon\mathbb{V}_n\to\mathbb{V}_k\) to each map \(f\colon[n]\to[k]\) between finite sets via \[\label{eq:binning95action} [\beta(f)x]_i = \sum_{j\in\theta(f)^{-1}(i)}x_j \quad \textrm{for } x\in\mathbb{V}_n \textrm{ and } i\in\mathcal{I}_k.\tag{4}\] We remark that the above two maps \(\rho\) and \(\beta\) from 2 and 4 are adjoints of each other, in the sense that \(\beta(f)=\rho(f)^\star\) with respect to the usual inner products on \(\mathbb{R}^{\mathcal{I}_n}\). Finally, we define random binning maps \((\mathsf{B}_k)\) on these vector spaces by \[\label{eq:binning95general} \mathsf{B}_k(x) = \beta(F_{k,n})x\quad \textrm{where } F_{k,n}\colon[n]\to[k] \textrm{ is uniformly random},\tag{5}\] and \(x \in \mathbb{V}_n\). By varying the index sets \((\mathcal{I}_n)\), we generalize random binning to more general objects, and once again they can all be analyzed in a unified manner. For example, setting \(\mathcal{I}_n=[n]^2\) recovers the random quotients of graphs studied in [13].

Lastly, we generalize the species sampling map from Example 4. We consider a particular class of index sets \((\mathcal{I}_n)\) that can be derived from tuples \([n]^d\) (see Definition 6), and view vectors \(x\in\Delta^{\mathcal{I}_n}\) as distributions over the index sets \(\mathcal{I}_n\). We can then repeat the construction in Example 4 to form more general species sampling maps \((\mathsf{E}_k)\), see Section 2.3.2.

Given a sequence of index sets \((\mathcal{I}_n)\), we have defined three sampling maps on the same underlying vector spaces \(\mathbb{R}^{\mathcal{I}_n}\). When is it appropriate to use a particular sampling map to compare objects of different sizes? Each of the above sampling maps induce an equivalence between different inputs, meaning there exist \(x\neq y\) possibly of different sizes with \(d_{\mathrm{samp}}(x,y)=0\). Therefore, a choice of sampling maps is appropriate only if pairs \(x,y\) at sampling distance zero can indeed be viewed as equivalent in the context of the given application domain. We characterize these equivalences in Section 2.3.

Informally, for sampling with replacement \((\mathsf{R}_k)\) as defined above, the distribution of \(\mathsf{R}_k(x)\) is unchanged if and only if we duplicate or permute the entries of \(x\), appropriately defined (see Propositions 8 and 9). For example, if \(x\in\mathbb{R}^{d\times n}\) and we permute the columns of \(x\) or duplicate them \(m\) times (so \(x\mapsto x\otimes\mathbb{1}_m^\top\)), then the distribution of \(\mathsf{R}_k(x)\) is unchanged for all \(k\in\mathbb{N}\). Such permutation and duplication is natural when \(x\) represents a point cloud, strategies in a symmetric game converging to a mean-field limit, or dense graphs, see Example 13.

For random binning \((\mathsf{B}_k)\) and species sampling \((\mathsf{E}_k)\), the distributions of \((\mathsf{B}_k(x))\) and \((\mathsf{E}_k(x))\) are unchanged if and only if we zero-pad or permute the entries of \(x\), again appropriately defined. For example, if \(x\in\mathbb{R}^n\) and we append \(k\) zeros to \(x\), then the distributions of \(\mathsf{B}_k(x)\) and \(\mathsf{E}_k(x)\) are unchanged for all \(k\). Such permutation and zero-padding is natural when \(x\) represents a distribution on unlabelled items or a sparse graph, see Example 14.

Rates for Sampling with Replacement (Section 3)↩︎

We derive rates for any-dimensional sketching and generalization using the sampling metric 1 defined with respect to general sampling with replacement maps \((\mathsf{R}_k\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{V}_k)\). To state our results, we fix a sequence of compact subsets \((\Omega_n \subseteq \mathbb{V}_n)\) such that \(\mathsf{R}_k (\bigsqcup_n \Omega_n) \subseteq \Omega_k\) almost surely for all \(k\), i.e., the subsets \(\Omega_n\) are closed under sampling with replacement. For example, the hypercubes \(\Omega_n=[-1,1]^n\subseteq\mathbb{R}^n\) and the collection of unweighted graphs \(\Omega_n=\{0,1\}^{n\times n}\subseteq\mathbb{R}^{n\times n}\) are closed under sampling with replacement.

Theorem 1 (informal, see Theorem 12). We have the following rates for sampling with replacement \((\mathsf{R}_k\colon\bigsqcup_n\Omega_n\to\Omega_k)\) acting on compact sets \((\Omega_n)\) closed under sampling.

  1. For any function \(f\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) that is \(L\)-Lipschitz in \(d_{\mathrm{samp}}\) and any \(x\in\bigsqcup_n\Omega_n\), with probability at least \(1-e^{-2\epsilon^2}\) we have \[|f(x)-f(\mathsf{R}_n(x))| \leq Lc_1 \exp\Big[-(c_2^{-1}\log n)^{\frac{1}{1+D}}\Big] + L\epsilon\sqrt{\frac{c_3}{n}}.\]

  2. For any other \(L\)-Lipschitz function \(\widehat f\), we have that: \[\mathrm{e}_{\infty}(f,\widehat f)\leq\mathrm{e}_n(f,\widehat f)+2L c_1\exp\left[-(c_2^{-1}\log n)^{\frac{1}{1+D}}\right].\]

The constants \(c_1,c_2,c_3 >0\) are explicit and depend on the collection \((\Omega_n)\), and the parameter \(D\) is a ‘degree’ that quantifies the complexity of the action \(\theta\) underlying the sampling maps \((\mathsf{R}_k)\).

The proof of these bounds relies on a concentration result in which we show that the distance \(d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\) is \(c/n\)-subgaussian, for a constant \(c > 0\). For any-dimensional sketching, we are able to approximate the value of a Lipschitz function on an arbitrarily-large input by evaluating the function on a random sample of the input, with the size of the sketch depending only on the desired accuracy. For any-dimensional generalization, our results show that if \(\widehat f\approx f\) on inputs of size \(n\), then \(\widehat f\approx f\) on inputs of all sizes up to a slack that decays to zero as \(n\) increases. In other words, approximating a target function on sufficiently-large input sizes guarantees a good approximation on inputs of all sizes. Moreover, Theorem 1 reduces the analysis of any-dimensional generalization error to generalization error on a finite-dimensional compact set, a classical problem (see [14] for example).

The rates in Theorem 1 are clearly quite slow. On the other hand, these rates are uniform in the sense that they hold for objects of any size. Moreover, these slow uniform rates are to be expected in general. For example, when \(\Omega_n\) is the collection of \(n\times n\) adjacency matrices of simple graphs, a rate of \(\exp[-\frac{1}{2}\log\log n]\) was shown in [2] for the closely related cut metric as a consequence of Szemerédi’s regularity lemma (see [12] for the connection between the cut and sampling metrics). Nevertheless, we can substantially improve the above uniform rates using additional structure in the function \(f\). For example, we will see in Section 3 that many any-dimensional functions \(f\) depend on their arbitrarily-large inputs only via a fixed-dimensional random sample, i.e., \(f(x)\) depends on its input only via \(\mathrm{Law}(\mathsf{R}_k(x))\) for some fixed \(k\).

We give two illustrations here of some of these improved rates in specific applications. The first pertains to polynomials that are unchanged by suitably-defined duplication of the entries of their inputs. Specifically, a function \(p\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{R}\) is a polynomial if all the restrictions \(p|_{\mathbb{V}_n}\) are polynomials of some fixed degree, denoted \(\deg(p)\).

Corollary 1 (informal, see Corollary 3). Suppose that \((\Omega_n)\) is a sequence of compact sets closed under sampling, and let \(p\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) be a polynomial that is symmetric and unchanged by duplication. Then there exist constants \(c_1,c_2,c_3>0\) only depending on \((\Omega_n)\) and \(p\) such that with probability at least \(1-e^{-2\epsilon^2}\), we have for any \(x\in\bigsqcup_n\Omega_n\) that \[|p(x)-p(\mathsf{R}_n(x))|\leq \frac{c_1\deg(p)^2}{n}+\frac{c_2\deg(p)\epsilon}{\sqrt{n}},\] and if \(\widehat p\) is another such polynomial of the same degree, \[\mathrm{e}_{\infty}(p,\widehat p)\leq \mathrm{e}_n(p,\widehat p) + \frac{c_3\deg(p)^2}{n}.\]

Examples of polynomials satisfying the above conditions are polynomials in moments of measures, graph homomorphism densities, and polynomial graph neural networks; see Corollary 3 and the discussion following it. The proof uses a result of [15] stating that such polynomials compute moments of fixed-sized samples of their inputs. We remark that the above \(O(n^{-1})\) any-dimensional generalization rates are a substantial improvement over previous rates in the literature, as the latter were proved for larger function classes and exploit less structure. For example, the framework of [16] yields the rates \(O(n^{-1/d})\) for moment polynomials on \(\mathbb{R}^d\), and \(O((\log n)^{-1/4})\) for graph homomorphism densities; see [16].

The second consequence we highlight is to sketching and generalization for transformers.

Corollary 2 (informal, see Corollary 5). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) with \(d>2\), and \(\Omega_n=\Theta^n\) for compact \(\Theta\subseteq\mathbb{R}^d\). If \(T\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{R}^d\) is a permutation-invariant transformer,3 there exists an \(L\)-Lipschitz continuous map \(\bar T\colon\mathcal{P}(\Theta)\to \mathbb{R}^d\) satisfying \(T(x)=\bar T(\mathrm{Law}(\mathsf{R}_1(x)))\). Consequently, with probability at least \(1-e^{-2\epsilon^2}\) we have \[\label{eq:transformer95sampling95intro} |T(x)-T(\mathsf{R}_n(x))|\leq Lc_1\left[\frac{\epsilon}{\sqrt{n}} + \frac{c_2}{n^{1/d}}\right].\qquad{(1)}\] For any other such map \(\bar G\colon\mathcal{P}(\Theta)\to\mathbb{R}^d\), we define \(G(x)=\bar G(\mathrm{Law}(\mathsf{R}_1(x)))\) and obtain \[\mathrm{e}_{\infty}(T,G)\leq \mathrm{e}_n(T,G) + \frac{2c_3L}{n^{1/d}},\] where \(\mathrm{e}_n(T,G)=\sup_{x\in\Theta^n}\|T(x)-G(x)\|_{\infty}\) and \(\mathrm{e}_{\infty}(T,G)=\sup_n\mathrm{e}_n(T,G)\). Above, the constants \(c_1,c_2,c_3>0\) are explicit and depend only on \((\Omega_n)\).

The proof is based on the measure-theoretic in-context mapping of [17]; see Section 3.2. We remark that evaluating \(T(x)\) exactly on an input \(x\in\mathbb{V}_N\) consisting of \(N\) tokens requires \(O(N^2)\) operations (see ?? ), but evaluating it to a desired accuracy \(\delta>0\) can be done with high probability in \(O(\delta^{-2d})\) time (independent of the number of tokens \(N\)) after sampling \(n=O(\delta^{-d})\) columns from \(x\) uniformly at random and using ?? .

Rates for Random Binning and Species Sampling (Section 4)↩︎

Next we present our results on any-dimensional sketching and generalization using the sampling metric \(d_{\mathrm{samp}}\) defined with respect to general random binning maps \((\mathsf{B}_k\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{V}_k)\). Once again, we fix a sequence of compact subsets \((\Omega_n \subseteq \mathbb{V}_n)\) closed under sampling, this time under both random binning and under species sampling so \(\mathsf{B}_k (\bigsqcup_n \Omega_n) \subseteq \Omega_k\) almost surely for all \(k\) and similarly for \((\mathsf{E}_k)\). Examples include the simplex \(\Omega_n=\Delta^n\) and entrywise \(\ell_1\) balls.

As in Theorem 1, we would like to use the maps \((\mathsf{B}_k)\) for sketching high-dimensional inputs. The challenge with this approach is that the distance \(d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\) does not concentrate as well as in the case of sampling with replacement (see Example 19). Fortunately, our generalization of the species sampling map \((\mathsf{E}_k)\) exhibits the requisite concentration, as \(d_{\mathrm{samp}}(x,\mathsf{E}_n(x))\) is \(c/n\)-subgaussian for a constant \(c > 0\) depending only on \((\Omega_n)\). Thus, species sampling furnishes the necessary sketching map.

Theorem 2 (informal, see Theorem 16). We have the following results for random binning \((\mathsf{B}_k)\) and species sampling \((\mathsf{E}_k)\) acting on compact sets \((\Omega_k)\) closed under both sampling maps. Below, we let \(d_{\mathrm{samp}}\) be the sampling metric defined by \((\mathsf{B}_k)\).

  1. For any function \(f\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) that is \(L\)-Lipschitz in \(d_{\mathrm{samp}}\) and any \(x\in\bigsqcup_n\Omega_n\), we have with probability at least \(1-e^{-2\epsilon^2}\) that \[|f(x)-f(\mathsf{E}_n(x))| \leq \frac{L(c_1+ c_2\epsilon)}{\sqrt{n}}.\]

  2. If \(\widehat f\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) is also \(L\)-Lipschitz in \(d_{\mathrm{samp}}\), then \[\mathrm{e}_{\infty}(f,\widehat f)\leq \mathrm{e}_n(f,\widehat f) + \frac{2Lc_1}{\sqrt{n}}.\]

The constants \(c_1,c_2 >0\) are explicit and depend only on the collection \((\Omega_n)\).

In words, we always get \(n^{-1/2}\) rates for random binning, regardless of the complexity of the action \(\beta\) in 5 . We obtain the same rates also for functions \(f\) exhibiting latent low-complexity structure. The following are some of the function classes satisfying the sketching and generalization rates of Theorem 2.

  1. In analogy to Corollary 1, there is a large class of polynomial functions that are continuous with respect to random binning. Specifically, Theorem 16 applies to any polynomial \(p\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{R}\) that is symmetric and unchanged by zero-padding, appropriately defined (Corollary 6). Such polynomials include multi-symmetric functions on sequences of vectors and homomorphism numbers for graphs of arbitrary size.

  2. Many permutation-invariant neural network architectures are continuous with respect to random binning, including DeepSets [18] (Corollary 7), PointNet [19] (Corollary 8), and graph neural networks [20] (Corollary 9), with appropriate choices of parameters and nonlinearities.

Finally, we show that the topologies defined by random binning and by species sampling via the corresponding sampling metrics are closely related to each other (Proposition 19). See Section 4 for more details.

*** OLDER STUFF ***

Venkat: “Some general points:

  • In first paragraph, need to make the point that while \(\Omega\) is typically easy to specify in most applications, the key challenge is that of providing a useful pseudometric \(d\).

  • Related to above, should we discuss the sampling metric first, before giving definitions of any-dimensional approximation and generalization? There are several reasons why this may be more convenient.

  • Should we change notation for dimension \(n\) to something else, so as to not confuse with sample size?

To frame our discussion concretely, we consider a sequence of sets \((\Omega_n)\) consisting of our objects of interest, with the index \(n\) specifying object size, e.g., graphs on \(n\) vertices, tokens of length \(n\), and so on. Let \(d \colon \bigsqcup_n\Omega_n \times \bigsqcup_n\Omega_n \to [0,\infty)\) be a pseudometric and suppose each \(\Omega_n\) is compact in \(d\). We say that two objects \(x,y \in \bigsqcup_n\Omega_n\) are equivalent \(x \sim y\) if \(d(x,y) = 0\). The flexibility provided by the pseudometric formalism will be useful for identifying equivalent objects such as isomorphic graphs. We then denote by \(\Omega_\infty = \bigsqcup_n\Omega_n / \sim\) the collection of objects of all sizes upto equivalence. Observe that \(d\) is a metric on \(\Omega_\infty\). Finally, let \(\Omega_{\leq n} = \bigsqcup_{i\leq n}\Omega_i / \sim\) be the set of objects of bounded size.

Venkat: “Should we give an example or two here to make things concrete? Right now, it feels a bit abstract and reads like a notation section. We could return to these several times throughout the introduction.”

With this setup, we state our first definition pertaining to any-dimensional approximation. Given a point \(x \in \Omega_\infty\) and a subset \(S \subseteq \Omega_\infty\), let \(\mathrm{dist}(x,S) = \inf_{y \in \Omega_\infty} d(x,y)\) be the distance from \(x\) to \(S\).

Definition 1 (Any-Dimensional Approximation). A pseudometric space \((\bigsqcup_n \Omega_n, d)\) satisfies the any-dimensional approximation* property if \[\lim_{n\to\infty}\sup_{x\in\Omega_{\infty}}\mathrm{dist}(x,\Omega_{\leq n})=0.\]*

The any-dimensional approximation property states that objects of any size can be approximated by bounded-size objects. In particular, the order of the limit and the supremum highlights the any-dimensional nature of the definition, as approximability is required to hold uniformly over all objects of arbitrary size. Next we give our definition of any-dimensional generalization. For two functions \(f,g \colon \bigsqcup_n \Omega_n \to \mathbb{R}\) defined on objects of all sizes, i.e., any-dimensional functions, define \(\mathrm{e}_n(f,g)=\sup_{x\in\Omega_{\leq n}}|f(x)-g(x)|\) and \(\mathrm{e}_{\infty}(f,g)=\sup_n\mathrm{e}_n(f,g)\). Venkat: “Should \(\mathrm{e}_{\infty}\) be defined more directly as \(\mathrm{e}_{\infty} = \sup_{x\in\Omega_{\infty}}|f(x)-g(x)|\)? Also, is ‘error’ the right terminology here? Should we state something agnostic at this stage, such as ‘distance’?”

Definition 2 (Any-Dimensional Generalization). A pseudometric space \((\bigsqcup_n\Omega_n, d)\) satisfies the any-dimensional generalization* property if for any \(1\)-Lipschitz functions \(f,g \colon \bigsqcup_n \Omega_n \to \mathbb{R}\), we have: \[\lim_{n\to\infty} \mathrm{e}_n(f,g) = \mathrm{e}_{\infty}(f,g)\]*

The any-dimensional generalization property implies that if the error between a target function \(f\) and its estimate \(\widehat f\) is small on bounded-size objects, then the error can be controlled on objects of arbitrary size. Specifically, training on bounded-size objects would then yield generalization to objects of arbitrary size.

At this stage, both of the above definitions are asymptotic in nature and do not have any formal consideration of rates. An important objective of our paper is to provide explicit rates for the quantities \(\sup_{x\in\Omega_{\infty}}\mathrm{dist}(x,\Omega_{\leq n})\) and \(\mathrm{e}_{\infty}(f,g) - \mathrm{e}_n(f,g)\) to decay towards zero, as functions of the size \(n\) of the fixed-size objects. To make progress on this question, we need a pseudometric \(d\) to compare objects of different sizes.

Venkat: “Given the pivot in the above paragraph to explicitly considering rates, should we tweak both definitions to highlight rates? Alternatively, should we move the definitions to Section 2 and only highlight the quantities \(\sup_{x\in\Omega_{\infty}}\mathrm{dist}(x,\Omega_{\leq n})\) and \(\mathrm{e}_{\infty}(f,g) - \mathrm{e}_n(f,g)\) here?”

In broad overview, our primary contribution in this paper is that a fruitful approach to represent an object is via an infinite sequence of distributions of subsamples of varying sizes. By defining an appropriate metric over such sequences, we obtain a natural method for comparing objects of different sizes. Formally, let \((\mathbb{V}_n)\) be a sequence of vector spaces with each \(\Omega_n \subseteq \mathbb{V}_n\). Given a collection of random sampling maps \((\mathsf{S}_k\colon\bigsqcup_n \mathbb{V}_n \to \mathbb{V}_k)_{k\in\mathbb{N}}\), we define the associated sampling metric by: \[d_{\mathrm{samp}}(x,y)=\sum_{k\geq 1}2^{-k}W_1(\mathsf{S}_k(x),\mathsf{S}_k(y)),\] where \(W_1\) denotes the Wasserstein distance between two probability measures.4

Contributions:

  • Define the any-dimensional approximation and any-dimensional learning in uniform loss, both wrt metric on objects of all sizes.

  • Explain equivalence with uniform approximation of objects.

  • We compare objects of different sizes by comparing distributions of samples. Define sampling metric.

  • This recovers topologies such as weak convergence of measures and of random partition models, as well as dense graph limits.

  • More broadly, choice of sampling maps is dictated by application domain and in particular, relations between problem instances of different sizes and their symmetries.

  • Data distributions should be sequences of distributions on increasingly-large inputs converging weakly

  • Limit objects in sampling metric are naturally associated with a notion of data distributions [state theorem].

  • We define and study two general notions for sampling: Sampling with replacement and random partitions. Define for \(\mathbb{R}^n\) and for \((\mathbb{R}^n)^{\otimes k}\). Appropriate for problems related by duplication / zero-padding (functions continuous in sampling metric are unchanged under permutations and either one of these embeddings)

  • For each, we prove uniform rates in sampling metric. State \(\mathrm{dist}(x,\mathbb{V}_n)\) rates for \(\mathbb{V}_n=(\mathbb{R}^n)^{\otimes k}\), uniformly for \(x\in\Omega_{\infty}\) where \((\Omega_n)\) are compact closed under sampling.

  • Relate rates to Szemeredi and to compactness, remark that slow rates are real.

  • Remark: rates for approximation and learning for Lipschitz functions in sampling metric.

  • We get better rates for approximation and sketching of subclasses of functions by using more precise sampling-based representations for functions. For example, functions of the form \(f(x)=\sigma(\mathbb{E}g_k(\mathsf{S}_kx))\) or more generally \(f(x)=F_k(\mathrm{Law}(\mathsf{S}_kx))\) for some finite \(k\).

Applications:

  • Symmetric polynomial regression: \(O(1/n)\) rates when related by duplication, \(O(1/\sqrt{n})\) when related by zero-padding.

  • \(O(1/\sqrt{n})\) generalization rates for DeepSets and PointNet

  • \(O(n^{-\frac{1}{(K+1)(K+2)}})\) generalization for graphon NNs of order \(K\); \(O(1/\sqrt{n})\) rates for graph NNs.

  • \(O(1/\sqrt{n})\) generalization and sketching for permutation-invariant transformers.

1.2 Our Contributions – Take Two↩︎

Comparing Inputs of Different Sizes via Sampling↩︎

In broad overview, our primary contribution in this paper is that a fruitful approach to represent an object is via an infinite sequence of distributions of subsamples of varying sizes. By defining an appropriate metric over such sequences, we then obtain a natural method for comparing objects of different sizes. Formally, let \((\mathbb{V}_n)\) be a sequence of vector spaces, with the index \(n\) specifying object size, e.g., adjacency matrices of graphs on \(n\) vertices, tokens of length \(n\), and so on. Given a collection of random sampling maps \((\mathsf{S}_k\colon\bigsqcup_n \mathbb{V}_n \to \mathbb{V}_k)_{k\in\mathbb{N}}\), we represent \(x \in \mathbb{V}_n\) as: \[x \mapsto \left(\mathrm{Law}(\mathsf{S}_k(x))\right)\] Observe that this map is well-defined for inputs of any size (i.e., \(x \in \mathbb{V}_n\) for any \(n\)) and it yields as output a sequence of probability measures defined on the sequence of vector spaces \((\mathbb{V}_k)\). We present next several sampling maps from the literature that will appear in various contexts throughout the paper.

Example 5 (Sampling entries with replacement). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) for a fixed \(d \in \mathbb{N}\). We consider sampling columns with replacement, so that for any \(x\in\mathbb{V}_n\) the sampling map \(\mathsf{S}_k\) samples \(k\) columns from \(x\) uniformly at random with replacement, i.e., the \(i\)’th column of \(\mathsf{S}_k x\) is equal to the \(J_i\)’th column of \(x\) where \(J_1,\dots,J_k \overset{iid}{\sim}\mathrm{Unif}([n])\).

Example 6 (Sampling vertices with replacement). Suppose \(\mathbb{V}_n=\mathbb{R}^{n\times n}\), viewed as the space of weighted and directed graphs. Let \(\mathsf{S}_k\) be the map that samples \(k\) vertices with replacement and extracts the corresponding induced subgraph, i.e., fr any \(X \in \mathbb{V}_n\), we have \((\mathsf{S}_kX)_{i,j}=X_{J_i,J_j}\) for \(J_1,\ldots,J_k\overset{iid}{\sim}\mathrm{Unif}([n])\). Venkat: “Is there a convenient way to say what \(\mathrm{Law}(\mathsf{S}_k X)\) is?”

Example 7 (Random binning). Suppose \(\mathbb{V}_n=\mathbb{R}^n\) and consider the sampling map \(\mathsf{S}_k\) that randomly assigns the \(n\) entries of \(x \in \mathbb{V}_n\) into \(k\) bins and sums the entries in each bin, i.e., \(\mathsf{S}_kx=\sum_{i=1}^nx_ie_{J_i}\) where \(J_1,\ldots,J_n\overset{iid}{\sim}\mathrm{Unif}([k])\). This random binning is sometimes also called hashing, and it has found uses in machine learning and information theory [5][7].Venkat: “This last sentence feels a bit out of place, as the above sampling maps don’t have a similar discussion.”

Venkat: “It is nice that all of the preceding examples cleanly describe sampling as an operation on vector spaces. To do this for ‘random partition models’ in general (rather than just simplex vectors) seems to be cumbersome. So I did not include it here.”

To compare inputs of different sizes, we then define the sampling metric between \(x,y \in \bigsqcup_n \mathbb{V}_n\) by: \[d_{\mathrm{samp}}(x,y)=\sum_{k\geq 1}2^{-k}W_1(\mathsf{S}_k(x),\mathsf{S}_k(y)),\]Venkat: “Given that the sampling representation is stated as \(\mathrm{Law}(\mathsf{S}_k(x))\), should we insert ‘Law’ above too?” where \(W_1\) denotes the Wasserstein distance between two probability measures. The coefficients \(2^{-k}\) were chosen to be summable to \(1\), but any nonnegative and summable sequence would be suitable. In Example[REF], the sampling metric between \(x, y\) amounts to \(\sum_{k\geq 1}2^{-k} W_1(\mu_x^{\otimes k}, \mu_y^{\otimes k})\), where \(\mu_x, \mu_y\) are the empirical measures of \(x,y\); Venkat: “Say something about the topology induced by this metric”. In Example[REF], if one restricts the objects to unweighted and undirected graphs (i.e., adjacency matrices that are symmetric and consist of entries in \(\{0,1\}\)), then limits in the sampling metric correspond to dense graph limits [12]. Venkat: “Should we say instead that the topology induced is the same as that of graphons?” As we shall see, the sampling perspective is useful both analytically and methodologically, as it yields explicit rates for any-dimensional learning and also provides an associated algorithmic framework.

Which Sampling Maps?↩︎

To go beyond the preceding specific illustrations, we leverage a combinatorial perspective on sampling based on maps between finite sets that facilitates a significant generalization of Examples[REF].

To motivate our generalization, we observe that any map \(f\colon[k]\to[n]\) defines a linear map \(\rho(f)\colon\mathbb{R}^n\to\mathbb{R}^k\) extracting entries specified by \(f\). Formally for any \(x\in\mathbb{R}^n\) the entries of \(\rho(f)x\in\mathbb{R}^k\) are given by \((\rho(f)x)_i=x_{f(i)}\). Moreover, if \(F_{n,k}\colon[k]\to[n]\) is a uniformly random such map, so that \(F_{n,k}(1),\ldots,F_{n,k}(k)\overset{iid}{\sim}\mathrm{Unif}([n])\), then \(\rho(F_{n,k})x\) is precisely the vector obtained by sampling \(k\) coordinates from \(x\) uniformly at random with replacement as in Example[REF]. Similarly, any map \(f\colon[k]\to[n]\) acts on tuples \(f^{\times 2}\colon [k]^2\to[n]^2\) by \(f^{\times 2}(i,j)=(f(i),f(j))\), and hence acts linearly on matrices indexed by these tuples via \((\rho(f)X)_{i,j}=X_{f(i),f(j)}\). Once again, applying a uniformly random map \(\rho(F_{n,k})X\) recovers the vertex sampling map as in Example 6. These two examples can be generalized by having maps \(f\) between finite sets act on index sets, and hence act linearly via a suitable action \(\rho(f)\) on elements of vector spaces that are indexed by those index sets. Venkat: “Give one or two other examples that can be accommodated by this general perspective?”

Next we interpret random binning as in Example 7 by again using maps between finite sets. Specifically, any map \(f \colon [n]\to[k]\) defines a binning of \(n\) items into \(k\) bins, and acts on a vector \(x\in\mathbb{R}^n\) by binning its coordinates and summing all coordinates in a given bin, i.e., \((\tau(f)x)_i=\sum_{j\in f^{-1}(i)}x_j\). Observe that this action of maps between finite sets is dual to the one above on sampling with replacement, in the sense that \(\rho(f)=\tau(f)^\top\) as matrices. In this case, if \(F_{k,n}\colon[n]\to[k]\) is a uniformly random map then \(\tau(F_{k,n})x\) is the uniformly random binning of the coordinates of \(x\) considered in Example 7. As before, we shall generalize this notion of random binning beyond vectors. Venkat: “Mention some more examples here?”

Venkat: “Make the point that this combinatorial perspective that facilitates a unified analysis framework for any-dimensional learning that yields explicit rates for all sampling-based approaches that fall in the above two classes.”

Venkat: “What dictates the choice of sampling map? Maybe make the point distinct elements \(x, y \bigsqcup_n \Omega_n\), even of different sizes, can have \(d(x,y) = 0\)? Also, compatibility across dimensions? These would suggest that relations between dimensions matter...”

Any-Dimensional Learning and Data Distributions↩︎

In many applications, it is often the case that the objects of interest belong to some proper subset \(\Omega_n \subseteq \mathbb{V}_n\); for instance, graphs can often have nonnegative weights in \([0,1]\) so that \(\Omega_n = [0,1]^{n \times n}\). In the sequel, we will see that the compactness properties of this subset, and indeed of the collection \(\bigsqcup_n \Omega_n\), play a central role in any-dimensional learning. To frame our discussion concretely, we consider a sequence of subsets \((\Omega_n \subseteq \mathbb{V}_n)\) consisting of our objects of interest. It turns out that the sampling metric [REF] defines a pseudometric on \(\bigsqcup_n \Omega_n\). Venkat: “Should we cite a result for the preceding assertion? To be pedantic, we need to show triangle inequality for \(d_{\mathrm{samp}}\) based on the properties of the Wasserstein metric, right?” In particular, distinct elements \(x, y \bigsqcup_n \Omega_n\) can have \(d_{\mathrm{samp}}(x,y) = 0\) as discussed above. We therefore say that two objects \(x,y \in \bigsqcup_n\Omega_n\) are equivalent \(x \sim y\) if \(d_{\mathrm{samp}}(x,y) = 0\), and we denote by \(\Omega_\infty = \bigsqcup_n\Omega_n / \sim\) the collection of objects of all sizes upto equivalence. Observe that \(d_{\mathrm{samp}}\) is a metric on \(\Omega_\infty\).

To formulate the any-dimensional generalization question precisely, let \(\Omega_{\leq n} = \bigsqcup_{i\leq n}\Omega_i / \sim\) be the set of objects of bounded size. For two functions \(f,g \colon \bigsqcup_n \Omega_n \to \mathbb{R}\) defined on objects of all sizes, i.e., any-dimensional functions, define \(\mathrm{e}_n(f,g)=\sup_{x\in\Omega_{\leq n}}|f(x)-g(x)|\) and \(\mathrm{e}_{\infty}(f,g)=\sup_n\mathrm{e}_n(f,g)\).

Venkat: “State any-dimensional generalization question as showing that \(\mathrm{e}_{\infty}(f,g) - \mathrm{e}_n(f,g)\) goes to \(0\)?”

Venkat: “Instead of definition, how about we pose the any-dimensional approximation property as a question – i.e., we want to show that \(\sup_{x\in\Omega_{\infty}} \mathrm{dist}(x,\Omega_{\leq n})\) goes to \(0\) as \(n \rightarrow \infty\) in the sampling metric.”

The any-dimensional approximation property states that objects of any size can be approximated by bounded-size objects. In particular, the question highlights the any-dimensional nature of the property we seek, as approximability is required to hold uniformly over all objects of arbitrary size.

Highlight that compactness matters.

Venkat: “Give rates, perhaps building on earlier examples. Maybe also give some new ones?”

Venkat: “Question – where to fit in data distribution?”

Paper Outline↩︎

1.3 Related Work↩︎

There are several machine learning models that are defined for inputs of different sizes. Examples include neural networks processing sets and point clouds of different sizes [18], [19], [21], graphs of different sizes [20], [22], [23], and transformers processing sequences of tokens of any length [17], [24], [25]. Importantly, the any-dimensional generalization and sketching rates of each of the above models are comparatively less studied, with the following notable exceptions.

The ability of a graph neural network to generalize to graphs of different sizes has been called transferability in the literature, and has been extensively studied by considering appropriate topologies and limits on the space of graphs of all sizes, see [23], [26][28] for example. In particular, many results in this line of work exploit the continuity of appropriately-normalized graph neural networks with respect to dense graph limits, which correspond to convergence in the sampling metric 1 defined using sampling vertices with replacement as in Example 2, see [12]. We generalize and unify many of the techniques in this literature by considering more general notions of sampling maps, which are in turn useful in a broader array of applications.

There is also a literature studying the ability of transformers to generalize to inputs of different lengths, see [29][32] for example. Some of the results in this literature are negative, showing that transformers often do not generalize well to longer inputs, while others prove length generalization under specific assumptions on the transformer architecture. Our theory contributes to the latter line of work by giving explicit generalization guarantees for permutation-invariant transformers. The measure-theoretic description of attention we use for this purpose has been previously used to prove universality results for transformers [17], [33], [34], but to our knowledge our result is the first application of these ideas to length generalization.

The authors of [35] study the particular case of generalization of symmetric any-dimensional polynomials fitted via least-squares to training inputs of bounded dimensions. They measure generalization using mean-squared error with respect to fixed training and test sets in possibly different dimensions, and their bounds depend explicitly on these sets. In contrast, we simultaneously control the error on inputs of all possible sizes by the error in a fixed training dimension; the latter in turn can be controlled by classic results in generalization theory in a fixed dimension [14]. More broadly, our framework applies seamlessly to general classes of functions continuous with respect to sampling, which go well beyond polynomials.

Transferability of graph neural networks has been extended in [16] to more general any-dimensional models, where it was defined to be continuity of the model in a certain space containing inputs of all sizes and their limits. The any-dimensional generalization and sketching problems that are the subject of our paper are neither formalized nor explicitly tackled there, and sampling maps do not play a role in the construction of their space. Nevertheless, several results in [16] do pertain to these problems and involve sampling. These include rates for any-dimensional generalization for average error with respect to specific data distributions [16], and expected convergence rates for function values on low-dimensional samples of high-dimensional inputs [16]. Both assume access to sampling maps satisfying certain desiderata, verified case-by-case. In contrast, sampling maps are fundamental to our framework—we systematically generalize several notions of sampling maps, and we prove the requisite properties pertaining to them in a unified fashion and in broader application domains. In particular, we formalize the notion of any-dimensional data distributions, and we obtain improved generalization rates with respect to them compared to [16] by exploiting sampling-specific structure in the functions; we also prove any-dimensional generalization with respect to worst-case error. Furthermore, we obtain convergence rates for function values on low-dimensional samples that hold not only in expectation but also with high probability, which is essential for deriving a practically-relevant methodology for sketching.

Finally, the sketching rates we obtain for sampling with replacement generalize previous rates obtained for measures [36] (viewed as limits of point clouds) and graphons [2] (viewed as limits of dense simple undirected graphs). These sketching rates were used to test properties of large graphs in the latter literature [12]. In particular, rates of approximation for graphons by finite graphs were shown to follow from compactness of the space of graphons in [37], a connection we generalize in Theorem 3. Our random binning and species sampling maps generalize those studied in [13] for graphs with nonnegative edge weights summing to one. In particular, the authors of [13] show a similar \(n^{-1/2}\) rate as in Theorem 2 with respect to a different but related metric.

1.4 Notation↩︎

We denote by \(\mathbb{N}\) the collection of strictly positive integers and by \(\mathbb{N}_0=\mathbb{N}\cup\{0\}\). For \(n\in\mathbb{N}\), we denote \([n]=\{1,\ldots,n\}\). We denote by \(\mathfrak{S}_n=\{\pi\colon[n]\to[n] \textrm{ bijective}\}\) the group of permutations on \(n\) letters. If \(\mathcal{I}\) is a finite set, we denote by \(\mathbb{R}^{\mathcal{I}}\) the vector space consisting of vectors indexed by \(\mathcal{I}\), by \(\Delta^{\mathcal{I}}\) the unit simplex in \(\mathbb{R}^{\mathcal{I}}\) consisting of nonnegative vectors whose entries sum to 1, and by \([-r,r]^{\mathcal{I}}\) for \(r>0\) the hypercube consisting of vectors with entries of magnitude at most \(r\). If \((\Omega,d)\) is a pseudometric space and \(S\subseteq\Omega\), we denote by \(\mathrm{dist}(x,S)=\inf_{y\in S}d(x,y)\) the distance of \(x\in\Omega\) to \(S\). The space \((\Omega,d)\) is totally bounded if all its covering numbers are finite. We denote the distribution of a random variable \(X\) by \(\mathrm{Law}(X)\). If \(X\) and \(Y\) are two random variables on the same space, we write \(X\overset{d}{=}Y\) to denote equality of their distributions \(\mathrm{Law}(X)=\mathrm{Law}(Y)\). We denote the collection of (Borel) probability distributions on \(\Omega\) by \(\mathcal{P}(\Omega)\). If \(\mu\in\mathcal{P}(\Theta)\), we write \(X\sim\mu\) for a random variable \(X\) to denote \(\mathrm{Law}(X)=\mu\). If \(f\colon\Omega\to\Omega'\) is a continuous map between two topological spaces \(\Omega\) and \(\Omega'\) and \(\mu\in\mathcal{P}(\Omega)\), we denote by \(f\mu\) the pushforward of \(\mu\) by \(f\). If \(\mu\in\mathcal{P}(\Omega)\) and \(f\colon\Omega\to\mathbb{R}\) is a measurable function, we denote by \(\mathbb{E}_{\mu}f=\mathbb{E}_{X\sim\mu}f(X)\) the expectation of \(f\) with respect to \(\mu\). The Wasserstein-1 distance between two measures \(\mu,\nu\in\mathcal{P}(\Omega)\) on a metric space \((\Omega,d)\) is defined by \[W_1(\mu,\nu)=\inf_{\substack{\textrm{random } (X,Y)\\ X\sim\mu, Y\sim\nu}} \mathbb{E}d(X,Y) = \sup_{\substack{f\colon\Omega\to\mathbb{R}\\ \textrm{1-Lipschitz}}}|\mathbb{E}_{\mu}f-\mathbb{E}_{\nu}f|,\] where the infimum is taken over couplings of \(\mu\) and \(\nu\). To simplify our notation, if \(X\) and \(Y\) are random variables (not necessarily coupled) on the same space \(\Omega\), we denote \(W_1(X,Y)=W_1(\mathrm{Law}(X),\mathrm{Law}(Y))\). A sequence of measures \((\mu_n)\subseteq\mathcal{P}(\Omega)\) converges weakly to \(\mu\in\mathcal{P}(\Omega)\) if \(\mathbb{E}_{\mu_n}f\to\mathbb{E}_{\mu}f\) for all continuous functions \(f\colon\Omega\to\mathbb{R}\). If \(\Omega\) is a compact metric space, this is further equivalent to convergence in \(W_1\) distance. A sequence of random variables \((X_n)\) converges weakly if their distributions \((\mathrm{Law}(X_n))\) converge weakly. If \((\Omega_n)\) are sets, we denote their disjoint union by \(\bigsqcup_n\Omega_n=\{(n,x):x\in\Omega_n, n\in\mathbb{N}\}\). If \(\sim\) is an equivalence relation on a set \(\Omega\), we denote by \(\Omega/\sim\) the quotient space consisting of equivalence classes. Any pseudometric \(d\) on \(\Omega\) induces an equivalence relation by setting \(x\sim y\) if \(d(x,y)=0\). If \(d\) is a pseudometric on \(\bigsqcup_n\Omega_n\), we denote by \(\Omega_{\infty}=\bigsqcup_n\Omega_n/\sim\) the quotient space under the equivalence relation induced by \(d\), on which \(d\) defines a metric, and by \(\overline{\Omega}_{\infty}\) the completion of this metric space.

1.5 Stuff that needs to be in the intro somewhere↩︎

Given sets \((\Omega_n)\) and sampling maps \((\mathsf{S}_k\colon\bigsqcup_n\Omega_n\to\Omega_k)\), define the sampling metric \[\label{tauwyncj} d_{\mathrm{samp}}(x,y)=\sum_{k\geq 1}2^{-k}W_1(\mathsf{S}_kx,\mathsf{S}_ky).\tag{6}\]

Definition 3 (Uniform Approximation). A pseudo-metric space \(\bigsqcup_n\Omega_n\) satisfies the uniform approximation property if \(\lim_{n\to\infty}\sup_{\substack{x\in\Omega_N\\ N\in\mathbb{N}}}\mathrm{dist}(x,\bigsqcup_{i\leq n}\Omega_i)=0\).

For a collection of inputs \((\Omega_n)\) and any-dimensional functions \(f,g\colon\bigsqcup_n\Omega_n\to\mathbb{R}\), define \(\mathrm{e}_n(f,g)=\sup_{x\in\Omega_{\leq n}}|f(x)-g(x)|\) and \(\mathrm{e}_{\infty}(f,g)=\sup_n\mathrm{e}_n(f,g)\).

Definition 4 (Any-Dimensional Generalization). A pseudo-metric space \(\bigsqcup_n\Omega_n\) satisfies the any-dimensional generalization property if there is a rate \((R_n\geq 0)_{n\in\mathbb{N}}\) with \(R_n\downarrow 0\) such that for any 1-Lipschitz \(f,g\) we have \(\mathrm{e}_{\infty}(f,g)\leq \mathrm{e}_n(f,g)+R_n\).

We will show that Definitions 3 and 2, as well as several other related properties including generalization with respect to average error, are all equivalent to the precompactness of \(\bigsqcup_n\Omega_n\).

2 Comparing Objects of Different Sizes↩︎

In this section, we begin our study of any-dimensional learning by formally investigating how inputs of different sizes are compared to each other. We start in Section 2.1 by stating a general equivalence between various notions of generalization and sketching across dimensions, and compactness of the metric space (for a general metric) consisting of inputs of all sizes and their limits. We then focus in Section 2.2 on the sampling metric. We describe a large and natural family of compact metric spaces that can be derived with respect to the sampling metric, and we provide a link between (random) limit objects in these metric spaces and an appropriate notion of an any-dimensional data distribution. Finally, we discuss compatibility conditions between index sets that lead to general sampling maps in Section 2.3. Missing proofs in this section are given in Section 2.4.

2.1 The Role of Compactness↩︎

Given a pseudometric defined on inputs of all sizes, we prove that compactness of this metric space is equivalent to the any-dimensional generalization and sketching properties from Section 1. While the argument is elementary, we include it here for completeness. Suppose \(d\) is a pseudometric on \(\bigsqcup_n\Omega_n\), and define the equivalence relation \(x\sim y\) if \(d(x,y)=0\). We allow for pseudometrics, as opposed to only metrics, because inputs of different sizes can correspond to the same object in the context of a given application domain, see Sections 1 and 2.3. Note that \(d\) is a metric on \(\Omega_{\infty}=\bigsqcup_n\Omega_n/\sim\), and we define \(\overline{\Omega}_{\infty}\) to be the completion of this metric space. Denote by \(\mathcal{F}_1\) the collection of 1-Lipschitz functions on \(\bigsqcup_n\Omega_n\), or equivalently, on \(\overline{\Omega}_{\infty}\).

Theorem 3. Assume \((\Omega_n,d)\) is totally bounded for each \(n\). Then the following are equivalent.

  1. \((\overline{\Omega}_{\infty},d)\) is compact.

  2. We have \(\lim_{n\to\infty}\sup_{x\in\Omega_{\infty}}\mathrm{dist}(x,\Omega_{\leq n})=0\).

  3. There exist random maps \(\mathsf{S}_k\colon\bigsqcup_n\Omega_n\to\Omega_{\leq k}\) for each \(k\) such that \[\lim_{k\to\infty}\sup_{f\in\mathcal{F}_1}\mathrm{e}_{\infty}(f, f\circ\mathsf{S}_k) = 0,\quad \textrm{almost surely.}\]

  4. There exists a rate \((R_n\geq 0)_{n\in\mathbb{N}}\) with \(R_n\to 0\) such that for any \(f,g\in\mathcal{F}_1\), we have \[\mathrm{e}_{\infty}(f,g)\leq \mathrm{e}_n(f,g) + R_n.\]

The proof of this theorem proceeds via a straightforward direct argument, which we defer to Section 2.4. The above theorem shows that a number of desirable properties are equivalent to compactness of the limit space \(\overline{\Omega}_{\infty}\) with the pseudometric \(d\). Part 2 is an any-dimensional approximation property that says that any object of any size can be approximated by objects of size \(n\) with uniform rates, which pertains to the any-dimensional sketching question. The derivation of these rates is the key step in our analyses below. Parts 3 and 4 give a positive answer to the any-dimensional sketching and generalization questions we posed in Section 1, respectively, with uniform rates over the class of 1-Lipschitz functions. We remark that part 3 can be equivalently stated in terms of deterministic maps \(\mathsf{S}_k\), but the above formulation more closely aligns with our any-dimensional sketching question and subsequent developments using sampling maps.

As discussed in Section 1, we would also like to quantify generalization error with respect to any-dimensional data distributions. Specifically, we consider average error with respect to sequences of distributions supported on inputs of growing size that converge weakly to a distribution on limit objects, as formalized by the following proposition. Below, if \(\mu\in\mathcal{P}(\overline{\Omega}_{\infty})\) and \(f,g\colon\overline{\Omega}_{\infty}\to\mathbb{R}\) we define \(\mathrm{e}_{\mu}(f,g)=\mathbb{E}_{\mu}|f-g|\).

Proposition 4. Suppose \((\overline{\Omega}_{\infty},d)\) is compact. For any sequence of distributions \((\mu_n\in\mathcal{P}(\Omega_{\leq n}))\) and \(\mu_{\infty}\in\mathcal{P}(\overline{\Omega}_{\infty})\), we have \(\mu_n\to\mu_{\infty}\) weakly if and only if there exists a rate \((R_n\geq0)\) with \(R_n\downarrow0\) such that for any \(f,g\in\mathcal{F}_1\), we have \(\mathrm{e}_{\mu_{\infty}}(f,g)\leq\mathrm{e}_{\mu_n}(f,g)+R_n\).

Once again, the proof is direct and is given in Section 2.4. The above results are completely general, and show that any compact pseudometric between objects of different sizes enables generalization across dimensions for functions that are continuous with respect to that metric. We turn next to analyzing the sampling metric 1 in more detail, and show that it admits rich families of compact sets and a natural correspondence between limit objects and any-dimensional data distributions.

2.2 The Sampling Metric↩︎

Fix vector spaces \((\mathbb{V}_n)\) and sampling maps \((\mathsf{S}_k\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{V}_k)\), where each \(\mathsf{S}_k\) is viewed as a random map.5 We begin by showing that any sequence of compact sets \((\Omega_n\subseteq\mathbb{V}_n)\) closed under these sampling maps yields a compact limiting space.

Proposition 5. Suppose \((\Omega_n\subseteq\mathbb{V}_n)\) is a sequence of compact sets in the usual topology such that \(\mathsf{S}_k\left(\bigsqcup_n\Omega_n\right)\subseteq\Omega_k\) almost surely. Endow each \(\mathbb{V}_n\) with a norm such that \(\sup_n\sup_{x\in\Omega_n}\|x\|<\infty\), and consider the sampling metric 1 on \(\bigsqcup_n\Omega_n\) with \(W_1\) distances defined using the above norms. Then \((\overline{\Omega}_{\infty},d_{\mathrm{samp}})\) is compact and each \((\Omega_n,d_{\mathrm{samp}})\) is totally bounded. Moreover, a sequence \((x_i)\subseteq\bigsqcup_n\Omega_n\) converges in \(d_{\mathrm{samp}}\) if and only if \((\mathsf{S}_k(x_i))_i\) converges weakly for each \(k\in\mathbb{N}\).

We emphasize that we are assuming above that each \(\Omega_n\) is compact in the usual norm topology on \(\mathbb{V}_n\), and conclude that each \(\Omega_n\) is precompact (or equivalently, totally bounded) in the topology induced by the sampling metric \(d_{\mathrm{samp}}\). This proposition follows from Tychonoff’s theorem applied to the product \(\prod_n\mathcal{P}(\Omega_n)\), and we give the full proof in Section 2.4. Note that this result assumes nothing about the sampling maps or how they are related to each other.

We proceed to give several examples of sampling maps and sets satisfying the above hypotheses. In some of these examples the limit space \(\overline{\Omega}_{\infty}\) has been characterized before and shown to be compact, while in others an explicit description may be involved and challenging to obtain, but compactness still follows from the above result.

Example 8 (Sampling columns). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\), and consider the maps \(\mathsf{S}_k\) sampling \(k\) columns from \(x\) uniformly at random with replacement as in Example 1. Note that for any compact \(\Theta\subseteq \mathbb{R}^d\), the sequence of product sets \(\Omega_n=\Theta^n\) is closed under sampling. As noted in Example 1, a sequence \((x_i)\subseteq \bigsqcup_n\Theta^n\) converges in \(d_{\mathrm{samp}}\) if and only if \((\mathrm{Law}(\mathsf{S}_1(x_i)))_i\subseteq\mathcal{P}(\Theta)\) converge weakly. In this case, sending \(x\mapsto \mathrm{Law}(\mathsf{S}_1(x))\) identifies \(\Omega_{\infty}\) with the collection of all measures in \(\mathcal{P}(\Theta)\) that have a finite support and rational weights, as these are precisely the measures of the form \(\mathrm{Law}(\mathsf{S}_1(x))\) for some \(x\in\Theta^n\) and some \(n\in\mathbb{N}\). We can then identify \(\overline{\Omega}_{\infty}\) with all of \(\mathcal{P}(\Theta)\) endowed with the weak topology, which is indeed compact.

Example 9 (Sampling vertices). Suppose \(\mathbb{V}_n=\mathbb{R}^{n\times n}\), viewed as the space of weighted and directed graphs, and consider the sampling map \(\mathsf{S}_k\) drawing \(k\) vertices with replacement and extracting the corresponding induced subgraph as in Example 2. Then the sequence \((\Omega_n)\) of simple undirected graphs on \(n\) vertices is closed under sampling, and limits in \(d_{\mathrm{samp}}\) correspond to dense graph limits [1], [2]. Such limits can be represented by a graphon, which is a symmetric measurable function \(W\colon[0,1]^2\to[0,1]\) modulo an equivalence relation [1]. In this case, we can identify \(\Omega_{\infty}\) with the space of so-called step-graphons, which are (equivalence classes of) step functions associated to finite graphs [2]. We can then identify \(\overline{\Omega}_{\infty}\) with the space of all graphons, which was shown to be compact in [37].

For more general sequences of sets \((\Omega_n)\) closed under sampling, including weighted and directed graphs, the characterization of \(\overline{\Omega}_{\infty}\) becomes more involved [4], but its compactness still follows from Proposition 5.

Example 10 (Random binning and species sampling). If \(\mathbb{V}_n=\mathbb{R}^n\), then the sequence of simplices \((\Omega_n=\Delta^n)\) is closed under both random binning as in Example 3 and species sampling as in Example 4. In this case, we can view \(\Omega_{\infty}\) as the space of random exchangeable probability measures on \([0,1]\) with finite support by associating to each \(x\in\mathbb{R}^n\) the random measure \(\sum_{i=1}^nx_i\delta_{T_i}\) where \(T_1,\ldots,T_n\) are iid uniform in \([0,1]\). Then the closure \(\overline{\Omega}_{\infty}\) with respect to both random binning and species sampling corresponds to the space of all random exchangeable measures6 on \([0,1]\) by [13], and is compact by Proposition 5.

The sequence of \(\ell_1\) balls \((\Omega_n=\mathcal{B}_{\ell_1}^{(n)}(r))\) of radius \(r\) is also closed under both binning and species sampling, and its limit space can similarly be identified with a compact space of (signed) random measures.

Combining Proposition 5 and Theorem 3, we conclude that if \((\Omega_n)\) is closed under sampling then there are uniform rates at which we can approximate arbitrary-sized objects by fixed-sized ones (as in Theorem 3(2)), and uniform any-dimensional sketching and generalization rates for Lipschitz functions measured by worst-case error (as in Theorem 3(3-4)). We derive explicit such rates for several notions of sampling in Sections 3 and 4 below after introducing the relevant sampling maps.

We further seek uniform rates for generalization measured by average error with respect to any-dimensional data distributions. According to Proposition 4, such uniform rates are available for sequences of measures \((\mu_n\in\mathcal{P}(\Omega_n))\) with a weak limit \(\mu_{\infty}\in\mathcal{P}(\overline{\Omega}_{\infty})\). However, there are many sequences of measures converging to the same limit \(\mu_{\infty}\), and we seek a ‘canonical’ choice of such a sequence to model data distributions of growing dimensionality. Under the sampling metric, there is a natural family of such sequences of distributions. Specifically, each \(\mu_{\infty}\in\mathcal{P}(\overline{\Omega}_{\infty})\) defines a sequence of distributions of its samples \((\mathsf{S}_k(X))\) where \(X\sim\mu_{\infty}\) is independent of the sampling maps \(\mathsf{S}_k\). This sequence of distributions converges weakly back to \(\mu_{\infty}\) whenever the sampling maps \((\mathsf{S}_k)\) yield increasingly-good approximations of their inputs, in the sense that \(\mathsf{S}_k(x)\to x\) weakly as \(k\to\infty\) for any \(x\in\overline{\Omega}_{\infty}\). This is the case for all the sampling maps considered in the paper.

We now state the above result formally. For the following result, we endow \(\mathcal{P}(\overline{\Omega}_{\infty})\) with the weak topology, and endow \(\prod_n\mathcal{P}(\Omega_n)\) with the product of weak topologies. We also observe that the sampling maps \((\mathsf{S}_k\colon\bigsqcup_n\Omega_n\to\Omega_k)\) extend to \(\overline{\Omega}_{\infty}\). Indeed, if \(x\in\overline{\Omega}_{\infty}\) then we can write \(x=\lim_ix_i\) for \((x_i)\subseteq\bigsqcup_n\Omega_n\) and define \(\mathsf{S}_k(x)\) to be the weak limit of \((\mathsf{S}_k(x_i))_i\) for each \(k\in\mathbb{N}\). It is easy to check that this is well-defined by definition of convergence in \(d_{\mathrm{samp}}\).

Proposition 6. In the setting of Proposition 5, assume that \[\label{eq:convergence95of95samples} \lim_{n\to\infty}\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{S}_n(x))=0,\quad \textrm{for each } x\in\overline{\Omega}_{\infty}.\qquad{(2)}\] Then for any \(\mu\in\mathcal{P}(\overline{\Omega}_{\infty})\) the sequence of measures \(\mu_n=\mathrm{Law}(\mathsf{S}_n(X))\) where \(X\sim \mu\) is independent of \(\mathsf{S}_n\) converges weakly to \(\mu\). Furthermore, the map \(\mathcal{P}(\overline{\Omega}_{\infty})\to\prod_n\mathcal{P}(\Omega_n)\) sending \[\label{eq:fd95sampling95map} \mu\mapsto (\mu_n=\mathrm{Law}(\mathsf{S}_n(X)))_{n\in\mathbb{N}},\qquad{(3)}\] is a linear isomorphism from \(\mathcal{P}(\overline{\Omega}_{\infty})\) onto its image.

We give the proof of this result in Section 2.4. We characterize the image of the map ?? for our generalizations of sampling with replacement and random binning in Theorems 13 and 17 below. The above sequences \((\mu_n)\) are precisely the ones we use in the sequel to quantify average generalization error in the sense of Proposition 4. Note that ?? is the only assumption we have made on the sampling maps \((\mathsf{S}_k)\).

Example 11. In the setting of Example 5 with \(\Omega_n=\Theta^n\) for compact \(\Theta\subseteq\mathbb{R}^d\), we have \(\overline{\Omega}_{\infty}=\mathcal{P}(\Theta)\) so limit objects are probability distributions on \(\Theta\); hence \(\mathcal{P}(\overline{\Omega}_{\infty})\) corresponds to random probability measures on \(\Theta\). The map ?? sends a distribution over measures \(\mathsf{M}\in\mathcal{P}(\mathcal{P}(\Theta))\) to the mixture of iid distributions \(\mathrm{Law}(\mathsf{S}_n(x))=\int \mu^{\otimes n}\, d\mathsf{M}(\mu)\). We show in Theorem 12 below that ?? holds for sampling with replacement, and hence Proposition 6 yields a linear isomorphism between random measures and mixtures of iid distributions, recovering a part of de Finetti’s theorem. De Finetti’s theorem further states that the space of such mixtures is isomorphic to the space of infinite exchangeable arrays, a result we generalize in Theorem 13 to our broader notion of sampling with replacement.

Remark 7 (Extremality). We remark that the map ?? identifies limit objects in \(\overline{\Omega}_{\infty}\) with extremal sequences of measures obtained from sampling. Indeed, elements of \(\overline{\Omega}_{\infty}\) are precisely the extreme points of \(\mathcal{P}(\overline{\Omega}_{\infty})\), which are mapped isomorphically to extreme points of the image of the map ?? . As an illustration, in the setting of Example 11 we recover the fact that sequences of iid distributions obtained from deterministic measures on \(\Theta\) are precisely the extreme points of all sequences of mixtures of iid distributions. We recover further results from the literature pertaining to such extremality in Sections 3 and 4.

Having studied sampling maps in general, we now describe three specific families of sampling maps generalizing the examples in Section 1.

2.3 General Sampling Maps↩︎

In this section, we formalize our generalizations of sampling with replacement, random binning, and species sampling from Examples 1-4 in Section 1, and we explain when each sampling map is appropriate by characterizing their symmetries and relations between dimensions. We begin in Section 2.3.1 by generalizing sampling with replacement and random binning, which are dual to each other in a precise sense and can be analyzed together. Then in Section 2.3.2 we generalize species sampling.

2.3.1 Sampling with Replacement and Random Binning↩︎

As explained in Section 1, the key to our general perspective on sampling with replacement and random binning is an action of maps between finite sets on index sets of vectors, which we now make precise.

Definition 5 (Compatible index sets). A (FinSet-)compatible sequence of index sets* is a sequence of finite sets \((\mathcal{I}_n)\) together with maps \(\theta(f_{n,k})\colon\mathcal{I}_k\to\mathcal{I}_n\) associated to each \(f_{n,k}\colon[k]\to[n]\) which satisfies (i) \(\theta(\mathrm{id}_{[n]})=\mathrm{id}_{\mathcal{I}_n}\); and (ii) \(\theta(f_1\circ f_2)=\theta(f_1)\circ\theta(f_2)\) whenever the composition is well-defined. The collection of maps \(\theta = \{\theta(f_{n,k}) : f_{n,k}\colon[k]\to[n]\}\) is called an action.7*

As a consequence of Definition 5, if \(n\leq N\) and \(\phi\colon[n]\to[N]\) is an injection, then \(\theta(\phi)\colon\mathcal{I}_n\to\mathcal{I}_N\) is an injection as well. Indeed, there is a surjection \(\psi\colon[N]\to[n]\) satisfying \(\psi\circ\phi=\mathrm{id}_{[n]}\), in which case \(\theta(\psi)\circ\theta(\phi)=\mathrm{id}_{\mathcal{I}_n}\) so \(\theta(\phi)\) is injective. Likewise, if \(\psi\colon[N]\to[n]\) is surjective then \(\theta(\psi)\colon\mathcal{I}_N\to\mathcal{I}_n\) is surjective.

Examples of such compatible sequences include \(\mathcal{I}_n=[d]\times [n]\) with action \(\theta(f)(i,j)=(i,f(j))\), tuples \(\mathcal{I}_n=[n]^d\) with action \(\theta(f)(i_1,\ldots,i_d)=(f(i_1),\ldots,f(i_d))\), and multisets \(\mathcal{I}_n=[n]^d/\mathfrak{S}_d\), viewed as the set of orbits under permutations of the \(d\) indices in each tuple of \([n]^d\), with the same action. More generally, standard operations on sets can be applied to create new compatible sequences from previous ones. For example, if \(\{(\mathcal{I}_n),\theta_I\}\) and \(\{(\mathcal{J}_n),\theta_J\}\) are two compatible sequences, then so are \(\{(\mathcal{I}_n\sqcup\mathcal{J}_n),\theta_I\sqcup\theta_J\}\) and \(\{(\mathcal{I}_n\times\mathcal{J}_n),\theta_I\times\theta_J\}\).

All of the compatible sequences of index sets in this paper can be derived by applying such standard operations to the basic sequence \((\mathcal{I}_n=[n])\). For compatible sequences obtained in this manner, we quantify the complexity of the sequence using the following notion of a ‘degree’. This degree appears explicitly in the sequel in our rates for any-dimensional sketching and generalization.

Definition 6 (Degree of compatible index sets). Consider a compatible sequence \((\mathcal{I}_n)\) of the form \(\mathcal{I}_n=\bigsqcup_{m=1}^M[n]^{d_m}/H_m\), where \(H_m\subseteq\mathfrak{S}_{d_m}\) is a subgroup of permutations acting by permuting the multi-indices in \([n]^{d_m}\). The degree* of such a compatible sequence is given by \(D=\max_md_m\).8*

As illustrations, the degree of \(\mathcal{I}_n=[d]\times [n]=\bigsqcup_{i=1}^d[n]\) is one, while the degrees of \(\mathcal{I}_n=[n]^2\), \(\mathcal{I}_n=[n]^2\sqcup[n]\), and \(\mathcal{I}_n=[n]^2/\mathfrak{S}_2\) are all two.

As discussed in Section 1, we associate to each compatible sequence \((\mathcal{I}_n)\) a sequence of vector spaces \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\), and let maps between finite sets act on these vector spaces via the maps \(\rho\) and \(\beta\) given by 2 and 4 , respectively. The maps \(\rho\) and \(\beta\) in turn yield generalizations of sampling with replacement \((\mathsf{R}_k)\) and random binning \((\mathsf{B}_k)\) in 3 and 5 , respectively.

Example 12 (Vector spaces from index sets). The following are examples of vector spaces obtained from compatible sequences.

  1. When \(\mathcal{I}_n=[d]\times[n]\), we have \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) whose elements we view as sequences of \(n\) vectors in \(\mathbb{R}^d\). In this case, if \(f\colon [m]\to[n]\) then \(\rho(f)\colon\mathbb{V}_n\to\mathbb{V}_m\) extracts the \(m\) columns \(f(1),\ldots,f(m)\), while \(\beta(f)\colon\mathbb{V}_m\to\mathbb{V}_n\) bins \(m\) columns into \(n\) bins \(f^{-1}(1),\ldots,f^{-1}(n)\). The map \(\mathsf{R}_k\) samples \(k\) columns with replacement as in Example 1, while \(\mathsf{B}_k\) randomly bins the columns into \(k\) bins and sums all columns in each bin as in Example 3.

  2. When \(\mathcal{I}_n=[n]^2\), we have \(\mathbb{V}_n=\mathbb{R}^{n\times n}\) whose elements we view as adjacency matrices of (weighted, directed) graphs on \(n\) vertices, and when \(\mathcal{I}_n=[n]^2/\mathfrak{S}_2\), we have \(\mathbb{V}_n=\{X\in\mathbb{R}^{n\times n}:X^\top=X\}\) whose elements we view as undirected graphs on \(n\) vertices. In either case, if \(f\colon[m]\to[n]\) then \(\rho(f)\) extracts the induced subgraph on the \(m\) vertices \(f(1),\ldots,f(m)\) while \(\beta(f)\) forms the quotient graph defined by binning \(m\) vertices into \(n\) bins \(f^{-1}(1),\ldots,f^{-1}(n)\), given by \[(\beta(f)X)_{i,j}=\sum_{\substack{k\in f^{-1}(i)\\ \ell\in f^{-1}(j)}}X_{k,\ell}.\] The map \(\mathsf{R}_k\) extracts the induced subgraph on \(k\) vertices sampled with replacement as in Example 2, while \(\mathsf{B}_k\) forms the quotient graph defined by randomly binning vertices into \(k\) bins as in [13].

  3. When \(\mathcal{I}_n=[n]^2\sqcup([n]\times [d])\), we have \(\mathbb{V}_n=\mathbb{R}^{n\times n}\oplus \mathbb{R}^{n\times d}\) whose elements we view as pairs \((G,X)\) of a graph \(G\) on \(n\) vertices and a graph signal \(X\) assigning \(d\)-dimensional features to each vertex [40]. In this case, if \(f\colon[m]\to[n]\) then \(\rho(f)(G,X)=(\rho(f)G,\rho(f)X)\) extracts the induced subgraph on the \(m\) vertices \(f(1),\ldots,f(m)\) along with their corresponding features, while \(\beta(f)(G,X)=(\beta(f)G,\beta(f)X)\) forms the quotient graph defined by binning \(m\) vertices into \(n\) bins \(f^{-1}(1),\ldots,f^{-1}(n)\) and sums the features of vertices in the same bin. The map \(\mathsf{R}_k\) samples \(k\) vertices with replacement along with their corresponding features, while \(\mathsf{B}_k\) randomly bins the vertices into \(k\) bins, forms the quotient graph, and sums all features of vertices in the same bin.

When \(\mathcal{I}_n=[n]^d\) and \([n]^d/\mathfrak{S}_d\), the above examples generalize to directed and undirected hypergraphs.

Note that we have two sampling maps \((\mathsf{R}_k)\) and \((\mathsf{B}_k)\) defined on the same sequences of vector spaces. We explain in Examples 13 and 14 when each of these sampling maps is appropriate.

We remark that the actions \(\rho\) and \(\beta\) from 2 and 4 , respectively, respect compositions of maps between finite sets. Specifically, we have \(\rho(f_1\circ f_2)=\rho(f_2)\circ \rho(f_1)\) while \(\beta(f_1\circ f_2)=\beta(f_1)\circ\beta(f_2)\) whenever the composition \(f_1\circ f_2\) is well-defined, so \(\rho\) reverses the order of compositions while \(\beta\) preserves it.9 We will exploit this compositionality in what follows.

When is each sampling map appropriate?↩︎

As discussed in Section 1, the sampling maps \((\mathsf{R}_k)\) and \((\mathsf{B}_k)\) induce equivalence relations between distinct objects, meaning that \(d_{\mathrm{samp}}(x,y)=0\) for \(x\neq y\) when \(d_{\mathrm{samp}}\) is defined using either choice of sampling maps. Importantly, we will see that distinct objects of the same size and also of different sizes can be equivalent under \(d_{\mathrm{samp}}\). We characterize the equivalences induced by sampling with replacement and random binning, and discuss some of the application domains in which these equivalences are natural.

For objects of the same size, equivalences arise from permutation symmetry. To see this symmetry, observe that if \(\pi\colon[n]\to[n]\) is a permutation (i.e., a bijection), then \(\pi\) defines a bijection from \(\mathcal{I}_n\) to itself via \(\theta\), and two isomorphisms of \(\mathbb{V}_n\) to itself via \(\rho\) and \(\beta\). These two actions of permutations on \(\mathbb{V}_n\) define representations of the group \(\mathfrak{S}_n\) on \(\mathbb{V}_n\); moreover, the actions are dual to each other and the associated representations are isomorphic. When the context is clear, we denote the action of a permutation \(\pi\in\mathfrak{S}_n\) on a vector \(x\in\mathbb{V}_n\) by \(\pi x\), which equals either \(\rho(\pi)x\) or \(\beta(\pi)x\) depending on whether \((\mathbb{V}_n)\) is endowed with sampling with replacement or with random binning maps, respectively.

Proposition 8 (Permutation symmetry). Suppose \((\mathcal{I}_n)\) is a compatible sequence, let \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) be the associated vector spaces endowed with either sampling with replacement or random binning, denoted by \((\mathsf{S}_k)\). Fix \(x \in \mathbb{V}_n\).

  1. The distribution \(\mathrm{Law}(\mathsf{S}_k(x))\) is exchangeable, meaning \(\pi_k \mathsf{S}_k(x)\overset{d}{=}\mathsf{S}_k(x)\) for each \(\pi_k\in\mathfrak{S}_k\).

  2. For any \(\pi_n\in\mathfrak{S}_n\), we have \(\mathsf{S}_k(\pi_nx) \overset{d}{=}\mathsf{S}_k(x)\) for all \(k\), hence \(d_{\mathrm{samp}}(x,\pi_nx)=0\).

Proof. For any \(k,\ell\in\mathbb{N}\), let \(F_{\ell,k}\colon[k]\to[\ell]\) be a uniformly random map, and note that \(F_{\ell,k}\circ\pi_k\overset{d}{=}\pi_\ell\circ F_{\ell,k}\overset{d}{=}F_{\ell,k}\) since all three maps send each \(i\in[k]\) independently to a uniformly random element of \([\ell]\). Applying \(\rho\) and \(\beta\), we conclude that \(\pi_k\circ\mathsf{S}_k\overset{d}{=}\mathsf{S}_k\circ\pi_n\overset{d}{=}\mathsf{S}_k\) for any \(\pi_k\in\mathfrak{S}_k\) and \(\pi_n\in\mathfrak{S}_n\), as claimed. ◻

In addition to permutation symmetry in each fixed dimension, there are also equivalences between objects of different sizes. We characterize these equivalences using two distinguished maps between finite sets. The first set are the inclusions \(\iota_{N,n}\colon[n]\hookrightarrow [N]\) defined as \[\iota_{N,n}(i) = i \quad \textrm{for } i \in [n],\quad \textrm{whenever } n\leq N.\] These inclusions in turn define inclusions of \(\mathcal{I}_n\) into \(\mathcal{I}_N\) via the action \(\theta\). Then the map \(\rho(\iota_{N,n})\colon\mathbb{V}_N\to\mathbb{V}_n\) acts as the orthogonal projection with respect to the usual inner product, while \(\beta(\iota_{N,n})\colon\mathbb{V}_n\to\mathbb{V}_N\) is an embedding by zero-padding. For example, when \(\mathbb{V}_n = \mathbb{R}^n\) the projection \(\rho(\iota_{N,n})\) extracts the first \(n\) entries from a length-\(N\) vector, while \(\beta(\iota_{N,n})\) zero-pads a vector of length \(n\) by \(N-n\) zeros. Similarly, when \(\mathbb{V}_n = \mathbb{R}^{n \times n}\) the projection \(\rho(\iota_{N,n})\) extracts the induced subgraph on the first \(n\) vertices from a graph on \(N\) vertices, while the embedding \(\beta(\iota_{N,n})\) corresponds to appending \(N-n\) isolated vertices to a graph on \(n\) vertices. See Example 12 for these and other examples.

The second distinguished set of maps are the consecutive partitions \(\kappa_{n,N}\colon[N]\to[n]\) defined by \[\label{eq:standard95equipartition} \kappa_{n,N}(j + (i-1)(N/n)) = i \quad \textrm{for } i\in[n], j\in[N/n],\quad \textrm{whenever } n|N.\tag{7}\] The corresponding linear maps \(\rho(\kappa_{n,N})\colon\mathbb{V}_n\to\mathbb{V}_N\) are embeddings that duplicate the entries of their inputs in a suitable sense based on the action \(\theta\). For example, we have \(\rho(\kappa_{n,N})x=x\otimes\mathbb{1}_{N/n}\) when \(\mathbb{V}_n=\mathbb{R}^n\), which acts by duplicating each entry of a vector \(x\) of length \(n\) the same number \(N/n\) of times. Similarly, we have \(\rho(\kappa_{n,N})X=X\otimes\mathbb{1}_{N/n}\mathbb{1}_{N/n}^\top\) when \(\mathbb{V}_n=\mathbb{R}^{n\times n}\), which acts by duplicating each entry of a matrix \(X\) of size \(n\times n\) into a block of \((N/n)\times(N/n)\) entries. Meanwhile, the maps \(\beta(\kappa_{n,N})\colon\mathbb{V}_N\to\mathbb{V}_n\) are projections that sum consecutive blocks of coordinates. For example, the vector \(\beta(\kappa_{n,N})x\in\mathbb{R}^n\) is obtained from \(x\in\mathbb{R}^N\) by summing each group of consecutive \(N/n\) coordinates. Similarly, the matrix \(\beta(\kappa_{n,N})X\in\mathbb{R}^{n\times n}\) is obtained from \(X\in\mathbb{R}^{N\times N}\) by summing the entries of each consecutive \(N/n\times N/n\) block in \(X\). See Example 12.

We are now ready to state the relationships across dimensions satisfied by our sampling maps.

Proposition 9 (Relations between Dimensions). Suppose \((\mathcal{I}_n)\) is a compatible sequence, and let \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) endowed with sampling with replacement \((\mathsf{R}_k)\) and random binning \((\mathsf{B}_k)\).

  1. For any \(n\leq N\), we have \(\rho(\iota_{N,n})\circ\mathsf{R}_N\overset{d}{=}\mathsf{R}_n\) and \(\mathsf{B}_k\circ\beta(\iota_{N,n})\overset{d}{=}\mathsf{B}_k\) for all \(k\in\mathbb{N}\).

  2. For any \(n|N\), we have \(\mathsf{R}_k\circ\rho(\kappa_{n,N}) \overset{d}{=}\mathsf{R}_k\) for all \(k\in\mathbb{N}\) and \(\beta(\kappa_{n,N})\circ\mathsf{B}_N\overset{d}{=}\mathsf{B}_n\).

Proof. For the first claim, fix \(n\leq N\), let \(k\in\mathbb{N}\) be arbitrary and note that \(F_{k,N}\circ\iota_{N,n}\overset{d}{=}F_{k,n}\) since both maps send each \(i\in[n]\) independently to a uniformly random element of \([k]\). Applying \(\rho\) and \(\beta\) to this identity yields the first claim. For the second claim, note that \(\kappa_{n,N}\circ F_{N,k}\overset{d}{=}F_{n,k}\) since each \(i\in[k]\) is sent by \(F_{N,k}\) independently to a uniformly random element of \([N]\), so its image is equally likely to lie in each fiber of \(\kappa_{n,N}\). Applying \(\rho\) and \(\beta\) to this identity yields the second claim. ◻

In particular, note that for any \(x\in\mathbb{V}_n\), we have \(d_{\mathrm{samp}}(x,\rho(\kappa_{n,N})x)=0\) if \(d_{\mathrm{samp}}\) is defined using \((\mathsf{R}_k)\), while \(d_{\mathrm{samp}}(x,\beta(\iota_{N,n})x)=0\) for any \(x\in\mathbb{V}_n\) if \(d_{\mathrm{samp}}\) is defined using \((\mathsf{B}_k)\). Note here that \(\rho(\kappa_{n,N})x\) and \(\beta(\iota_{N,n})x\) belong to \(\mathbb{V}_N\), so the sampling distance between objects of different sizes can equal zero.

Observe that the maps \(\iota_{N,n}\) are particular types of injections, while the maps \(\kappa_{n,N}\) are particular types of equipartitions.10 By combining Propositions 8 and 9, we are able to obtain the following consequences for all injections and equipartitions: \[\label{eq:injection95equivalence} \rho(\phi_{N,n})\circ\mathsf{R}_N\overset{d}{=}\mathsf{R}_n\quad \textrm{and} \quad \mathsf{B}_k\circ\beta(\phi_{N,n})\overset{d}{=}\mathsf{B}_k\quad \textrm{for any injection \phi_{N,n}\colon[n]\to[N]},\tag{8}\] and \[\label{eq:eqp95equivalence} \mathsf{R}_k\circ\rho(\psi_{n,N})\overset{d}{=}\mathsf{R}_k\quad \textrm{and}\quad \beta(\psi_{n,N})\circ\mathsf{B}_N\overset{d}{=}\mathsf{B}_n\quad \textrm{for any equipartition } \psi_{n,N}\colon[N]\to[n],\tag{9}\] since we can write \(\phi_{N,n}=\pi_N\circ \iota_{N,n}\) and \(\psi_{n,N}=\kappa_{n,N}\circ\pi_N\) for some permutation \(\pi_N\in\mathfrak{S}_N\).

As a converse to the preceding equivalences, we now prove that if \(d_{\mathrm{samp}}(x,y)=0\) then \(x,y\) must differ by permutations and duplication for sampling with replacement, or permutations and zero-padding for random binning.

Proposition 10. Suppose \((\mathcal{I}_n)\) is a compatible sequence, and let \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) endowed with sampling with replacement \((\mathsf{R}_k)\) and random binning \((\mathsf{B}_k)\). Let \(x\in\mathbb{V}_n\) and \(y\in\mathbb{V}_N\) for \(n\leq N\).

  1. If \(\mathsf{R}_k(x)\overset{d}{=}\mathsf{R}_k(y)\) for all \(k\in\mathbb{N}\), then \(\rho(\kappa_{N,L})y=\rho(\psi_{n,L})x\) for \(L=\mathrm{lcm}\{n,N\}\) and some equipartition \(\psi_{n,L}\colon[L]\to[n]\).

  2. If \(\mathsf{B}_k(x)\overset{d}{=}\mathsf{B}_k(y)\) for all \(k\in\mathbb{N}\), then \(y=\beta(\phi_{N,n})x\) for some injection \(\phi_{N,n}\colon[n]\to[N]\).

The proof uses concentration results for uniformly random maps between finite sets. In particular, the proof of part 1 entails showing that a bipartite graph constructed from fibers of these random maps contains a perfect matching. We defer the full proof to Section 2.4. We now give some examples of application domains where each of the above equivalences naturally arises.

Example 13 (Duplication). If \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) and \(x=(x_1,\ldots,x_n)\in\mathbb{V}_n\) is viewed as a point cloud in \(\mathbb{R}^d\), then reordering the columns or duplicating them the same number of times yields an equivalent point cloud (e.g., the corresponding discrete distribution \(\frac{1}{n}\sum_{i=1}^n\delta_{x_i}\) is unchanged). In the context of mean-field games, we can view the columns of \(x\) as strategies played by \(n\) symmetric players, and in the mean-field limit one can show that duplicating the columns of \(x\) yields a strategy with the same payoff [41]. Sampling columns with replacement would therefore be appropriate for either of these types of data.

If \(\mathbb{V}_n=\mathbb{R}^{n\times n}\) and we view \(x\in\mathbb{V}_n\) as adjacency matrices of graphs, then simultaneously permuting the rows and columns of \(x\) corresponds to relabelling the vertices, which does not change the topology of the graph. Furthermore, duplicating each vertex of \(x\) corresponds to the so-called blowup of the graph, and these blowups have the same graph homomorphism densities [2]. Sampling vertices with replacement would therefore be appropriate when studying such structural properties of graphs.

Example 14 (Zero-padding). If \(\mathbb{V}_n=\mathbb{R}^n\) and we view \(x\in\mathbb{V}_n\) as a (signed) distribution on \(n\) items, then reordering the entries of \(x\) corresponds to relabelling the items, while zero-padding \(x\) amounts to viewing it as a distribution on a larger collection of items assigning zero weight to all but the original \(n\) ones. Such relabelling and zero-padding preserves many structural properties of \(x\), such as various diversity indices measuring its dispersion [42], and hence random binning is appropriate when studying such properties.

If \(\mathbb{V}_n=\mathbb{R}^{n\times n}\) and we view \(x\in\mathbb{V}_n\) as an adjacency matrix of a graph, then permuting and zero-padding \(x\) amounts to relabelling and adding isolated vertices to the graph, respectively. These operations again preserve many properties of the graph in question, including homomorphism numbers and various measures of centrality and clustering [13], so random binning of vertices is appropriate when studying such properties.

If \(f\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{R}\) is continuous with respect to the sampling metric defined by \((\mathsf{R}_k)\), then \[\label{eq:eqp95invariant} f(\rho(\psi_{n,N})x)=f(x) \quad \textrm{for all } x\in\mathbb{V}_n \textrm{ and equipartitions } \psi_{n,N}\colon[N]\to[n],\tag{10}\] or equivalently, each restriction \(f|_{\mathbb{V}_n}\) is permutation-invariant and \(f\) is unchanged by duplication of entries defined by \(\rho(\kappa_{n,N})\). Likewise, if \(f\) is continuous with respect to the sampling metric defined by \((\mathsf{B}_k)\), then \[\label{eq:zero95pad95invariant} f(\beta(\phi_{N,n})x)=f(x) \quad \textrm{for all } x\in\mathbb{V}_n \textrm{ and injections } \phi_{N,n}\colon[n]\to[N],\tag{11}\] or equivalently, each restriction \(f|_{\mathbb{V}_n}\) is permutation-invariant and \(f\) is unchanged by zero-padding defined by \(\beta(\iota_{N,n})\). Thus, functions continuous in the sampling metric defined using either choice of sampling maps respect the same equivalence relations.

The converses of 10 and 11 are false in general, that is, there are functions invariant under equipartitions or injections that are not continuous in the corresponding sampling metric. For example, the norm \(f(x)=\|x\|_1\) satisfies 11 but we show in Corollary 7 that it is not continuous with respect to random binning. However, the converses are true if \(f|_{\mathbb{V}_n}\) is a polynomial of some degree \(d\) for all \(n\). In this case, if \(f\) is unchanged by equipartitions in the sense of 10 then there exists \(k\in\mathbb{N}\) and a fixed-dimensional polynomial \(g_k\in\mathbb{R}[\mathbb{V}_k]\) such that \(f(x)=\mathbb{E}g_k(\mathsf{R}_k(x))\) for all \(x\) by [15]. Similarly, if \(f\) is unchanged by zero-padding in the sense of 11 then there exists \(k\in\mathbb{N}\) and \(g_k\in\mathbb{R}[\mathbb{V}_k]\) such that \(f(x)=\mathbb{E}g_k(\mathsf{B}_k(x))\) for all \(x\) by the same theorem. In other words, these polynomials are computing a moment of a fixed-dimensional sample of their input under either sampling with replacement or random binning. We exploit this sampling representation for polynomials in Sections 3 and 4.

2.3.2 Species Sampling↩︎

We now generalize the species sampling map from Example 4. Fix a compatible sequence \((\mathcal{I}_n)\) and consider the corresponding sequence \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) of vector spaces. For simplicity, suppose first that \(x\in\Delta^{\mathcal{I}_N}\) is a simplex element. We view such \(x\) as a probability distribution over \(\mathcal{I}_N\), and consider forming an empirical approximation to it from \(n\) iid samples. Specifically, sampling \(\alpha_1,\ldots,\alpha_n\in\mathcal{I}_N\) iid according to \(x\), we set \[\label{eq:empirical95sampling} \mathscr{E}_n(x)=\frac{1}{n}\sum_{i=1}^ne_{\alpha_i}.\tag{12}\] In general, we have \(\mathscr{E}_n(x)\in \mathbb{V}_N\) and hence \(\mathscr{E}_n\) does not reduce the dimensionality of its input. However, it does produce a sparse vector, as \(\mathscr{E}_n(x)\) has at most \(n\) nonzero entries regardless of the dimensionality of \(x\). We can exploit this sparsity by relabeling the elements of the index set to produce a low-dimensional element defining our generalization \(\mathsf{E}_n(x)\) of species sampling. We next describe this construction formally.

Suppose first that \(\mathcal{I}_n=[n]^D\) for all \(n\) and \(x\in\Delta^{\mathcal{I}_N}\) as above.

  1. Sample \(\alpha_1,\ldots,\alpha_n\) from the distribution \(x\) on \(\mathcal{I}_N=[N]^D\). Denote \(\alpha_i=(j_1^{(i)},\ldots,j_D^{(i)})\) for each \(i\).

  2. Consider the subset \(\bigcup_{i=1}^n\{j_1^{(i)},\ldots, j_D^{(i)}\}\) of \([N]\), and denote its cardinality by \(k\leq nD\). Uniformly randomly enumerate the elements of this subset to obtain \(t_1,\ldots,t_k\).

  3. Set \[\label{eq:species95sampling95general} \mathsf{E}_n(x)_{\ell_1,\ldots,\ell_D}= \mathscr{E}_n(x)_{t_{\ell_1},\ldots,t_{\ell_D}},\tag{13}\] if \(\ell_1,\ldots,\ell_d\in[k]\), and \(\mathsf{E}_n(x)_{\ell_1,\ldots,\ell_D}=0\) otherwise.

In words, we view the elements of \([N]\) as labeling distinct species, and elements of \(\mathcal{I}_N = [N]^D\) as relations between these species. The empirical sampling map \(\mathscr{E}_n\) samples these relations while ‘remembering’ the species labels, while the species sampling map \(\mathsf{E}_n\) ‘forgets’ the labels of the species in steps 2 and 3 of the above construction. For example, if \(\mathcal{I}_N=[N]\) then \(\mathsf{E}_n\) recovers the species sampling map of Example 4. Furthermore, if \(\mathcal{I}_N=[N]^2\) and we view elements of \(\mathbb{V}_N=\mathbb{R}^{N\times N}\) as adjacency matrices of (weighted, directed) graphs on \(N\) vertices, then \(\mathsf{E}_n\) can be viewed as sampling \(n\) edges proportionally to their edge weights, and has been studied in connection with limits of large graphs in [13].

The above construction of \(\mathsf{E}_n(x)\) generalizes to any compatible sequence \((\mathcal{I}_n)\) of finite degree and any \(x\in\mathbb{V}_N\), not necessarily a simplex element, as follows.

  • If \(\mathcal{I}_n=[n]^D/H\) for some subgroup \(H\subseteq\mathfrak{S}_D\), then each \(\alpha_i\) sampled in step 1 above is the coset of a tuple, denoted \(\alpha_i=H(j_1^{(i)},\ldots,j_D^{(i)})\). Because \(H\) acts by permuting indices in a tuple, step 2 is well-defined. Moreover, if \((i_1,\ldots,i_D)=h(j_1,\ldots,j_D)\) for some \(h\in H\) then \((t_{i_1},\ldots,t_{i_D})=h(t_{j_1},\ldots,t_{j_D})\). Thus, setting \(\mathsf{E}_n(x)_{H(i_1,\ldots,i_D)}= \mathscr{E}_n(x)_{H(t_{i_1},\ldots,t_{i_D})}\) is well-defined and generalizes 13 to this case.

  • If \(\mathcal{I}_n=\bigsqcup_{m=1}^M[n]^{d_m}/H_m\) is a general compatible sequence of degree \(D=\max_md_m\), then each \(\alpha_i\) sampled in step 1 above belongs to \([n]^{d_{m_i}}/H_{m_i}\) for some \(m_i\). Then in step 2 we randomly enumerate the set of all indices contained in all of the \(\alpha_i\), and in step 3 we generalize 13 as above. More precisely, denoting \(\alpha_i=H_{m_i} (j_1^{(i)},\ldots,j_{d_{m_i}}^{(i)})\), in step 2 we randomly enumerate the elements of the subset \(\bigcup_{i=1}^n\{j_1^{(i)},\ldots,j_{d_{m_i}}^{(i)}\}\) of \([N]\), which again contains \(k\leq nD\) distinct elements \(t_1,\ldots,t_k\). In step 3, we then set \(\mathsf{E}_n(x)_{H_m(i_1,\ldots,i_{d_m})}=\mathscr{E}_n(x)_{H_m(t_{i_1},\ldots,t_{i_{d_m}})}\), generalizing 13 to a general compatible sequence of index sets.

  • We extend both \(\mathscr{E}_n\) and \(\mathsf{E}_n\) beyond simplex vectors by homogeneity. Specifically, if \((\mathcal{I}_n)\) is a compatible sequence of finite degree and \(x\in\mathbb{V}_N\), define \(\mathscr{E}_n(x)=\|x\|_1\mathrm{sign}(x)\odot \mathscr{E}_n(|x|/\|x\|_1)\) where \(\odot\) denotes entrywise product (and \(\mathscr{E}_n(0)=0\) by convention), and define \(\mathsf{E}_n(x)\) as above.

We have thus generalized species sampling to general vectors indexed by elements of a compatible sequence of finite degree to obtain random maps \((\mathsf{E}_k\colon \bigsqcup_n\mathbb{V}_n\to \mathbb{V}_{kD})_k\).

1ex -.5em When is species sampling appropriate? Species sampling induces the same equivalences between objects of different sizes as random binning, namely, equivalence under permutations and zero-padding.

Proposition 11. Suppose \((\mathcal{I}_n)\) is a compatible sequence of finite degree and let \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) endowed with the species sampling maps \((\mathsf{E}_k)\). We have \(\mathsf{E}_k\circ \beta(\phi_{N,n})\overset{d}{=}\mathsf{E}_k\) for any injection \(\phi_{N,n}\colon[n]\to[N]\).

Proof. Observe that \(\beta(\phi_{N,n})\mathscr{E}_k(x)\overset{d}{=}\mathscr{E}_k(\beta(\phi_{N,n})x)\) as can be seen directly from 12 using the fact that \(\phi_{N,n}\) is injective. The construction of \(\mathsf{E}_k\) then shows that \(\mathsf{E}_k(\beta(\phi_{N,n})x)\overset{d}{=}\mathsf{E}_k(x)\), as claimed. ◻

In particular, if \(d_{\mathrm{samp}}\) is defined using species sampling, then \(d_{\mathrm{samp}}(x,\beta(\phi_{N,n})x)=0\) for all \(x\in\mathbb{V}_n\) and all injections \(\phi_{N,n}\colon[n]\to[N]\). Likewise, if \(f\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{R}\) is continuous with respect to the sampling metric defined by \((\mathsf{E}_k)\), we have \(f(\beta(\phi_{N,n})x)=f(x)\). Conversely, it follows from Proposition 19 below that if \(d_{\mathrm{samp}}(x,y)=0\) for \(x\in\mathbb{V}_n\) and \(y\in\mathbb{V}_N\) for \(n\leq N\) then \(y=\beta(\phi_{N,n})x\) for some injection \(\phi_{N,n}\).

Thus, species sampling may be appropriate in the same domains as random binning, such as those in Example 14. In fact, we show in Proposition 19 of Section 4 that random binning and species sampling define closely related topologies via the corresponding sampling metrics.

2.4 Missing Proofs from Section 2↩︎

We begin by proving Theorem 3 via a direct argument.

Proof (Theorem 3).. We start by arguing that properties 1 and 2 are equivalent. Since \(\overline{\Omega}_{\infty}\) is a complete metric space by construction, it is compact if and only if it is totally bounded. If property 2 holds, then for any \(\epsilon>0\) there is \(N(\epsilon)\in\mathbb{N}\) such that \(\sup_{x\in\overline{\Omega}_{\infty}}\mathrm{dist}(x,\Omega_{\leq N(\epsilon)})\leq \epsilon/2\). Since \(\Omega_{\leq N(\epsilon)}\) is totally bounded, it has a finite \(\epsilon/2\)-net that is an \(\epsilon\)-net for \(\overline{\Omega}_{\infty}\), proving that the latter is indeed totally-bounded. Conversely, if \(\overline{\Omega}_{\infty}\) is totally bounded and \(\{y_1,\ldots,y_k\}\subseteq \overline{\Omega}_{\infty}\) is a finite \(\epsilon/2\)-net, let \(x_i\in\bigsqcup_n\Omega_n\) satisfy \(d(x_i,y_i)\leq\epsilon/2\) and note that \(\{x_1,\ldots,x_k\}\subseteq\Omega_{\leq N(\epsilon)}\) for some \(N(\epsilon)\in\mathbb{N}\), hence \(\sup_{x\in\overline{\Omega}_{\infty}}\mathrm{dist}(x,\Omega_{\leq N(\epsilon)})\leq \epsilon\). Letting \(\epsilon\to0\) proves statement 2. Thus, statements 1 and 2 are equivalent.

We proceed to argue that statements 2 and 3 are equivalent. If statement 2 holds, for any \((\epsilon_k\geq0)\) with \(\epsilon_k\to 0\), define the (deterministic) map \(\mathsf{S}_k\colon\bigsqcup_n\Omega_n\to\Omega_{\leq k}\) by finding \(\mathsf{S}_k(x)\in\Omega_{\leq k}\) satisfying \(d(x,\mathsf{S}_k(x))\leq \mathrm{dist}(x,\Omega_{\leq k})+\epsilon_k\). Then for any \(f\in\mathcal{F}_1\) we have \(\mathrm{e}_{\infty}(f,f\circ\mathsf{S}_k)\leq \sup_{x\in\Omega_{\infty}}\mathrm{dist}(x,\Omega_{\leq k})+\epsilon_k\to0\), so statement 3 holds. Conversely, suppose statement 3 holds and fix any \(x\in\bigsqcup_n\Omega_n\). Then \(f_x=d(x,\cdot)\) is 1-Lipschitz and \[\mathrm{dist}(x,\Omega_{\leq k}) \leq d(x,\mathsf{S}_k(x)) = |f_x(\mathsf{S}_k(x))-f_x(x)| \leq \mathrm{e}_{\infty}(f_x,f_x\circ\mathsf{S}_k) \leq \sup_{f\in\mathcal{F}_1}\mathrm{e}_{\infty}(f,f\circ\mathsf{S}_k).\] Since this holds for any \(x\in\bigsqcup_n\Omega_n\), we conclude that statement 2 holds.

Finally, we argue that statement 4 is equivalent to the previous equivalent three statements. If statement 3 holds, denote \(R_n=\mathbb{E}\sup_{f\in\mathcal{F}_1}\mathrm{e}_{\infty}(f,f\circ\mathsf{S}_n)\), and note that \(R_n\to0\) because \((\sup_{f\in\mathcal{F}_1}\mathrm{e}_{\infty}(f,f\circ\mathsf{S}_k))_k\) is a sequence of bounded (by statement 1) random variables converging to zero almost surely, so they also converge to zero in expectation. Then for any \(f,g\in\mathcal{F}_1\) and any \(x\in\Omega_{\infty}\) we have \[|f(x)-g(x)|\leq |f(x)-\mathbb{E}f(\mathsf{S}_n(x))| + |\mathbb{E}f(\mathsf{S}_n(x))-\mathbb{E}g(\mathsf{S}_n(x))| + |\mathbb{E}g(\mathsf{S}_n(x))-g(x)|\leq \mathrm{e}_n(f,g) + 2R_n,\] hence statement 4 holds. Conversely, suppose statement 4 holds. For any \(n\in\mathbb{N}\), let \(f=\mathrm{dist}(\cdot,\Omega_{\leq n})\) and \(g=0\), and note that \[\sup_{x\in\Omega_{\infty}}\mathrm{dist}(x,\Omega_{\leq n}) = \mathrm{e}_{\infty}(f,g) \leq \mathrm{e}_n(f,g) + R_n = R_n,\] which converges to zero as \(n\to\infty\), hence statement 2 holds. ◻

Next, we prove Proposition 4, likewise via a direct argument.

Proof (Proposition 4).. Since \(\overline{\Omega}_{\infty}\) is compact, we have \(\mu_n\to\mu_{\infty}\) weakly if and only if \(\lim_nW_1(\mu_n,\mu_{\infty})=0\), or equivalently, if and only if \(\lim_n\sup_{f\in\mathcal{F}_1}|\mathbb{E}_{\mu_{\infty}}f-\mathbb{E}_{\mu_n}f|=0\). Thus, if \(\mu_n\to\mu_{\infty}\) weakly then \(\mathrm{e}_{\mu_{\infty}}(f,g)\leq \mathrm{e}_{\mu_n}(f,g)+2W_1(\mu_n,\mu_{\infty})\) since if \(f,g\in\mathcal{F}_1\) then \(\frac{1}{2}|f-g|\in\mathcal{F}_1\). Conversely, if such rate \(R_n\) exists, note that \[\begin{align} W_1(\mu_n,\mu_{\infty}) &=\sup_{f\in\mathcal{F}_1}|\mathbb{E}_{\mu_{\infty}}f-\mathbb{E}_{\mu_n}f| = \max\Big\{\sup_{f\in\mathcal{F}_1}(\mathbb{E}_{\mu_{\infty}}f-\mathbb{E}_{\mu_n}f),\;\sup_{f\in\mathcal{F}_1}(\mathbb{E}_{\mu_{\infty}}(-f)-\mathbb{E}_{\mu_n}(-f))\Big\}\\ &= \sup_{f\in\mathcal{F}_1}(\mathbb{E}_{\mu_{\infty}}f-\mathbb{E}_{\mu_n}f) = \sup_{f\in\mathcal{F}_1}(\mathbb{E}_{\mu_{\infty}}(f-\inf_{x\in\Omega_{\infty}}f(x))-\mathbb{E}_{\mu_n}(f-\inf_{x\in\Omega_{\infty}}f(x)))\\ &= \sup_{\substack{f\in\mathcal{F}_1\\ f\geq 0}}(\mathbb{E}_{\mu_{\infty}}f-\mathbb{E}_{\mu_n}f) = \sup_{\substack{f\in\mathcal{F}_1\\ f\geq 0}}(\mathrm{e}_{\mu_{\infty}}(f,0)-\mathrm{e}_{\mu_n}(f,0)) \leq R_n\to0, \end{align}\] and hence \(\mu_n\to\mu_{\infty}\) weakly. Above, in going from the first to the second line we used the fact that \(-f\in\mathcal{F}_1\) if and only if \(f\in\mathcal{F}_1\), and the last inequality follows since \(\mathrm{e}_{\mu}(f,0)=\mathbb{E}_{\mu}f\) when \(f\geq0\). ◻

We now prove Proposition 5 using Tychonoff’s theorem.

Proof (Proposition 5).. Endow each \(\mathcal{P}(\Omega_n)\) with the weak topology, metrized by the \(W_1\)-metric with respect to the given norms on \(\mathbb{V}_n\), and endow \(\prod_n\mathcal{P}(\Omega_n)\) with the product topology, metrized by \(d((\mu_k),(\nu_k))=\sum_{k\geq 1}2^{-k}W_1(\mu_k,\nu_k)\). Note that \(\prod_n\mathcal{P}(\Omega_n)\) is compact by Tychonoff’s theorem, and that the map sending \(x\mapsto (\mathrm{Law}(\mathsf{S}_k(x)))_k\) is an isometric embedding of \(\Omega_{\infty}\) into \(\prod_n\mathcal{P}(\Omega_n)\). It therefore extends to an isometric embedding of \(\overline{\Omega}_{\infty}\) as a closed, and therefore compact, subset of \(\prod_n\mathcal{P}(\Omega_n)\). In particular, each \(\Omega_n\) is totally bounded in \(d_{\mathrm{samp}}\) since \(\overline{\Omega}_{\infty}\) is totally bounded. The above argument further shows that convergence of \((x_i)\) in \(d_{\mathrm{samp}}\) is equivalent to convergence of the sequence of sequences \(((\mathsf{S}_k(x_i))_k)_i\) in the product topology on \(\prod_n\mathcal{P}(\Omega_n)\), which precisely means that \((\mathsf{S}_k(x_i))_i\) converges weakly for each \(k\). ◻

We turn to proving Proposition 6, relating limits in sampling metric to sequences of distributions.

Proof (Proposition 6).. For the first claim, let \(X\sim \mu\) and let \(\mathsf{S}_n\) be independent of \(X\) for each \(n\). Then \[\limsup_{n\to\infty}W_1(X, \mathsf{S}_n(X))\leq \limsup_{n\to\infty}\mathbb{E}_X\mathbb{E}_{\mathsf{S}_n}d_{\mathrm{samp}}(X,\mathsf{S}_n(X)) \leq \mathbb{E}\limsup_{n\to\infty}\mathbb{E}_{\mathsf{S}_n}d_{\mathrm{samp}}(X,\mathsf{S}_n(X))=0,\] where we used the fact that \(d_{\mathrm{samp}}(X,\mathsf{S}_n(X))\leq \mathrm{diam}(\overline{\Omega}_{\infty})<\infty\) almost surely. This proves that \(\mathsf{S}_n(X)\to X\) weakly in \(\overline{\Omega}_{\infty}\), which is the first claim.

For the second claim, it is clear that ?? is linear, i.e., maps mixtures to mixtures, as \(\mathrm{Law}(\mathsf{S}_n(X))=\int \mathrm{Law}(\mathsf{S}_n(x))\, d\nu(x)\) if \(X\sim\nu\) is independent of \(\mathsf{S}_n\). To see that it is continuous, note that if \(\mu_i\to\mu_{\infty}\) weakly in \(\mathcal{P}(\overline{\Omega}_{\infty})\), then there is a coupling of \(X_i\sim \mu_i\) such that \(X_i\to X_{\infty}\) in \(d_{\mathrm{samp}}\) almost surely by Skorokhod’s representation. We then get \(\mathrm{Law}(\mathsf{S}_n(X_i))\to\mathrm{Law}(\mathsf{S}_n(X_{\infty}))\) for each \(n\) where \(\mathsf{S}_n\) is independent of the \(X_i\). To see that ?? is injective, suppose \(\mathsf{S}_n(X)\overset{d}{=}\mathsf{S}_n(Y)\) for random \(X,Y\in\overline{\Omega}_{\infty}\) and for all \(n\) and take the weak limits of both sides as \(n\to\infty\) to obtain \(X\overset{d}{=}Y\) by the first claim. Thus, the map ?? is indeed a linear isomorphism onto its image. ◻

Finally, we prove Proposition 10.

Proof (Proposition 10).. For the first claim, it suffices to prove that if \(n=N\) and \(\mathsf{R}_k(x)\overset{d}{=}\mathsf{R}_k(y)\) for all \(k\) then there exists \(\pi\in\mathfrak{S}_n\) such that \(y=\rho(\pi)x\). Applying this claim to \(\rho(\kappa_{N,L})y, \rho(\kappa_{n,L})x\in\mathbb{V}_L\) yields the claim for general \(x\) and \(y\).

Suppose \(\mathsf{R}_k(x)\overset{d}{=}\mathsf{R}_k(y)\) for all \(k\) and \(n=N\). Then for each \(k\in\mathbb{N}\) there is a coupling \((F_{n,k},G_{n,k})\) of two uniformly random maps from \([k]\) to \([n]\) satisfying \(\rho(F_{n,k})x=\rho(G_{n,k})y\). We argue that for sufficiently-large \(k\geq n\), with positive probability we can find an injection \(\phi_{k,n}\colon[n]\to[k]\) such that \(G_{n,k}\circ\phi_{k,n}=\mathrm{id}_{[n]}\) and \(F_{n,k}\circ\phi_{k,n}\in\mathfrak{S}_n\) is a permutation, in which case applying \(\rho(\phi_{k,n})\) to both sides above yields \(\rho(F_{n,k}\circ\phi_{k,n})x=y\) as desired. To this end, we define a bipartite graph with bipartition \([n]\sqcup[n]\) where \(i,j\in[n]\) are connected if \(F_{n,k}^{-1}(i)\cap G_{n,k}^{-1}(j)\neq\emptyset\). We prove that this graph has a perfect matching \(\pi\in\mathfrak{S}_n\) with positive probability, in which case picking \(\phi_{k,n}(i)\in G_{n,k}^{-1}(i)\cap F_{n,k}^{-1}(\pi(i))\) yields the desired injection. We prove the existence of this perfect matching by showing that Hall’s condition holds with positive probability.

Pick \(\epsilon < \frac{1}{2n}\). For any subset \(S\subseteq[n]\), we have with probability at least \(1-2\exp(-2\epsilon^2k)\) that \[\left||G_{n,k}^{-1}(S)| - \frac{|S|k}{n}\right| \leq \epsilon k,\] since \(|G_{n,k}^{-1}(S)|=\sum_{i=1}^k\mathbb{1}[G_{n,k}(i)\in S]\sim\mathrm{Binom}(k,|S|/n)\). Therefore, with probability at least \(1-2^{n+2}\exp(-2\epsilon^2k)\) the above holds both for \(F_{n,k}\) and for \(G_{n,k}\), and simultaneously for all subsets \(S\subseteq[n]\). Choosing \(k\) sufficiently large ensures that this probability is positive. For each \(S\subseteq[n]\) define \[N(S)=\{i\in[n]: G_{n,k}^{-1}(i)\cap F_{n,k}^{-1}(S)\neq\emptyset\},\] and suppose that \(|N(S)|<|S|\) for some such \(S\). Observe that \(F_{n,k}^{-1}(S)\subseteq G_{n,k}^{-1}(N(S))\) by definition of \(N(S)\) and hence \[\frac{(|N(S)|+1)k}{n}-\epsilon k\leq\frac{|S|k}{n}-\epsilon k \leq |F_{n,k}^{-1}(S)|\leq |G_{n,k}^{-1}(N(S))|\leq \frac{|N(S)|k}{n}+\epsilon k.\] We conclude that \(\epsilon\geq \frac{1}{2n}\), a contradiction. Thus, we have \(|S|\leq |N(S)|\) for all \(S\subseteq[n]\), so Hall’s condition is satisfied and the above bipartite graph has a perfect matching, as desired. This proves the first claim.

For the second claim, suppose \(\mathsf{B}_k(x)\overset{d}{=}\mathsf{B}_k(y)\) for all \(k\), so there is a coupling \((F_{k,n},G_{k,N})\) of uniformly random maps \([n]\to[k]\) and \([N]\to[k]\), respectively, satisfying \(\beta(F_{k,n})x=\beta(G_{k,N})y\). Note that for \(k\geq n\), the random map \(F_{k,n}\) is injective with probability at least \(1-\frac{n(n-1)}{2k}\) and similarly for \(G_{k,N}\). Therefore, for \(k\geq N\) sufficiently large both \(F_{k,n}\) and \(G_{k,N}\) are injective with positive probability, in which case there are permutations \(\pi,\tau\in\mathfrak{S}_k\) satisfying \(F_{k,n}=\pi\circ\iota_{k,n}\) and \(G_{k,N}=\tau\circ\iota_{k,N}\). In this case we get \[\label{eq:injection95equivalence95step} \beta(\phi_{k,n})x=\beta(\iota_{k,N})y,\quad \textrm{for some injection } \phi_{k,n}\colon[n]\to[k].\tag{14}\] Define the map \(f\colon[k]\to[N]\) sending \(f(i)=i\) for \(i\in[N]\), sending \(\phi_{k,n}([n])\setminus[N]\) injectively to \([N]\setminus \phi_{k,n}([n])\), and sending \(f(i)=1\) for \(i\notin [N]\cup \phi_{k,n}([n])\). Note that \(f\circ\iota_{k,N}=\mathrm{id}_{[N]}\) and \(f\circ\phi_{k,n}\) is injective, so applying \(\beta(f)\) to both sides in 14 yields the second claim. ◻

3 Rates for Sampling with Replacement↩︎

In this section, we prove rates for any-dimensional sketching and generalization using the sampling metric defined with respect to sampling with replacement 3 . The general outline for this section is as follows. We first derive rates at which arbitrary objects can be approximated by fixed-dimensional ones in Theorem 12, quantifying part 2 of Theorem 3. Based on Proposition 6, we then characterize in Theorem 13 the structure of any-dimensional data distributions obtained by sampling with replacement from limit objects. Next we leverage the equivalences in Theorem 3 to derive explicit sketching and generalization rates in Theorem 14 for functions continuous with respect to sampling with replacement. We conclude by deriving corollaries of our general results for functions arising in several applications, including graph densities and signals as well as many permutation-invariant neural network architectures such as transformers.

3.1 Main Results↩︎

We fix a compatible sequence of index sets \((\mathcal{I}_n)\), and consider the associated vector spaces \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) and sampling with replacement maps \((\mathsf{R}_k\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{V}_k)\) defined by 3 . We also fix a sequence of compact sets \((\Omega_n)\) closed under sampling, such as the sequence of hypercubes \(\Omega_n=[-r,r]^{\mathcal{I}_n}\). Throughout this section, we consider the sampling metric 1 defined using \((\mathsf{R}_k)\), with \(W_1\)-distances taken with respect to the \(\ell_{\infty}\)-norms.

Our first result shows that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\to0\) as \(n\to\infty\) and gives the associated rate at which this expectation goes to zero. To bound \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\), we must bound for each \(k\) the expected distance \(\mathbb{E}_{\mathsf{R}_n}W_1(\mathsf{R}_k(x),\mathsf{R}_k\circ\mathsf{R}_n(x))\), where we (a) fix a realization of \(\mathsf{R}_n\); (b) compute the \(W_1\) distance between the distributions of \(\mathsf{R}_k(x)\) and \(\mathsf{R}_k\circ\mathsf{R}_n(x)\), yielding a random number depending on \(\mathsf{R}_n\); and (c) take the expectation with respect to \(\mathsf{R}_n\).

Theorem 12. Suppose a compatible sequence \((\mathcal{I}_n)\) has degree \(D\), and suppose \((\Omega_n\subseteq[-r,r]^{\mathcal{I}_n})\) is closed under sampling. Then for any \(x\in\bigsqcup_n\Omega_n\) and \(k\leq n\) such that \(|\mathcal{I}_k|>2\), we have \[\mathbb{E}_{\mathsf{R}_n}W_1(\mathsf{R}_k(x), \mathsf{R}_k\circ\mathsf{R}_n(x))\leq \frac{k(k-1)}{n}r + 208r\left(\frac{k^2r^2}{n}\right)^{1/|\mathcal{I}_k|}\] and \(W_1(\mathsf{R}_k(x), \mathsf{R}_k\circ\mathsf{R}_n(x))\) is \(\frac{4k^2r^2}{n}\)-subgaussian with respect to the randomness in \(\mathsf{R}_n\). We also have \[\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\leq Cr\exp\Big[-(M^{-1}\log_2 n)^{\frac{1}{1+D}}\Big],\] where \(C>0\) is a constant depending on \((\mathcal{I}_n)\) and \(M\) is as in Definition 6. Furthermore, the distance \(d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\) is \(\frac{16r^2}{n}\)-subgaussian.

The proof is based on the observation that a uniformly random map \(F_{N,k}\colon[k]\to[N]\) can be identified with \(k\) iid uniformly distributed random indices \((F_{N,k}(1),\ldots,F_{N,k}(k))\) in \([N]\), so \(\mathrm{Law}(F_{N,k})=\mu^{\otimes k}\) where \(\mu\) is the uniform distribution on \([N]\). Meanwhile, if we fix a realization \(\widehat F_{N,n}\) of \(F_{N,n}\), we have \(\mathrm{Law}(\widehat F_{N,n}\circ F_{n,k})=\mu_n^{\otimes k}\) where \(\mu_n=\frac{1}{n}\sum_{i=1}^n\delta_{\widehat F_{N,n}(i)}\) is an empirical measure obtained by sampling \(n\) iid points from \(\mu\). Comparing \(\mu_n\) to \(\mu\) yields the proof, see Section 3.2.

We give a few examples of the rates implied by Theorem 12.

Example 15 (Sampling columns with replacement). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) and \(\Omega_n=[-r,r]^{d\times n}\). As discussed in Example 5, we have an isomorphism \(\overline{\Omega}_{\infty}\cong \mathcal{P}([-r,r]^d)\) induced by \(x\mapsto \mathrm{Law}(\mathsf{R}_1(x))\). In particular, in this special case we have \(\mathrm{Law}(\mathsf{R}_k(x))=\mathrm{Law}(\mathsf{R}_1(x))^{\otimes k}\), so \(d_{\mathrm{samp}}(x,y)\) and \(W_1(\mathsf{R}_1(x),\mathsf{R}_1(y))\) metrize the same topology. The rate \(\mathbb{E}_{\mathsf{R}_n}W_1(\mathsf{R}_1(x),\mathsf{R}_1\circ\mathsf{R}_n(x))=O(n^{-1/d})\) for \(d>2\) from Theorem 12 is optimal [36].

Example 16 (Sampling vertices with replacement). Suppose \(\mathbb{V}_n=\mathbb{R}^{n\times n}\) and let \(\Omega_n\subseteq[-r,r]^{n\times n}\) be closed under sampling. Convergence in \(d_{\mathrm{samp}}\) recovers the limits of weighted graphs studied in [4]. We obtain a rate of convergence of \(O(\exp[-(\log_2 n)^{1/3}])\) in \(d_{\mathrm{samp}}\), compared with a rate of \(O(\exp[-\frac{1}{2}\log\log n])\) implied by the results of [4] (who focus on convergence in a different metric, but the two can be related as in [12]). We get the similar rate \(O(\exp[-(\frac{1}{2}\log_2 n)^{1/3}])\) for pairs of graphs and graph signals on them, for which \(\mathbb{V}_n=\mathbb{R}^{n\times n}\oplus\mathbb{R}^{n\times d}\). Likewise, we obtain a rate of \(O\left(\exp\left[-(M^{-1}\log n)^{\frac{1}{1+D}}\right]\right)\) for approximation of general rank-\(D\) hypergraphs (with \(M=1\)) and hypergraph signals (\(M=2\)).

Theorem 12 has two important consequences. First, it implies that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\to0\) for any \(x\in\overline{\Omega}_{\infty}\), so Proposition 6 applies and gives us a characterization of any-dimensional data distributions obtained by sampling from random limit objects.

Theorem 13 (Projection-consistent distributions). Suppose \((\mathcal{I}_n)\) has finite degree and let \((\Omega_n\subseteq[-r,r]^{\mathcal{I}_n})\) be closed under sampling. Then the following are equivalent for a sequence of probability distributions \((\mu_n\in\mathcal{P}(\Omega_n))\):

  1. We have \(\rho(\phi_{N,n})\mu_N=\mu_n\) whenever \(\phi_{N,n}\colon[n]\to[N]\) is injective.

  2. There exists a distribution \(\mu_{\infty}\in\mathcal{P}(\overline{\Omega}_{\infty})\) such that \(\mu_n=\mathrm{Law}(\mathsf{R}_n(X))\) for all \(n\), where \(X\sim\mu_{\infty}\) is independent of \(\mathsf{R}_n\).

Moreover, the measure \(\mu_{\infty}\) above is unique, and sequences of the form \((\mu_n=\mathrm{Law}(\mathsf{R}_n(x)))\) for deterministic \(x\in\overline{\Omega}_{\infty}\) are extremal in the set of all projection-consistent sequences.

The proof combines Proposition 6 and Theorem 12, along with a “finite” de Finetti theorem comparing sampling with and without replacement from [15] generalizing [43], see Section 3.2.

Theorem 13 may be viewed as generalizing one formulation of de Finetti’s theorem and several related results concerning infinite exchangeable arrays, as we proceed to illustrate.

Example 17 (Infinite exchangeable arrays). Suppose \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) and \(\Omega_n=\Theta^n\) for compact \(\Theta\subseteq\mathbb{R}^d\). In this case, projection-consistent distributions are precisely infinite exchangeable arrays. Indeed, if \((X_1,X_2,\ldots)\) is an infinite exchangeable array with \(X_i\in\Theta\) almost surely then \(\mu_n=\mathrm{Law}(X_1,\ldots,X_n)\) is projection-consistent, and conversely if a sequence of measures \((\mu_n\in\mathcal{P}(\Omega_n))\) is projection-consistent then the sequence \((X_1,\ldots,X_n)\sim\mu_n\) extends to an infinite exchangeable array by Kolmogorov’s extension theorem. Since \(\overline{\Omega}_{\infty}\cong\mathcal{P}(\Theta)\) in this case, Theorem 13 recovers the correspondence between infinite exchangeable arrays and mixtures of iid arrays, along with the extremality of iid arrays, that follows from de Finetti’s theorem and its extensions by Hewitt–Savage [44] and Dynkin [45].

Example 18 (Infinite exchangeable random graph models). Suppose \(\mathbb{V}_n=\mathbb{R}^{n\times n}\) and \(\Omega_n\subseteq\{0,1\}^{n\times n}\). Reasoning as in Example 17, we note that projection-consistent sequences \((\mu_n\in\mathcal{P}(\Omega_n))\) correspond to infinite two-dimensional arrays of binary random variables \((X_{i,j})_{i,j\in\mathbb{N}}\) whose distribution is unchanged by simultaneous permutations of rows and columns. Such arrays can be viewed, in turn, as unweighted random graph models on countably-many exchangeable vertices, see [3]. In this setting, Theorem 13 implies that the countable random graph models obtained by sampling vertices with replacement from deterministic graphs and their limits are extremal, recovering [3]. Our Theorem 13 similarly applies to general weighted countable graph models, as well as hypergraph models.

The second consequence of Theorem 12 is sketching and generalization bounds for functions continuous in sampling metric. While the rates we obtain for general Lipschitz-continuous functions are quite slow, we obtain substantially faster rates by exploiting particular representations of the functions at hand in terms of low-dimensional samples of their inputs.

Theorem 14 (Sketching and generalization rates). In the setting of Theorem 12, consider functions \(f,\widehat f\colon\bigsqcup_n\Omega_n\to\mathbb{R}\).

  1. If \(f\) is \(L\)-Lipschitz in \(d_{\mathrm{samp}}\), then for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\) we have \[|f(x)-f(\mathsf{R}_n(x))|\leq LCr\exp\Big[-(M^{-1}\log_2 n)^{\frac{1}{1+D}}\Big] + \frac{4rL\epsilon}{\sqrt{n}}.\] If \(\widehat f\) is also \(L\)-Lipschitz in \(d_{\mathrm{samp}}\), then \[\label{eq:generalization95sampling95lip} \mathrm{e}_{\infty}(f,\widehat f)\leq\mathrm{e}_n(f,\widehat f)+2LCr\exp\left(-(M^{-1}\log_2 n)^{\frac{1}{1+D}}\right).\qquad{(4)}\]

  2. Suppose \(f(x)=g(\mathrm{Law}(\mathsf{R}_k(x)))\) where \(g\colon\mathcal{P}(\Omega_k)\to\mathbb{R}\) is \(L\)-Lipschitz in Wasserstein distance and \(|\mathcal{I}_k|>2\). Then for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\) we have \[|f(x)-f(\mathsf{R}_n(x))| \leq Lr\left[ \frac{k(k-1)}{n} + \frac{2k\epsilon}{\sqrt{n}} + 208\left(\frac{k^2r^2}{n}\right)^{1/|\mathcal{I}_k|}\right].\] If \(\widehat f\) has the same form as \(f\) above, then \[\label{eq:generalization95sampling95Law} \mathrm{e}_{\infty}(f,\widehat f)\leq \mathrm{e}_n(f,\widehat f) + 2Lr\left[\frac{k(k-1)}{n} + 208\left(\frac{k^2r^2}{n}\right)^{1/|\mathcal{I}_k|}\right].\qquad{(5)}\]

  3. Suppose \(f=\sigma(\mathbb{E}g_k\circ\mathsf{R}_k)\) where each coordinate function of \(g_k\colon\Omega_k\to\mathbb{R}^\ell\) is \(B\)-bounded and \(\sigma\colon\mathbb{R}^\ell\to\mathbb{R}\) is \(L_{\sigma}\)-Lipschitz with respect to the \(\ell_1\) norm on \(\mathbb{R}^\ell\). Then for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\) we have \[|f(x)-f(\mathsf{R}_n(x))|\leq L_{\sigma}Bk\ell\left(\frac{k-1}{n}+\frac{2\epsilon}{\sqrt{n}}\right).\] If \(\widehat f\) has the same form (possibly with a different \(L_{\sigma}\)-Lipschitz \(\widehat \sigma\) and \(B\)-bounded \(\widehat g_k\)), then \[\label{eq:generalization95sampling95means} \mathrm{e}_{\infty}(f,\widehat f)\leq \mathrm{e}_n(f,\widehat f) + 2L_{\sigma}Bk\ell\left(\frac{k-1}{n} + \frac{2}{\sqrt{n}}\right).\qquad{(6)}\] When \(\ell=1\) and \(\sigma=\mathrm{id}\), the \(2/\sqrt{n}\) term above can be omitted.

The generalization bounds ?? , ?? , and ?? also hold for average error with respect to projection-consistent distributions.

The proof uses Theorem 12, and we again defer it to Section 3.2. We now illustrate these improved rates on several classes of functions, beginning with polynomials.

Corollary 3 (Polynomials). In the setting of Theorem 12, let \(p\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) be a polynomial of degree \(d\) unchanged by equipartitions in the sense of 10 . Then there exists \(B>0\) such that for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\), we have \[\label{eq:sampling95poly95sketch} |p(x)-p(\mathsf{R}_n(x))|\leq BDd\left[\frac{Dd-1}{n} + \frac{2\epsilon}{\sqrt{n}}\right].\qquad{(7)}\] If \(\widehat p\) is another such polynomial, then there exists \(\widehat B>0\) such that \[\mathrm{e}_{\infty}(p,\widehat p)\leq \mathrm{e}_n(p,\widehat p) + \frac{(B+\widehat B)Dd(Dd-1)}{n}.\]

Proof. It was shown in [15] that there is a polynomial \(g_{Dd}\in\mathbb{R}[\mathbb{V}_{Dd}]\) satisfying \(p(x)=\mathbb{E}g_{Dd}(\mathsf{R}_{Dd}x)\) for all \(x\). Setting \(B=\sup_{x\in\Omega_{Dd}}|g_{Dd}(x)|\) and similarly for \(\widehat B\), we obtain both conclusions from Theorem 14. ◻

Notably, Corollary 3 applies to any polynomial function and any finite-degree compatible sequence of index sets. Here are a few examples encompassed by the above result.

  1. When \(\mathbb{V}_n=\mathbb{R}^{d\times n}\), polynomials unchanged by duplication are precisely moment polynomials \[p(x)=q\Big(\mathbb{E}(\mathsf{R}_1(x))^{\alpha_1},\ldots,\mathbb{E}(\mathsf{R}_1(x))^{\alpha_\ell}\Big),\] where \(\alpha_i\in \mathbb{N}_0^d\) and \(q\) is a fixed polynomial [15]. Here \(\mathbb{E}(\mathsf{R}_1(x))^{\alpha}=\frac{1}{n}\sum_{j=1}^n\prod_{\ell=1}^d(x_j)_\ell^{\alpha_{\ell}}\) for \(\alpha\in\mathbb{N}_0^d\).

  2. When \(\mathbb{V}_n=\mathbb{R}^{n\times n}\), polynomials unchanged by duplication are precisely linear combinations of graph homomorphism densities [15]. Specifically, if \(H\in\mathbb{N}_0^{k\times k}\) is a multigraph, we define the homomorphism density of \(H\) in \(G\in\mathbb{V}_n\) by \[t(H;G) = \frac{1}{n^k}\sum_{f\colon[k]\to[n]}\prod_{i,j=1}^kG_{f(i),f(j)}^{H_{i,j}}.\] It is called a homomorphism density because when \(H\) and \(G\) are undirected simple graphs, the value \(t(H;G)\) is the fraction of maps between vertex sets \(V(H)\to V(G)\) that are graph homomorphisms. Similarly, when \(\mathbb{V}_n=(\mathbb{R}^n)^{\otimes d}\) is viewed as the space of adjacency tensors of hypergraphs, polynomials unchanged by duplication correspond to linear combinations of hypergraph densities.

  3. When \(\mathbb{V}_n=\mathbb{R}^{n\times n}\oplus \mathbb{R}^{n\times d}\) consists of pairs of graphs and graph signals on them, then polynomials unchanged by duplication include polynomial graphon neural networks [23], which are compositions of polynomials of the form \[(G,X)\mapsto \sigma\left(\sum_{\ell=0}^L\frac{1}{n^{\ell}}G^{\ell}X\Theta_{\ell}\right),\quad \textrm{for polynomial } \sigma \textrm{ and } \Theta_0,\ldots,\Theta_L\in\mathbb{R}^{d\times d}.\]

For all of the above families of polynomials, we obtain any-dimensional sketching rates of \(O(n^{-1/2})\) and any-dimensional generalization rates of \(O(n^{-1})\).

We remark that the rates for these polynomials are a substantial improvement over those previously available. For example, the result [16] implies \(O(n^{-1/d})\) generalization rates for moment polynomials and \(O(1/\sqrt{\log n})\) rates for graph densities and signals with respect to projection-consistent any-dimensional distributions. The improvement comes precisely from exploiting the fact that polynomials compute moments of low-dimensional samples, instead of merely their Lipschitz continuity.

Next, we turn to nonpolynomial function classes.

Corollary 4 (Normalized DeepSets). Suppose \(\mathcal{I}_n=[d]\times [n]\) so \(\mathbb{V}_n=\mathbb{R}^{d\times n}\), and let \((\Omega_n\subseteq [-r,r]^{d\times n})\) be a sequence of compact sets closed under sampling. Suppose each coordinate function of \(h\colon\mathbb{R}^d\to\mathbb{R}^\ell\) is \(B\)-bounded on \(\Omega_1\) and \(\sigma\colon\mathbb{R}^\ell\to\mathbb{R}\) is \(L_{\sigma}\)-Lipschitz in \(\ell_1\)-norm. Consider \(f\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) defined by \[\label{eq:normalized95deepsets} f(x)=\sigma\left(\frac{1}{n}\sum_{i=1}^nh(x_i)\right)=\sigma(\mathbb{E}h\circ\mathsf{R}_1(x)),\quad \textrm{for } x=(x_1,\ldots,x_n)\in\mathbb{V}_n.\qquad{(8)}\] Then for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\) we have \[|f(x)-f(\mathsf{R}_n(x))|\leq \frac{2L_{\sigma}B\ell\epsilon}{\sqrt{n}},\] and for any other \(\widehat f\) of the above form, we have \[\mathrm{e}_{\infty}(f,\widehat f)\leq \mathrm{e}_n(f,\widehat f) + \frac{4L_{\sigma}B\ell}{\sqrt{n}}.\]

Proof. This directly follows from Theorem 14. ◻

When \(\sigma\) and \(h\) are neural networks, the architecture defined by ?? is called normalized DeepSets [16], [21]. In particular, when \(\Omega_n=\Theta^n\) for compact \(\Theta\subseteq\mathbb{R}^d\), we can extend \(f\) in ?? to measures \(\mu\in\mathcal{P}(\Theta)\) by \(f(\mu)=\sigma(\mathbb{E}_{\mu}h)\). This extension was shown in [21] to be Lipschitz-continuous in Wasserstein metric on \(\mathcal{P}(\Theta)\). In turn, the result [16] implies \(O(n^{-1/d})\) generalization rates for such Lipschitz functions on measures for average error with respect to infinite exchangeable arrays (Example 17). This rate can similarly be derived from Theorem 14, and Corollary 4 yields improved \(O(n^{-1/2})\) rates for functions of the form ?? .

Finally, we give sketching and generalization rates for transformers, making Corollary 2 precise.

Corollary 5 (Permutation-invariant transformers). Suppose \(\mathcal{I}_n=[d]\times[n]\) with \(d>2\), so \(\mathbb{V}_n=\mathbb{R}^{d\times n}\), and \(\Omega_n=\Theta^n\) for compact \(\Theta\subseteq[-r,r]^d\). For matrices \(Q,K\in\mathbb{R}^{h\times d}\) and \(V\in\mathbb{R}^{d\times d}\), define the self-attention mapping \(A\colon\mathbb{V}_n\to\mathbb{V}_n\) by \[\label{eq:attention} A(x_1,\ldots,x_n)_i = x_i + \frac{1}{Z_i}\sum_{j=1}^n\exp(\langle Qx_i, Kx_j\rangle)Vx_j,\quad \textrm{where } Z_i=\sum_{j=1}^n\exp(\langle Qx_i, Kx_j\rangle).\qquad{(9)}\] Let \(\phi\colon\mathbb{R}^d\to\mathbb{R}^d\) be \(L_{\phi}\)-Lipschitz, and let it act column-wise on \(\mathbb{V}_n\). Finally, let \(P\colon\mathbb{V}_n\to\mathbb{V}_1\) be the mean pooling map \(P(x_1,\ldots,x_n)=\frac{1}{n}\sum_{i=1}^nx_i\). Define a depth-\(\ell\) transformer to be the mapping \(T\colon\mathbb{V}_n\to\mathbb{V}_1\) defined by the composition \[T = P\circ(\phi\circ A)^{\circ \ell},\] Then there exists an \(L\)-Lipschitz continuous map \(\bar T\colon\mathcal{P}(\Theta)\to \mathbb{R}^d\) satisfying \(T(x)=\bar T(\mathrm{Law}(\mathsf{R}_1(x)))\). Consequently, for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\) we have \[\label{eq:transformer95sampling} |T(x)-T(\mathsf{R}_n(x))|\leq Lr\left[\frac{2\epsilon}{\sqrt{n}} + \frac{208 r^{2/d}}{n^{1/d}}\right].\qquad{(10)}\] For any other \(L\)-Lipschitz map \(\bar G\colon\mathcal{P}(\Theta)\to\mathbb{R}^d\), we define \(G(x)=\bar G(\mathrm{Law}(\mathsf{R}_1(x)))\) and obtain \[\mathrm{e}_{\infty}(T,G)\leq \mathrm{e}_n(T,G) + \frac{416Lr^{1+2/d}}{n^{1/d}},\] where \(\mathrm{e}_n(T,G)=\sup_{x\in\Theta^n}\|T(x)-G(x)\|_{\infty}\) and similarly for \(\mathrm{e}_{\infty}\).

The proof is based on the measure-theoretic in-context mapping of [17], and is deferred to Section 3.2. We remark that evaluating \(T(x)\) exactly for \(x\in\mathbb{V}_N\) takes \(O(N^2)\) operations due to ?? , but evaluating it to a desired accuracy \(\delta>0\) can be done with high probability in \(O(\delta^{-2d})\) time (independent of the length \(N\) of the input) after sampling \(n=O(\delta^{-d})\) columns from \(x\) uniformly at random and using ?? .

3.2 Missing Proofs from Section 3↩︎

We begin by proving Theorem 12. The following is the key proposition we shall need.

Proposition 15. Fix a bounded \(f\colon\Omega_k\to\mathbb{R}\) and \(x\in\bigsqcup_n\Omega_n\), and define the random variable \(Z_f=\mathbb{E}_{\mathsf{R}_k}f(\mathsf{R}_k\circ\mathsf{R}_n(x)) - \mathbb{E}f(\mathsf{R}_k(x))\) where expectations are only with respect to \(\mathsf{R}_k\), which is independent of \(\mathsf{R}_n\).

  1. We have \(|\mathbb{E}_{\mathsf{R}_n}Z_f|\leq \frac{k(k-1)}{n}\|f\|_{\infty}\) whenever \(k\leq n\).

  2. \(Z_f-\mathbb{E}_{\mathsf{R}_n}Z_f\) is \(\frac{4k^2}{n}\|f\|_{\infty}^2\)-subgaussian.

Proof. By [46], there is a coupling of a uniformly random map \(F_{n,k}\) and of a uniformly random injection \(\Phi_{n,k}\) such that \(\mathbb{P}[F_{n,k}\neq \Phi_{n,k}]\leq \frac{k(k-1)}{2n}\). Furthermore, since \(F_{N,n}\circ\phi_{n,k}\overset{d}{=}F_{N,k}\) for any injection \(\phi_{n,k}\colon[k]\to[n]\), we have \(\rho(\Phi_{n,k})\circ \mathsf{R}_n\overset{d}{=}\mathsf{R}_k\) if \(\mathsf{R}_n\) is independent of \(\Phi_{n,k}\). In this case, we have \[|\mathbb{E}Z_f| = |\mathbb{E}f(\rho(F_{n,k})\circ\mathsf{R}_n(x)) - \mathbb{E}f(\rho(\Phi_{n,k})\circ\mathsf{R}_n(x))| \leq 2\|f\|_{\infty}\mathbb{P}\Big[F_{n,k}\neq \Phi_{n,k}\Big]\leq \|f\|_{\infty}\frac{k(k-1)}{n},\] as claimed.

To see the subgaussianity of \(Z_f\), represent a map \([n]\to[N]\) as a sequence in \([N]^n\), and observe that \(\mathrm{Law}(F_{N,n})=\mathrm{Unif}[N]^{\otimes n}\). Writing \(\mathsf{R}_n=\rho(\widehat{F}_{N,n})\), let \(\mu_n=\frac{1}{n}\sum_{i=1}^n\delta_{\widehat{F}_{N,n}(i)}\) be the empirical measure obtained by sampling \(n\) iid points from \(\mu=\mathrm{Unif}([N])\). Now observe that \(\mathrm{Law}(\widehat{F}_{N,n}F_{n,k})=\mu_n^{\otimes k}\) conditioned on \(\widehat{F}_{N,n}\) while \(\mathrm{Law}(F_{N,k})=\mu^{\otimes k}\). Furthermore, if we define \(\widetilde{f}\colon [N]^k\to \mathbb{R}\) by \(\widetilde{f}(F)=f(\rho(F)x)\), then \[\label{eq:V95stat95rep} \mathbb{E}_{\mathsf{R}_k}f(\mathsf{R}_k\circ\mathsf{R}_n(x))=\mathbb{E}_{\mu_n^{\otimes k}}\widetilde{f}=\frac{1}{n^k}\sum_{i_1,\ldots,i_k=1}^n\widetilde{f}\Big(\left[\widehat F_{N,n}(i_1),\ldots,\widehat F_{N,n}(i_k)\right]\Big),\tag{15}\] where \(\|\widetilde{f}\|_{\infty}\leq\|f\|_{\infty}\). Changing the value \(\widehat F_{N,n}(i_{\ell})\) for any fixed \(\ell\in[n]\) changes the value of \(\mathbb{E}_{\mu_n^{\otimes k}}\widetilde{f}\) by at most \(\frac{2k}{n}\|f\|_{\infty}\), hence \(Z_f-\mathbb{E}Z_f\) is \(\frac{4k^2}{n}\|f\|_{\infty}^2\)-subgaussian by the bounded-difference inequality [47]. ◻

We turn to proving Theorem 12 by combining Proposition 15 with the following standard covering number bound.

Lemma 1 (Covering number bound). In the setting of Proposition 15, suppose \(\mathcal{F}_k\) is a family of functions on \(\Omega_k\) with \(\sup_{f\in\mathcal{F}_k}\sup_{x\in\Omega_k}|f(x)|\leq r\). Then \[\mathbb{E}\sup_{f\in\mathcal{F}_k}Z_f \leq r\frac{k(k-1)}{n} + \inf_{\delta>0}\left\{4\delta + \frac{16\sqrt{2}kr}{\sqrt{n}}\int_{\delta}^{r}\sqrt{\log N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon)}\, d\epsilon\right\},\] where \(N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon)\) is the \(\epsilon\)-covering number of the function class \(\mathcal{F}_k\) in \(\|\cdot\|_{\infty}\). Moreover, the random variable \(\sup_{f\in\mathcal{F}_k}Z_f\) is \(\frac{4k^2r^2}{n}\)-subgaussian.

Proof. Since \(Z_f-Z_g=Z_{f-g}\), we conclude that \(\{Z_f-\mathbb{E}Z_f\}_{f\in\mathcal{F}_k}\) is a centered \(\frac{4k^2r^2}{n}\)-subgaussian process with respect to the uniform metric. Since the diameter of \(\mathcal{F}_k\) under the uniform metric is at most \(2r\) by assumption, Dudley’s entropy integral bound [48] gives \[\mathbb{E}\sup_{f\in\mathcal{F}_k}(Z_f-\mathbb{E}Z_f)\leq \inf_{\delta>0}\left\{4\delta + \frac{16\sqrt{2}kr}{\sqrt{n}}\int_{\delta}^{r}\sqrt{\log N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon)}\, d\epsilon\right\}.\] Combining the above bound with our bias bound from Proposition 15 yields the third claim.

Finally, observe that \(Z_f\) is a function of \(n\) iid random indices \(\widehat F_{N,n}(1),\ldots,\widehat{F}_{N,n}(n)\), and that changing the value of one of these indices affects at most \(n^k-(n-1)^k\leq kn^{k-1}\) terms in 15 by at most \(2\|f\|_{\infty}/n^k\leq 2r/n^k\). Therefore, each \(Z_f\) is a \(\frac{2kr}{n}\)-Lipschitz function with respect to the Hamming distance on \([N]^n\), and hence the same is true of \(\sup_{f\in\mathcal{F}_k}Z_f\). The bounded difference inequality [47] yields the final claim. ◻

Combining Lemma 1 with covering number bounds for Lipschitz functions yields Theorem 12.

Proof (Theorem 12). Let \(\mathcal{F}_k\) be the collection of all functions \(f\colon[-r,r]^{\mathcal{I}_k}\to\mathbb{R}\) with \(f(0)=0\) that are 1-Lipschitz with respect to the \(\ell_{\infty}\)-norm, and note that \(\sup_{f\in\mathcal{F}_k}\|f\|_{\infty}\leq r\). Combining the definition of the \(W_1\) distance with Lemma 1 gives \[\mathbb{E}_{\mathsf{R}_n}W_1(\mathsf{R}_k(x),\mathsf{R}_k\circ\mathsf{R}_n(x)) \leq \mathbb{E}\sup_{f\in\mathcal{F}_k}Z_f\leq r\frac{k(k-1)}{n} + \inf_{\delta>0}\left\{4\delta + \frac{16\sqrt{2}kr}{\sqrt{n}}\int_{\delta}^{r}\sqrt{\log N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon)}\, d\epsilon\right\}.\] By [49] (or by [50]), we have \[\log N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon) \leq (\log 2)N([-r,r]^{\mathcal{I}_k},\|\cdot\|_{\infty},\epsilon/2)+\log\left(2\left\lceil\frac{2r}{\epsilon}\right\rceil +1\right).\] We further have \(N([-r,r]^{\mathcal{I}_k},\|\cdot\|_{\infty},\epsilon/2)\leq \left\lceil 4r/\epsilon\right\rceil^{|\mathcal{I}_k|}\) and hence \(\log N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon) \leq (1+\log 2)\left(\frac{5r}{\epsilon}\right)^{|\mathcal{I}_k|}\) for all \(\epsilon\in(0,2r)\). Since \(|\mathcal{I}_k|>2\), we have \[4\delta + \frac{16\sqrt{2}kr}{\sqrt{n}}\int_{\delta}^{r}\sqrt{\log N(\mathcal{F}_k,\|\cdot\|_{\infty},\epsilon)}\, d\epsilon\leq 4\delta+16\sqrt{2(1+\log 2)}\frac{kr}{\sqrt{n}}(5r)^{|\mathcal{I}_k|/2}\frac{\delta^{-|\mathcal{I}_k|/2+1}}{|\mathcal{I}_k|/2-1}.\] Choosing \(\delta=5r\left(4\frac{kr}{\sqrt{n}}\sqrt{2(1+\log 2)}\right)^{2/|\mathcal{I}_k|}\), we obtain the claimed estimate \(208r\left(\frac{k^2r^2}{n}\right)^{1/|\mathcal{I}_k|}\). Proposition 15 also shows that \(\sup_{f\in\mathcal{F}_k}Z_f\) is \(\frac{4k^2r^2}{n}\)-subgaussian.

Turning to the claim bound on \(d_{\mathrm{samp}}\), for any \(K\leq n\) we have \[\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\leq \sum_{k=1}^K2^{-k}\mathbb{E}_{\mathsf{R}_n}W_1(\mathsf{R}_k(x),\mathsf{R}_k\circ\mathsf{R}_n(x)) + 2^{-K+1}r\leq Cr\left(\frac{r^2}{n}\right)^{\frac{1}{MK^D}} + 2^{-K}r\] obtained by estimating \(\mathbb{E}_{\mathsf{R}_n}W_1(\mathsf{R}_k(x),\mathsf{R}_k\circ\mathsf{R}_n(x))\leq 2r\) for \(k\geq K\) and applying the upper bounds from the first part of this corollary (if \(|\mathcal{I}_k|\leq 2\) for some small \(k\), the covering number argument yields bounds of \(O(n^{-1/2})\) or \(O(n^{-1/2}\log n)\), both of which are dominated by the slower \(|\mathcal{I}_k|>2\) terms). Choosing \(K=\left\lceil\left(\frac{\log_2 n}{M}\right)^{\frac{1}{D+1}}\right\rceil\) if \(r\leq 1\) and \(K=\left\lceil\left(\frac{\log_2 (n/r^2)}{M}\right)^{\frac{1}{D+1}}\right\rceil\) gives the desired bound. Finally, the same proof as in Proposition 15 shows that \(d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\) is a function of \(n\) independent random variables and is \(\sum_{k\geq 1}2^{-k}\frac{2kr}{n}=\frac{4r}{n}\)-Lipschitz in Hamming distance in each of them, hence the bounded-difference inequality yields its claimed \(\frac{16r^2}{n}\)-subgaussianity. ◻

We turn to proving Theorem 13 by combining Proposition 6 and a “finite” de Finetti theorem from [15].

Proof (Theorem 13).. Propositions 8 and 9 show that if \(\mu_n=\mathrm{Law}(\mathsf{R}_n(X))\) for random \(X\) independent of \(\mathsf{R}_n\), then \((\mu_n)\) is projection-consistent. Conversely, if \((\mu_n)\) is projection-consistent then by [15] there is a sequence \(\nu_i\in\mathcal{P}(\Omega_{\infty})\) such that \(\mathrm{Law}(\mathsf{R}_n(X_i))\xrightarrow{i\to\infty}\mu_n\) weakly for each \(n\) where \(X_i\sim\nu_i\) is independent of \(\mathsf{R}_n\). This implies that the sequence \((\nu_i)\) converges weakly with respect to \(d_{\mathrm{samp}}\), and \(\mu_{\infty}=\lim_i\nu_i\in\mathcal{P}(\overline{\Omega}_{\infty})\) then satisfies the desired sampling representation. The last claim follows by Proposition 6, which applies by Theorem 12. Specifically, Theorem 12 shows that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\to0\) as \(n\to\infty\) at a universal rate for all \(x\in\Omega_{\infty}\). If \(x\in\overline{\Omega}_{\infty}\) then we can write \(x=\lim_ix_i\) for \(x_i\in\Omega_{\infty}\), so \(\mathsf{R}_n(x)\) is the weak limit of \(\mathsf{R}_n(x_i)\). A simple application of the triangle inequality shows that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\to0\) at the same universal rate, so the condition ?? in Proposition 6 is satisfied. ◻

Next, we prove the sketching and generalization bounds in Theorem 14.

Proof (Theorem 14).. If \(f\) and \(\widehat f\) are \(L\)-Lipschitz in \(d_{\mathrm{samp}}\) and \(x\in\bigsqcup_n\Omega_n\), then \(|f(x)-f(\mathsf{R}_n(x))|\leq Ld_{\mathrm{samp}}(x,\mathsf{R}_n x)\) and \[\label{eq:main95generalization95bound} |f(x)-\widehat f(x)|\leq |f(x)-\mathbb{E}f(\mathsf{R}_n(x))| + |\mathbb{E}[f(\mathsf{R}_n(x))-\widehat f(\mathsf{R}_n(x))]| + |\mathbb{E}\widehat f(\mathsf{R}_n(x))-\widehat f(x)|.\tag{16}\] Now observe that \(|f(x)-\mathbb{E}f(\mathsf{R}_n(x))|\leq L\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\) and similarly for \(\widehat f\), and that \(|\mathbb{E}[f(\mathsf{R}_n(x))-\widehat f(\mathsf{R}_n(x))]|\leq \mathrm{e}_n(f,\widehat f)\). The bounds for general Lipschitz functions now follow from Theorem 12.

If \(f(x)=F(\mathrm{Law}(\mathsf{R}_k(x)))\) for \(L\)-Lipschitz \(F\), we have \(|f(x)-f(\mathsf{R}_n(x))|\leq LW_1(\mathsf{R}_k(x),\mathsf{R}_k\circ\mathsf{R}_n(x))\) where we fix a realization of \(\mathsf{R}_n\), and \(|f(x)-\mathbb{E}f(\mathsf{R}_n(x))|\leq L\mathbb{E}W_1(\mathsf{R}_k(x),\mathsf{R}_k\circ\mathsf{R}_n(x))\). Since \(\widehat f\) satisfies the same bounds, we obtain the claimed rates from Theorem 12 using 16 again.

Finally, suppose \(f(x)=\sigma(\mathbb{E}g_k(\mathsf{R}_k(x)))\) and note that \[|f(x)-f(\mathsf{R}_n(x))|\leq L_{\sigma}\|\mathbb{E}_{\mathsf{R}_k}g_k(\mathsf{R}_k(x))-\mathbb{E}_{\mathsf{R}_k}g_k(\mathsf{R}_k\circ\mathsf{R}_n(x))\|_1=\sum_{j=1}^{\ell}\Big|\mathbb{E}[g_k]_{j}(\mathsf{R}_k(x))-\mathbb{E}_{\mathsf{R}_k}[g_k]_{j}(\mathsf{R}_k\circ\mathsf{R}_n(x))\Big|,\] where we fix a realization of \(\mathsf{R}_n\) and denote by \([g_k]_{j}\) the \(j\)th coordinate function of \(g_k\). Similarly, we have \(|f(x)-\mathbb{E}f(\mathsf{R}_n(x))|\leq L_{\sigma}\mathbb{E}_{\mathsf{R}_n}\sum_{j=1}^{\ell}|\mathbb{E}_{\mathsf{R}_k}[g_k]_{j}(\mathsf{R}_k(x))-\mathbb{E}_{\mathsf{R}_k}[g_k]_{j}(\mathsf{R}_k\circ\mathsf{R}_n(x))|\). Since \(\widehat f\) satisfies the same bounds, we obtain the claimed rates from Proposition 15 using 16 again. If \(\sigma=\mathrm{id}\), we can improve the generalization bound because \(|f(x)-\mathbb{E}f(\mathsf{R}_n(x))|\leq \|\mathbb{E}g_k(\mathsf{R}_k(x))-\mathbb{E}g_k(\mathsf{R}_k\circ\mathsf{R}_n(x))\|_1\) where both expectations are inside the norm, and hence we only incur an error due to the bias in Proposition 15.

All the above bounds hold for average error with respect to projection-consistent distributions \((\mu_n)\). This can be seen by writing \(\mu_n=\mathrm{Law}(\mathsf{R}_n(X))\) for a random \(X\in\overline{\Omega}_{\infty}\) using Theorem 13 and applying the above bounds conditionally on \(X\). ◻

Finally, we prove Corollary 5 using the measure-theoretic expression for attention in [17].

Proof (Corollary 5).. Let \(\mathcal{P}_c(\mathbb{R}^d)\) be the space of compactly-supported probability measures on \(\mathbb{R}^d\), and consider the in-context attention mapping \(\bar A\colon\mathbb{R}^d\times\mathcal{P}_c(\mathbb{R}^d)\to\mathbb{R}^d\) introduced in [17], given by \[\bar A(x,\mu) = x + \frac{\mathbb{E}_{Y\sim\mu}\exp(\langle Qx, KY\rangle)VY}{\mathbb{E}_{Y\sim\mu}\exp(\langle Qx,KY\rangle)},\] which satisfies \[\mathsf{R}_1\circ A(x) \overset{d}{=} \bar A(\mathsf{R}_1(x),\mathrm{Law}(\mathsf{R}_1(x))).\] Defining \(\mathcal{A}\colon\mathcal{P}_c(\mathbb{R}^d)\to\mathcal{P}_c(\mathbb{R}^d)\) by \(\mathcal{A}(\mu)=\mathrm{Law}(\bar A(X,\mu))\) where \(X\sim\mu\), letting \(\phi\) act on measures via pushforward, and defining \[\bar T(\mu) = \mathbb{E}_{X\sim (\phi\circ \mathcal{A})^{\circ \ell}(\mu)}X,\] we get \(T(x)=\bar T(\mathrm{Law}(\mathsf{R}_1(x)))\) as desired. Indeed, for \(\ell=1\) we have \(\bar T(\mathrm{Law}(R_1(x)))=\mathbb{E}\phi(\mathsf{R}_1\circ A(x)) = \frac{1}{n}\sum_{i=1}^n\phi(A(x)_i)=T(x)\), and inducting on \(\ell\) shows the claimed identity in general.

Let \(t=\sup_{j\leq \ell}\sup_{x\in\Theta}\|(\phi\circ A)^{\circ j}(x)\|_{\infty}<\infty\) and denote \(B_t=\{x\in\mathbb{R}^d:\|x\|_{\infty}\leq t\}\). We can find Lipschitz constants \(L_1,L_2>0\) such that \(\bar A(x,\cdot)\colon\mathcal{P}(B_t)\to \mathbb{R}^d\) is \(L_1\)-Lipschitz while \(\bar A(\cdot,\mu)\colon B_t\to\mathbb{R}^d\) is \(L_2\)-Lipschitz for any \(x\in B_t\) and \(\mu\in\mathcal{P}(B_t)\), see [51] for example. For any \(x,y\in B_t^n\), we then have \[\begin{align} W_1(\mathsf{R}_1\circ A(x),\mathsf{R}_1\circ A(y))&\leq (L_1+L_2)W_1(\mathsf{R}_1(x),\mathsf{R}_1(y)). \end{align}\] Likewise, we have \(W_1(\mathsf{R}_1\circ\phi(x),\mathsf{R}_1\circ\phi(y))\leq L_{\phi}W_1(\mathsf{R}_1(x),\mathsf{R}_1(y))\) because \(\phi\) acts column-wise. Thus, we get \[W_1(\mathsf{R}_1\circ(\phi\circ A)^{\circ \ell}(x),\mathsf{R}_1\circ(\phi\circ A)^{\circ \ell}(y))\leq L_{\phi}^{\ell}(L_1+L_2)^{\ell}W_1(\mathsf{R}_1(x),\mathsf{R}_1(y)),\] so \(\bar T\) is \(L_{\phi}^{\ell}(L_1+L_2)^{\ell}\)-Lipschitz. The result now follows from Theorem 14. ◻

4 Rates for Random Binning and Species Sampling↩︎

In this section, we prove rates for sketching and generalization using the sampling metric defined with respect to random binning from Section 2.3.1, and relate the topologies defined by random binning and species sampling via their corresponding sampling metrics.

4.1 Main Results↩︎

We fix a compatible sequence of index sets \((\mathcal{I}_n)\), and consider the associated vector spaces \((\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n})\) and random binning maps \((\mathsf{B}_k\colon\bigsqcup_n\mathbb{V}_n\to\mathbb{V}_k)\) defined by 5 . We also fix a sequence of compact sets \((\Omega_n)\) closed under random binning, such as the sequence of \(\ell_1\) balls \(\mathcal{B}_{\ell_1}^{(n)}(r)=\{x\in\mathbb{V}_n:\|x\|_1\leq r\}\). Proceeding as in Section 3, it may be tempting to try to prove a result akin to Theorem 12 in which we might show that \(d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\to0\) with high probability, and quantify the rate at which it converges to zero. Unfortunately, while we will show below that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\to0\), the following example illustrates that individual realizations \(d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\) do not concentrate as well around their means as in the case of sampling with replacement.

Example 19 (Anti-concentration for random binning). Suppose \(\mathbb{V}_n=\mathbb{R}^n\) and consider \(x=(1/2,1/2)\in\mathbb{V}_2\). Observe that \(\mathsf{B}_n(x)\) equals one of the standard basis vectors with probability \(1/n\), since this is the probability that the two entries of \(x\) to map to the same bin. Therefore, with probability \(1/n\), we have that \(d_{\mathrm{samp}}(x,\mathsf{B}_n(x)) = d_{\mathrm{samp}}(x,e_1) = \sum_{k\geq 2}2^{-k}(1-\frac{1}{k})\frac{1}{2}=\frac{1-\log 2}{2}\). Borel–Cantelli implies that for any rate \((\epsilon_n\geq0)\) with \(\epsilon_n\downarrow 0\) we have \(\sum_{n\geq 1}\mathbb{P}[d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\geq \epsilon_n]=\infty\).

In contrast, for sampling with replacement Theorem 12 gives a rate \(\epsilon_n\) such that \(\mathbb{P}[d_{\mathrm{samp}}(x,\mathsf{R}_n(x))\geq \epsilon_n]\leq e^{-Cn}\) for a constant \(C>0\).

To remedy this situation, we show in Theorem 16 that \(d_{\mathrm{samp}}(x,\mathsf{E}_n(x))\) exhibits the requisite concentration, where \(\mathsf{E}_n\) is the species sampling map from Section 2.3.2. In other words, species sampling furnishes the requisite sketching map for the sampling metric defined via random binning. Subsequently, we follow a similar agenda as in Section 3. We characterize the any-dimensional data distributions that are obtained via random binning in Theorem 17. We then give explicit any-dimensional sketching and generalization rates in Theorem 18, followed by corollaries that provide concrete illustrations of our results in the context of applications in graph signal processing and neural networks. We conclude with Proposition 19 in which we relate convergence with respect to random binning and species sampling.

We begin by quantifying the convergence \(d_{\mathrm{samp}}(x,\mathsf{E}_n(x))\to 0\) in expectation and with high probability.

Theorem 16. Suppose \((\mathcal{I}_n)\) is a compatible sequence of index sets of degree \(D\), and consider the sampling metric defined using random binning \((\mathsf{B}_k)\) and the \(W_1\)-metric with respect to the \(\ell_2\) norm. Fix \((\Omega_n\subseteq \mathbb{R}^{\mathcal{I}_n})\) closed under both binning and species sampling such that \(\sup_{n\in\mathbb{N}}\sup_{x\in\Omega_n}\|x\|_1\leq r\).

  1. For any \(x\in\bigsqcup_n\Omega_n\), we have \[\mathbb{E}_{\mathsf{E}_n}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathsf{E}_n(x))\leq r\sqrt{\frac{2}{n}}\] and similarly \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{E}_n(x))\leq r\sqrt{2/n}\). Moreover, both \(W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathsf{E}_n(x))\) and \(d_{\mathrm{samp}}(x,\mathsf{E}_n(x))\) are \(\frac{4r^2}{n}\)-subgaussian with respect to the randomness in \(\mathsf{E}_n\).

  2. For any \(x\in\bigsqcup_n\Omega_n\) and any \(k\in\mathbb{N}\), we have \[\label{eq:expected95binning95rate} \mathbb{E}_{\mathsf{B}_n}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathsf{B}_n(x))\leq r\sqrt{\frac{2D(3D-1)}{n}},\qquad{(11)}\] and similarly \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\leq r\sqrt{\frac{2D(3D-1)}{n}}\).

We emphasize again that although Theorem 16(2) shows that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\to0\), these distances do not concentrate well around their means as shown in Example 19.

The proof of Theorem 16(1) is based on the following standard bound for the empirical sampling map 12 , \[\label{eq:Binom95bound} \mathbb{E}\|x-\mathscr{E}_n(x)\|_2 \leq \|x\|_1\sqrt{\sum_{\alpha\in\mathcal{I}_N}\mathbb{E}\Big(p_{\alpha} -\tfrac{1}{n}\mathrm{Binom}(n,p_{\alpha})\Big)^2} \leq \frac{\|x\|_1}{\sqrt{n}},\quad \textrm{for any } x\in\mathbb{R}^{\mathcal{I}_N},\;N\in\mathbb{N},\tag{17}\] where \(p_{\alpha}=|x_{\alpha}|/\|x\|_1\) are the probabilities proportional to the magnitudes of entries of \(x\), together with the fact that \(d_{\mathrm{samp}}(\mathscr{E}_n(x),\mathsf{E}_n(x))=0\) almost surely. The proof of Theorem 16(2) uses an explicit coupling between \(\mathsf{B}_k(x)\) and \(\mathsf{B}_k\circ\mathsf{B}_n(x)\). We give the full details in Section 4.2. Examples of sets satisfying the hypotheses of Theorem 16 include the sequence of simplices \(\Omega_n=\Delta^{\mathcal{I}_n}\) and \(\ell_1\)-balls.

We proceed to describe some of the implications of Theorem 16. First, the fact that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\to0\) at a universal rate as \(n\to\infty\) allows us to apply Proposition 6 and leads to a characterization of sequences of any-dimensional distributions that are compatible with random binning.

Theorem 17 (Equipartition-consistent distributions). Suppose \((\mathcal{I}_n)\) has finite degree, let \(\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n}\), and suppose \((\Omega_n)\) is a sequence of compact sets closed under binning with \(\sup_n\sup_{x\in\Omega_n}\|x\|_1<\infty\). Then the following are equivalent for a sequence of probability distributions \((\mu_n\in\mathcal{P}(\Omega_n))\):

  1. We have \(\beta(\psi_{n,N})\mu_N=\mu_n\) whenever \(\psi_{n,N}\colon[N]\to[n]\) is an equipartition.

  2. There exists a distribution \(\mu_{\infty}\in\mathcal{P}(\overline{\Omega}_{\infty})\) such that \(\mu_n=\mathrm{Law}(\mathsf{B}_n(X))\) for all \(n\), where \(X\sim\mu_{\infty}\) is independent of \(\mathsf{B}_n\).

Moreover, the measure \(\mu_{\infty}\) above is unique, and sequences of the form \((\mu_n=\mathrm{Law}(\mathsf{B}_n(x)))\) for deterministic \(x\in\overline{\Omega}_{\infty}\) are extremal in the set of all such sequences.

Similarly to Theorem 13, the proof combines Proposition 6 with a “dual” finite de Finetti theorem comparing uniformly random binning and random binning into equally-sized bins from [15], see Section 4.2. We give some examples of the any-dimensional data distributions obtained by randomly binning limit objects. Using Theorem 16, we then give generalization rates for average error with respect to these distributions.

Example 20. If \(\mathcal{I}_n=[n]\) and \(\Omega_n=\Delta^n\), then a sequence \((\mu_n\in\mathcal{P}(\Delta^n))\) is equipartition-consistent if and only if (i) each \(\mu_n\) is exchangeable; (ii) whenever \(n|N\) we have \[\left(\sum_{j=1}^{N/n}(X_N)_{j + (i-1)(N/n)}\right)_{i=1}^n \overset{d}{=} X_n.\] For example, the sequence of Dirichlet distributions \(\mu_n=\mathrm{Dir}(\alpha\mathbb{1}_n/n)\) satisfies these conditions for any \(\alpha\in[0,\infty)\), where \(\alpha=0\) corresponds to a uniformly random coordinate vector.

If \(\mathcal{I}_n=[n]^2\), then equipartition-consistent sequences \((\mu_n\in\mathcal{P}(\Delta^{n\times n}))\) were called “equipartition-consistent random graph models” in [13], where they were shown to correspond to certain limits of growing-sized graphs. In particular, the specialization of Theorem 17 to this case was proved in [13].

The next consequences of Theorem 16 are the following sketching and generalization rates, proved in Section 4.2. In contrast to the analogous Theorem 14 for sampling with replacement, here we get a rate of \(n^{-1/2}\) regardless of the latent low-dimensional structure of our functions.

Theorem 18 (Sketching and generalization rates). In the setting of Theorem 16, suppose \(f\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) satisfies one of the following conditions.

  1. \(f\) is \(L\)-Lipschitz in \(d_{\mathrm{samp}}\);

  2. \(f\) is \(L\)-Lipschitz in \((x,y)\mapsto W_1(\mathsf{B}_k(x),\mathsf{B}_k(y))\) for some \(k\in\mathbb{N}\);

  3. \(f\) is unchanged by zero-padding so \(f\circ\beta(\phi_{N,n})=f\) for any injection \(\phi_{N,n}\colon[n]\to[N]\), and \(f|_{\mathbb{V}_n}\) is \(L\)-Lipschitz in \(\ell_2\) norm for all \(n\).

Then for any \(x\in\bigsqcup_n\Omega_n\) with probability at least \(1-e^{-2\epsilon^2}\) we have \[\label{eq:FS95sketching} |f(x)-f(\mathsf{E}_n(x))|\leq \frac{Lr(\sqrt{2} + 2\epsilon)}{\sqrt{n}}.\qquad{(12)}\] If \(\widehat f\) is another such function and \(n \geq D\), then \[\label{eq:FS95generalization} \mathrm{e}_{\infty}(f,\widehat f)\leq \mathrm{e}_{n}(f,\widehat f) + 2Lr\sqrt{\frac{2}{\lfloor n/D\rfloor}}.\qquad{(13)}\] If \((\mu_n)\) is equipartition-consistent and \(\mu_{\infty}\) is their representing measure from Theorem 17, we also have \[\mathrm{e}_{\mu_{\infty}}(f,\widehat f)\leq \mathrm{e}_{\mu_n}(f,\widehat f) + 2Lr\sqrt{\frac{2D(3D-1)}{n}}.\]

The proof is a direct application of the above two theorems, and we defer it to Section 4.2. The three conditions on the function \(f\) in Theorem 18 are different sufficient conditions for continuity of \(f\) with respect to random binning. Some of these conditions are more conveniently applicable to different function classes, as we proceed to illustrate.

As in Section 3, a prominent example of functions satisfying the above hypotheses are polynomials.

Corollary 6. In the setting of Theorem 16, let \(p\colon\bigsqcup_n\Omega_n\to\mathbb{R}\) be a polynomial unchanged by zero-padding, so \(p\circ\beta(\phi_{N,n})=p\) for all injections \(\phi_{N,n}\colon[n]\to[N]\) and all \(n\leq N\). Then \(p\) satisfies the second condition in Theorem 18.

Proof. It was shown in [15] that there exists \(g_k\in\mathbb{R}[\mathbb{V}_k]\) satisfying \(p(x)=\mathbb{E}g_k(\mathsf{B}_k(x))\) for all \(x\). If \(L\) is the Lipschitz constant of \(g_k\) over \(\Omega_k\), then \(p\) is \(L\)-Lipschitz in \((x,y)\mapsto W_1(\mathsf{B}_k(x),\mathsf{B}_k(y))\), as claimed. ◻

Note that we obtain sketching and generalization rates that do not directly depend on the degree of \(p\) or of \((\mathcal{I}_n)\). The following are a few examples of the polynomials to which Corollary 6 applies, which constitute “unnormalized” analogs of the polynomials unchanged by duplication considered in Corollary 3.

  1. When \(\mathbb{V}_n=\mathbb{R}^{d\times n}\), polynomials unchanged by zero-padding are precisely multisymmetric functions [52], consisting of polynomials of the form \[p(x)=q\Big(p_{\alpha_1}(x),\ldots,p_{\alpha_k}(x)\Big),\] where \(q\in\mathbb{R}[y_1,\ldots,y_k]\) is a fixed polynomial, and for \(\alpha\in\mathbb{N}_0^d\) we have \(p_{\alpha}(x)=\sum_{i=1}^n\prod_{j=1}^dx_{j,i}^{\alpha_j}\). When \(d=1\) and \(\alpha\in\mathbb{N}_0\), the polynomials \(p_{\alpha}(x)=\sum_{i=1}^nx_i^{\alpha}\) are known as power-sum polynomials, and polynomials unchanged by zero-padding are called symmetric functions. These are classic objects of study in combinatorics and representation theory, see [53] and [54].

  2. When \(\mathbb{V}_n=\mathbb{R}^{n\times n}\), polynomials unchanged by zero-padding are precisely linear combinations of graph homomorphism numbers [15]. Specifically, if \(H\in \mathbb{N}_0^{k\times k}\) is a multigraph, we define the homomorphism number of \(H\) in \(G\in\mathbb{V}_n\) by \[\mathrm{hom}(H;G)=\sum_{f\colon[k]\to[n]}\prod_{i,j=1}^kG_{f(i),f(j)}^{H_{i,j}}.\] When \(H,G\) are simple graphs, the value \(\mathrm{hom}(H;G)\) is the number of graph homomorphisms from \(H\) to \(G\). Similarly, when \(\mathbb{V}_n=(\mathbb{R}^n)^{\otimes d}\) polynomials unchanged by zero-padding are linear combinations of hypergraph homomorphism numbers, analogously defined.

  3. When \(\mathbb{V}_n=\mathbb{R}^{n\times n}\oplus\mathbb{R}^n\), polynomials unchanged by zero-padding include polynomial (unnormalized) graph neural networks, which are compositions of polynomials of the form \[(G,X)\mapsto \sigma\left(\sum_{\ell=0}^LG^{\ell}X\Theta_{\ell}\right),\quad \textrm{for polynomial } \sigma \textrm{ and } \Theta_0,\ldots,\Theta_L\in\mathbb{R}^{d\times d}.\]

For all of the above families of polynomials, we obtain sketching and generalization rates of \(O(n^{-1/2})\). We now turn to proving sketching and generalization rates for some non-polynomial function classes.

Corollary 7 (DeepSets). Let \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) and consider maps of the form \(f(x_1,\ldots,x_n)=\sigma(\sum_i\rho(x_i))\) for \(\rho\colon\mathbb{R}^d\to\mathbb{R}^{\ell}\) with \(\rho(0)=0\) and \(\sigma\colon\mathbb{R}^{\ell}\to\mathbb{R}\). Then \(f\) is unchanged by zero-padding.

  1. Suppose \(\sigma\) is \(L_{\sigma}\)-Lipschitz, and that \(\rho\) is \(L_{\rho}\sqrt{r}\)-Lipschitz with respect to the \(\ell_2\) norm on \(\{x\in\mathbb{R}^d:\|x\|_1\leq r\}\) for each \(r\). Then \(f\) satisfies the third condition in Theorem 18 with \(L=L_{\rho}L_{\sigma}\sqrt{2r}\).

  2. The 1-norm \(f(x)=\sum_i|x_i|\) is discontinuous in sampling metric.

The proof is a direct computation, see Section 4.2. Although the 1-norm is of the form \(f(x_1,\ldots,x_n)=\sigma(\sum_i\rho(x_i))\) for \(d=1\), \(\sigma = \mathrm{id}_{\mathbb{R}}\) and \(\rho = |\cdot|\), both of which are 1-Lipschitz, the stronger condition on \(\rho\) in part 1, requiring its Lipschitz constant to decay to zero around the origin, fails to hold for the absolute value function. Therefore, mere Lipschitz continuity of \(\rho\) (as well as \(\sigma\)) is not by itself sufficient to obtain continuity with respect to random binning. The hypothesis on \(\rho\) in part 1 is satisfied if, for example, \(\rho\) is differentiable with a \(1/2\)-Hölder continuous derivative satisfying \(\rho'(0)=0\).

When \(\sigma\) and \(\rho\) in Corollary 7 are neural networks, the resulting architecture is called DeepSets [18]. When \(d=1\) and \(\Omega_n=\Delta^n\), different choices of \(\sigma\) and \(\rho\) yield various diversity indices used to quantify the concentration of a discrete probability distribution [42]. For example, setting \(\rho(x)=x^q\) and \(\sigma(t)=\frac{1-t}{q-1}\) gives Tsallis’ entropy, which for \(q\geq 3/2\) satisfies the hypotheses of Corollary 7(1). We note however that some diversity indices are not continuous in sampling metric. This is the case for Shannon and Rényi entropies (given by \(\sigma=\mathrm{id}\), \(\rho(t)=t\log \frac{1}{t}\) for the former and \(\sigma(t)=\frac{1}{1-q}\log(t)\), \(\rho(t)=t^q\) for the latter) for example, both of which diverge along the (convergent) sequence \(x^{(n)}=\mathbb{1}_n/n\).

Corollary 8 (PointNet). Let \(\mathbb{V}_n=\mathbb{R}^{d\times n}\) and consider maps of the form \(f(x_1,\ldots,x_n)=\sigma(\sup_i\rho(x_i))\) for \(\rho\colon\mathbb{R}^d\to\mathbb{R}^{\ell}\) and \(\sigma\colon\mathbb{R}^{\ell}\to\mathbb{R}\), where the supremum is taken coordinate-wise. If \(\rho(x)\geq0\) for all \(x\), \(\rho(0)=0\), and if \(\sigma\) and \(\rho\) are \(L_{\sigma}\) and \(L_{\rho}\)-Lipschitz continuous in \(\ell_2\)-norm, then the function \(f\) satisfies the third condition in Theorem 18 with \(L=L_{\rho}L_{\sigma}\).

Proof. Direct computation. ◻

Finally, we consider non-polynomial graph neural networks.

Corollary 9 (Graph Neural Networks). Let \(\mathbb{V}_n=\mathbb{R}^{n\times n}\oplus\mathbb{R}^{n\times d}\) and consider a composition of maps of the form \[F(A,X)=\left(A, \sigma\left(\sum_{d=0}^DA^dX\Theta_d\right)\right),\quad \textrm{where } \Theta_0,\ldots,\Theta_D\in\mathbb{R}^{d\times d},\] and \(\sigma\colon\mathbb{R}^d\to\mathbb{R}^d\) satisfies \(\sigma(0)=0\), is \(L_{\sigma}\)-Lipschitz in \(\ell_2\), and is applied row-wise. Also define \(P\colon\mathbb{V}_n\to\mathbb{R}^d\) by \(P(A,X)=\rho(X)^\top\mathbb{1}_n\) for \(\rho\colon\mathbb{R}^d\to\mathbb{R}^d\) that is applied row-wise and satisfies the hypotheses of Corollary 7(1). Consider the depth-\(\ell\) graph neural network given by the composition \[f = P\circ F^{\circ \ell}\colon\bigsqcup_n\mathcal{B}_{\ell_1}^{(n)}(r)\to\mathbb{R}^d,\] where \(\mathcal{B}_{\ell_1}^{(n)}(r)=\{(A,X)\in\mathbb{V}_n:\|A\|_1+\|X\|_1\leq r\}\). Then each coordinate function of \(f\) satisfies the third condition in Theorem 18.

The proof is an elementary but long computation, and we defer it to Section 4.2. For all of the function classes in the above corollaries, Theorem 18 yields \(n^{-1/2}\) sketching and generalization rates.

So far in this section, we have worked with the sampling metric defined by random binning, and showed that species sampling is an appropriate sketching map with respect to this metric. We end this section by further considering the sampling metric defined by species sampling, and show that its induced topology is closely related to the one induced by random binning.

Proposition 19. Let \((\mathcal{I}_n)\) be a compatible sequence of finite degree, and let \((x_i)\subseteq\bigsqcup_n\mathbb{R}^{\mathcal{I}_n}\). Then \((\mathsf{E}_k(x_i))\) converges for all \(k\) if and only if the sequence of random tuples \(((\mathsf{B}_k(x_i^+),\mathsf{B}_k(x_i^-)))_i\) converges for all \(k\), where \(x_i^+=\max\{x_i,0\}\) and \(x_i^-=\max\{-x_i,0\}\) are the entrywise positive and negative parts of \(x_i\), and we apply the same random map \(\mathsf{B}_k\) to both \(x_i^+\) and \(x_i^-\).

In words, convergence of the species samples is equivalent to joint convergence of random binning of the positive and negative parts. In particular, the two notions of convergence are equivalent for nonnegative vectors. The special case of this equivalence for \(\mathcal{I}_n=[n]^2\) and \(\Omega_n=\Delta^{n\times n}\) was shown in [13].

We remark that species sampling gives another sequence of any-dimensional data distributions, and our results yield generalization rates with respect to these distributions. For example, if \((\Omega_n=\Delta^{\mathcal{I}_n})\) then we get the same completion \(\overline{\Omega}_{\infty}\) with respect to both \((\mathsf{B}_k)\) and \((\mathsf{E}_k)\) by Proposition 19. Combining Theorem 16 and Proposition 6 shows that each probability distribution \(\mu\in\mathcal{P}(\overline{\Omega}_{\infty})\) on limit objects yields two sequences of distributions on finite objects converging weakly to \(\mu\), namely \((\mathrm{Law}(\mathsf{B}_k(x)))\) and \((\mathrm{Law}(\mathsf{E}_k(X)))\) for \(X\sim\mu\) independent of \(\mathsf{B}_k\) and \(\mathsf{E}_k\). Both sequences of measures can be used as any-dimensional distributions for which \(n^{-1/2}\) generalization rates are available. It would be interesting to characterize sequences of the form \((\mathrm{Law}(\mathsf{E}_k(X)))\) analogously to Theorem 17. For example, when \(\mathcal{I}_n=[n]^2\) such sequences of distributions are precisely edge-exchangeable multigraph models normalized to have unit edge weights, as shown in [13]. We leave such a characterization more generally for future work.

4.2 Missing Proofs from Section 4↩︎

We begin by proving Theorem 16. We shall need the following several lemmas to do so. The first lemma shows that the species sampling \(\mathsf{E}_n\) and empirical sampling \(\mathscr{E}_n\) maps in 13 and 12 , respectively, are equivalent in the sampling metric defined by random binning.

Lemma 2 (Equivalence of species and empirical sampling). Suppose \((\mathcal{I}_n)\) has finite degree and let \(\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n}\). Then \(d_{\mathrm{samp}}(\mathscr{E}_n(x),\mathsf{E}_n(x))=0\) for any \(x\in\mathbb{V}_N\) and any \(n,N\in\mathbb{N}\).

Proof. After zero-padding \(x\) if necessary, which does not change the distributions of \(\mathscr{E}_n(x)\) and \(\mathsf{E}_n(x)\) by Proposition 11, we may assume \(N\geq nD\). We construct a random injection \(\Phi_{N,nD}\colon[nD]\to[N]\) satisfying \[\label{eq:random95inj95empirical95species} \mathscr{E}_n(x)=\beta(\Phi_{N,nD})\mathsf{E}_n(x),\tag{18}\] which proves that \(d_{\mathrm{samp}}(\mathscr{E}_n(x),\mathsf{E}_n(x))=0\) by 8 . To construct this injection, recall the randomly-enumerated indices \(\{t_1,\ldots,t_k\}\) from the construction of \(\mathscr{E}_n\) and \(\mathsf{E}_n\) in Section 2.3.2, where \(k\leq nD\). Set \(\Phi_{N,nD}(i)=t_i\) for \(i\leq k\) and set \(\Phi_{N,nD}|_{[nD]\setminus[k]}\) to be a uniformly random injection into \([N]\setminus\{t_1,\ldots,t_k\}\). Note that 18 is satisfied by construction of \(\mathsf{E}_n(x)\) in 13 . ◻

As we shall see, empirical sampling satisfies several useful properties that we exploit to prove Theorem 16. The second lemma shows a compatibility between the empirical sampling \(\mathscr{E}_n\) from 12 and the action 4 of maps between finite sets.

Lemma 3. Let \((\mathcal{I}_n)\) be a compatible sequence and \(x\in\Delta^{\mathcal{I}_n}\). Then for any map \(f\colon[n]\to[m]\), we have \(\mathscr{E}_k(\beta(f)x)\overset{d}{=}\beta(f)\mathscr{E}_k(x)\).

Proof. Observe that the probability of sampling \(\alpha\in\mathcal{I}_m\) from \(\beta(f)x\) is \(\sum_{\substack{\gamma\in\mathcal{I}_n\\ \rho(f)(\gamma)=\alpha}}x_{\gamma}\). This is also the probability that if \(\gamma\in\mathcal{I}_n\) is drawn from \(x\) then \(\rho(f)(\gamma)=\alpha\). Thus, \[\beta(f)\mathscr{E}_k(x)=\frac{1}{k}\sum_{i=1}^ke_{\rho(f)(\gamma_i)} \overset{d}{=}\frac{1}{k}\sum_{i=1}^ke_{\alpha_i} = \mathscr{E}_k(\beta(f)x),\] where \(\gamma_1,\ldots,\gamma_k\in\mathcal{I}_n\) are sampled iid from \(x\) while \(\alpha_1,\ldots,\alpha_k\) are sampled iid from \(\beta(f)x\). ◻

Combining Lemma 3 with the bound 17 for the empirical sampling map, we are ready to prove the first bound from Theorem 16(1).

Lemma 4. Suppose \((\mathcal{I}_n)\) has finite degree. For any \(x\in\mathbb{R}^{\mathcal{I}_N}\) and any \(N\in\mathbb{N}\), we have \[\mathbb{E}_{\mathsf{E}_n}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathsf{E}_n(x))\leq \|x\|_1\sqrt{\frac{2}{n}}.\]

Proof. By homogeneity of \(\mathsf{E}_n\) and linearity of \(\mathsf{B}_k\), it suffices to prove the claim when \(\|x\|_1=1\), which we assume for the remainder of the proof. Suppose first that \(x\geq 0\), so that \(x\in\Delta^{\mathcal{I}_N}\). Then \[\begin{align} \mathbb{E}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathsf{E}_n(x))&=\mathbb{E}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathscr{E}_n(x))\leq \mathbb{E}_{\mathscr{E}_n}\mathbb{E}_{\mathsf{B}_k}\|\mathsf{B}_k(x)-\mathsf{B}_k\circ\mathscr{E}_n(x)\|_2\\ &= \mathbb{E}_{\mathsf{B}_k}\mathbb{E}_{\mathscr{E}_n}\|\mathsf{B}_k(x)-\mathscr{E}_n(\mathsf{B}_k(x))\|_2\leq \frac{1}{\sqrt{n}}, \end{align}\] where the first equality follows from Lemma 2, the second equality follows from Lemma 3, and the last inequality follows from the fact that \(\mathbb{E}\|p-\mathscr{E}_n(p)\|_2\leq 1/\sqrt{n}\) for any discrete distribution \(p\) by 17 .

If \(x\leq 0\) then the fact that \(\mathscr{E}_n(-x)=-\mathscr{E}_n(x)\) and the linearity of \(\mathsf{B}_k\) again yields the claimed bound. Therefore, suppose \(\max\{0,x\}\neq0\) and \(\max\{0,-x\}\neq 0\) and write \(x=\alpha x_+-\beta x_-\) with \(x_{\pm}\in\Delta^{\mathcal{I}_N}\) and \(\alpha,\beta\geq0\) with \(\alpha+\beta=\|x\|_1=1\) (explicitly, \(\alpha x_+=\max\{0,x\}\) and \(\alpha=\|\max\{0,x\}\|_1\), and similarly for \(\beta x_-\)). By construction of \(\mathscr{E}_n\), if \((N_+,N_-)\sim\mathrm{Multinom}(2, n, (\alpha,\beta))\) then we have \[\label{eq:empirical95sampling95negative} \mathscr{E}_n(x)\overset{d}{=}\left[\frac{N_+}{n}\mathscr{E}_{N_+}(x_+)-\frac{N_-}{n}\mathscr{E}_{N_-}(x_-)\right],\tag{19}\] where \(\mathscr{E}_{N_+}(x_+)\) and \(\mathscr{E}_{N_-}(x_-)\) are independent. Conditioning on \((N_+,N_-)\) and applying the above argument to \(x_+\) and \(x_-\) separately, we get \[\begin{align} \mathbb{E}_{\mathscr{E}_n}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathscr{E}_n(x))&\leq \mathbb{E}_{(N_+,N_-)}\left[\frac{N_+}{n}\frac{1}{\sqrt{N_+}} + \frac{N_-}{n}\frac{1}{\sqrt{N_-}}\right] \leq \frac{1}{\sqrt{n}}\left(\sqrt{\alpha}+\sqrt{\beta}\right) \leq \sqrt{\frac{2}{n}}, \end{align}\] as claimed. ◻

Next, we prove the bound ?? from Theorem 16(2) using an explicit coupling between \(\mathsf{B}_k(x)\) and \(\mathsf{B}_k\circ\mathsf{B}_n(x)\). Along the way, we prove a bound between \(x\) and an appropriate zero-padding of the binned \(\mathsf{B}_n(x)\), to be used in the proof of Theorem 18.

Lemma 5. Suppose \((\mathcal{I}_n)\) has degree \(D\). For any \(x\in\mathbb{R}^{\mathcal{I}_N}\) and any \(N\in\mathbb{N}\), we have \[\mathbb{E}_{\mathsf{B}_n}W_1(\mathsf{B}_k(x), \mathsf{B}_k\circ\mathsf{B}_n(x))\leq \|x\|_1\sqrt{\frac{2D(3D-1)}{n}}.\] Also, there is a random injection \(\Phi\colon[n]\to[N]\) coupled to \(\mathsf{B}_n\) satisfying \(\mathbb{E}\|x-\beta(\Phi)\mathsf{B}_n(x)\|_2\leq \|x\|_1\sqrt{\frac{2D(3D-1)}{n}}\).

Proof. Since \((\mathcal{I}_n)\) has degree \(D\), write \(\mathcal{I}_n=\bigsqcup_{m=1}^M[n]^{d_m}/H_m\) with \(D=\max_md_m\), and write \(x=\sum_{\alpha\in\mathcal{I}_N}x_{\alpha}e_{\alpha}\) where \((e_{\alpha})\) is the standard basis for \(\mathbb{R}^{\mathcal{I}_N}\). After zero-padding \(x\), we may assume that \(N\geq n\). Let \(F_k\colon[N]\to[k]\) and \(F_n\colon[N]\to[n]\) be uniformly random maps, so that \[\mathsf{B}_n(x)=\sum_{\alpha\in\mathcal{I}_N}x_{\alpha}e_{\theta(F_n)(\alpha)},\quad \mathsf{B}_k(x)=\sum_{\alpha\in\mathcal{I}_N}x_{\alpha}e_{\theta(F_k)(\alpha)}.\] We proceed to construct a coupling of \(\mathsf{B}_k\circ\mathsf{B}_n(x)\) and of \(\mathsf{B}_k(x)\) for a fixed realization of \(F_n\). We do so by constructing a map \(G_{k,n}\colon[n]\to[k]\) depending on \(F_k\) and \(F_n\) such that the distribution of \(G_{k,n}\) given \(F_n\) is uniform on the set of all maps from \([n]\) to \([k]\), and such that \(G_{k,n}\circ F_n\) is equal to \(F_k\) on the most “important” indices, which we proceed to formalize. Once we do so, we get \(\beta(F_k)x\overset{d}{=}\mathsf{B}_k(x)\) and \(\beta(G_{k,n}\circ F_n)x\overset{d}{=}\mathsf{B}_k\circ\mathsf{B}_n(x)\) for any realization of \(F_n\), yielding the desired coupling.

If \(\alpha=H(i_1,\ldots,i_d)\) for \(H\subseteq\mathfrak{S}_d\) we write \(\mathrm{supp}(\alpha)=\{i_1,\ldots,i_d\}\subseteq[N]\) for the set of distinct indices appearing in \(\alpha\). Note that this is well-defined as \(H\) acts by permuting coordinates in a tuple, and that each \(\alpha\in \mathcal{I}_N\) has this form for some \(d\) and \(H\). We now define the weight associated to \(i\in[N]\) by \[\label{eq:importance95weights} w_i = \sum_{\substack{\alpha\in\mathcal{I}_N\\ i\in\mathrm{supp}(\alpha)}}|x_{\alpha}|,\tag{20}\] so that \(\sum_{i=1}^Nw_i\leq D\|x\|_1\) as each \(\alpha\in\mathcal{I}_N\) contains at most \(D\) indices in its support. Using these weights, for each \(\ell\in[n]\) we choose a representative \(\rho(\ell)\in F_n^{-1}(\ell)\) with the largest weight, breaking ties by choosing the smallest such index. Formally, we set \[\rho(\ell) = \min\left\{i\in F_n^{-1}(\ell): w_i=\max_{i'\in F_n^{-1}(\ell)}w_{i'}\right\},\] if \(F_n^{-1}(\ell)\neq\emptyset\) and set \(\rho|_{[n]\setminus F_n([N])}\) to be an arbitrary injective map \([n]\setminus F_n([N])\to [N]\setminus \rho(F_n([N]))\). We thus get a random (depending only on \(F_n\)) injective map \(\rho\colon[n]\to[N]\). We then define \(G_{k,n}\colon[n]\to[k]\) by setting \[G_{k,n}(\ell) = F_k(\rho(\ell)),\] so we map \(\ell\in[n]\) to the image under \(F_k\) of a largest-weight element in the fiber \(F_n^{-1}(\ell)\). Note that \(G_{k,n}\) is indeed a uniformly random map from \([n]\) to \([k]\) conditioned on \(F_n\), since \(\rho\) is always injective and since \(F_k\) maps distinct inputs to independent and uniform elements in \([k]\). Thus, we have \[\label{eq:coupling95squared} \mathbb{E}_{\mathsf{B}_n}W_1(\mathsf{B}_k(x),\mathsf{B}_k\circ\mathsf{B}_n(x))\leq \mathbb{E}\|\beta(F_k)x - \beta(G_{k,n}\circ F_n)x\|_2\leq \sqrt{\mathbb{E}\|\beta(F_k)x-\beta(G_{k,n}\circ F_n)x\|_2^2}.\tag{21}\]

We turn to analyzing the squared 2-norm of the difference \[\beta(F_k)x - \beta(G_{k,n}\circ F_n)x = \sum_{\alpha\in\mathcal{I}_N}x_{\alpha}\delta_{\alpha},\quad \textrm{where } \delta_{\alpha}=e_{\theta(F_k)(\alpha)} - e_{\theta(G_{k,n}\circ F_n)(\alpha)}.\] Explicitly, if \(\alpha=H(i_1,\ldots,i_d)\) then \[\delta_{\alpha} = e_{H(F_k(i_1),\ldots,F_k(i_d))} - e_{H(F_k\circ\rho\circ F_n(i_1),\ldots, F_k\circ\rho\circ F_n(i_d))}.\] Consider \(\langle \delta_{\alpha},\delta_{\beta}\rangle\) for \(\alpha,\beta\in\mathcal{I}_N\). Cauchy–Schwarz gives \(|\langle \delta_{\alpha},\delta_{\beta}\rangle|\leq 2\). We further claim that \[\mathbb{E}[\langle \delta_{\alpha},\delta_{\beta}\rangle|F_n]=0\quad \textrm{under the following two conditions on \alpha,\beta,}\] namely, \[\label{eq:event95A} \rho\circ F_n(i)=i \textrm{ for all } i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta),\tag{22}\] and \[\label{eq:event95B} F_n(i)\neq F_n(i') \textrm{ for all distinct } i,i'\in\mathrm{supp}(\alpha)\cup\mathrm{supp}(\beta).\tag{23}\] Indeed, if 22 and 23 hold and we further condition on the variables \[V=\{F_k(i): i\in\mathrm{supp}(\beta) \textrm{ or } \rho(F_n(i))=i\},\] we have \[\mathbb{E}\Big[\langle \delta_{\alpha},\delta_{\beta}\rangle \Big| F_n, V\Big] = \left\langle \mathbb{E}\big[\delta_{\alpha}|F_n,V\big],\delta_{\beta}\right\rangle,\] because \(V\) includes all random indices \(F_k(i)\) appearing in \(\delta_{\beta}\). Furthermore, if \(\alpha = H(i_1,\ldots,i_d)\) then \[(F_k(i_1),\ldots,F_k(i_d)) \overset{d}{=} (F_k\circ\rho\circ F_n(i_1),\ldots, F_k\circ\rho\circ F_n(i_d))\quad \textrm{conditioned on } V.\] That is because either \(\rho\circ F_n(i_j)=i_j\), or \(\rho\circ F_n(i_j)\neq i_j\) in which case both \(F_k(i_j)\) and \(F_k\circ\rho\circ F_n(i_j)\) are not in \(V\) (since \(i_j\notin\mathrm{supp}(\beta)\) by 22 ), so both are uniformly distributed over \([k]\) and independent for different \(i_j\) (because \(F_n(i_j)\) are all distinct by 23 ). Thus, we conclude that \(\mathbb{E}[\delta_{\alpha}|F_n,V]=0\) and hence \(\mathbb{E}[\langle \delta_{\alpha},\delta_{\beta}\rangle|F_n]=0\) if the events 22 and 23 hold.

The above argument shows that \[\label{eq:intermediate95bd}\begin{align} \mathbb{E}|\langle \delta_{\alpha},\delta_{\beta}\rangle|&\leq 2\mathbb{P}[\textrm{not~\eqref{eq:event95A} or not~\eqref{eq:event95B}}] \leq 2\Big(\mathbb{P}[\rho\circ F_n(i)\neq i \textrm{ for some } i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)]\\ &\quad+ \mathbb{P}[F_n(i) = F_n(i') \textrm{ for some } i\neq i'\in\mathrm{supp}(\alpha)\cup\mathrm{supp}(\beta)]\Big). \end{align}\tag{24}\] We proceed to bound each probability separately. First, we have \[\begin{align} &\mathbb{P}[\rho\circ F_n(i)\neq i \textrm{ for some } i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)] \leq \sum_{i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)}\mathbb{P}[\rho\circ F_n(i)\neq i]\\ &\leq \sum_{i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)}\mathbb{P}[\textrm{there is } j\in [N]\setminus\{i\} \textrm{ s.t.\;} w_j\geq w_i \textrm{ and } F_n(j)=F_n(i)]. \end{align}\] Let \(S_i=\{j\in[N]\setminus\{i\}: w_j\geq w_i\}\) and note that \(|S_i|\leq \frac{D\|x\|_1}{w_i}\). Indeed, note that \[w_i|S_i|\leq \sum_{j\in S_i}w_j \leq \sum_{j\in[N]}w_j\leq D\|x\|_1.\] Therefore, \[\mathbb{P}[\textrm{there is } j\in [N]\setminus\{i\} \textrm{ s.t.\;} w_j\geq w_i \textrm{ and } F_n(j)=F_n(i)] \leq \sum_{j\in S_i}\mathbb{P}[F_n(j)=F_n(i)] \leq \frac{|S_i|}{n} \leq \frac{D\|x\|_1}{w_in},\] since \(F_n\) is uniformly random. Thus, we have the following bound on the first probability in 24 \[\mathbb{P}[\rho\circ F_n(i)\neq i \textrm{ for some } i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)] \leq \frac{D\|x\|_1}{n}\sum_{i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)}\frac{1}{w_i}.\] For the second probability in 24 , note that \(|\mathrm{supp}(\alpha)\cup\mathrm{supp}(\beta)|\leq 2D\), so \[\mathbb{P}[F_n(i) = F_n(i') \textrm{ for some } i\neq i'\in\mathrm{supp}(\alpha)\cup\mathrm{supp}(\beta)]\leq \frac{\binom{2D}{2}}{n} = \frac{D(2D-1)}{n}.\]

Using the above bounds, we have \[\label{eq:almost95final95bd}\begin{align} &\mathbb{E}\|\beta(F_k)x-\beta(G_{k,n}\circ F_n)x\|_2^2 \leq \sum_{\alpha,\beta\in\mathcal{I}_N}|x_{\alpha}x_{\beta}|\cdot\mathbb{E}|\langle\delta_{\alpha},\delta_{\beta}\rangle|\\&\leq \frac{2D\|x\|_1}{n}\left(\sum_{\alpha,\beta\in\mathcal{I}_N}|x_{\alpha}x_{\beta}|\sum_{i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)}\frac{1}{w_i}\right) + \frac{2D(2D-1)}{n}\sum_{\alpha,\beta\in\mathcal{I}_N}|x_{\alpha}x_{\beta}|. \end{align}\tag{25}\] The second term in 25 is simply \(\frac{2D(2D-1)}{n}\|x\|_1^2\). For the first term, we interchange the sums to obtain \[\begin{align} &\sum_{\alpha,\beta\in\mathcal{I}_N}|x_{\alpha}x_{\beta}|\sum_{i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)}\frac{1}{w_i} = \sum_{i=1}^N\frac{1}{w_i}\sum_{\substack{\alpha,\beta\in\mathcal{I}_N\\ i\in\mathrm{supp}(\alpha)\cap\mathrm{supp}(\beta)}}|x_{\alpha}x_{\beta}| = \sum_{i=1}^N\frac{1}{w_i}\left(\sum_{\substack{\alpha\in\mathcal{I}_N\\ i\in\mathrm{supp}(\alpha)}}|x_{\alpha}|\right)^2\\ &= \sum_{i=1}^Nw_i\leq D\|x\|_1, \end{align}\] by definition of \(w_i\) in 20 . Putting everything together, we get \[\mathbb{E}\|\beta(F_k)x-\beta(G_{k,n}\circ F_n)x\|_2^2\leq \frac{2D^2\|x\|_1^2}{n}+\frac{2D(2D-1)\|x\|_1^2}{n} = \frac{2D(3D-1)\|x\|_1^2}{n},\] giving the first claimed bound by 21 .

For the second claimed bound, we consider a large \(k\) in the above coupling. Specifically, for \(k\geq N\) the map \(F_k\colon[N]\to[k]\) is injective with probability at least \(1-\frac{N(N-1)}{2k}\), in which case \[\|\beta(F_k)x-\beta(G_{k,n}\circ F_n)x\|_2 = \|\beta(F_k)(x-\beta(\rho\circ F_n)x)\|_2 = \|x-\beta(\rho\circ F_n)x\|_2.\] Thus, we have \[\begin{align} &\left(1-\frac{N(N-1)}{2k}\right)\mathbb{E}\|x-\beta(\rho\circ F_n)x\|_2 \leq \mathbb{E}\Big[\|\beta(F_k)x-\beta(G_{k,n}\circ F_n)x\|_2\Big| F_k \textrm{ injective}\Big]\mathbb{P}[F_k \textrm{ injective}]\\&\leq \mathbb{E}\|\beta(F_k)x-\beta(G_{k,n}\circ F_n)x\|_2 \leq \|x\|_1\sqrt{\frac{2D(3D-1)}{n}}. \end{align}\] Taking \(k\to\infty\) and recalling that \(\rho\) is injective, we obtain the second claimed bound. ◻

We are ready to prove Theorem 16.

Proof (Theorem 16).. For the first part, the expectation bounds follow from Lemma 4 and the fact that \(\sup_n\sup_{x\in\Omega_n}\|x\|_1\leq r\). The claim subgaussianity follows from the bounded-difference inequality. Indeed, by Lemma 2 we can replace \(\mathsf{E}_n(x)\) by \(\mathscr{E}_n(x)\) without changing the distributions in question, and observe that \(\mathscr{E}_n(x)\) is a function of \(n\) iid indices sampled from \(x\) by construction in Section 2.3.2, and changing any one of them affects two entries in \(\mathscr{E}_n(x)\) by at most \(r/n\).

For the second part, the bound ?? follows from Lemma 5, and the bound on \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\) then follows by the definition 1 of the sampling metric. ◻

We turn to proving Theorem 17 by combining Proposition 6 and a dual de Finetti theorem from [15].

Proof (Theorem 17).. Propositions 8 and 9 show that if \(\mu_n=\mathrm{Law}(\mathsf{B}_n(X))\) for random \(X\in\overline{\Omega}_{\infty}\) independent of \(\mathsf{B}_n\), then \((\mu_n)\) is equipartition-consistent. Conversely, if \((\mu_n)\) is equipartition-consistent then by [15] there is a sequence \((\nu_i\in\mathcal{P}(\Omega_{\infty}))\) such that \(\mathrm{Law}(\mathsf{B}_n(X_i))\xrightarrow{i\to\infty} \mu_n\) weakly for each \(n\), where \(X_i\sim\nu_i\) is independent of \(\mathsf{B}_n\). This implies that \((\nu_i)\) converges weakly with respect to \(d_{\mathrm{samp}}\) to some \(\mu_{\infty}\in\mathcal{P}(\overline{\Omega}_{\infty})\) satisfying the claimed sampling representation. The uniqueness of such \(\mu_{\infty}\) and the extremality of sequences of the form \((\mathrm{Law}(\mathsf{B}_n(x)))\) for \(x\in\overline{\Omega}_{\infty}\) both follow from Proposition 6, which applies by Theorem 16. Specifically, Theorem 16 shows that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\to0\) as \(n\to\infty\) at a universal rate for all \(x\in\Omega_{\infty}\). If \(x\in\overline{\Omega}_{\infty}\) then we can write \(x=\lim_ix_i\) for \(x_i\in\Omega_{\infty}\), so \(\mathsf{B}_n(x)\) is the weak limit of \(\mathsf{B}_n(x_i)\). The triangle inequality shows that \(\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{B}_n(x))\to0\) at the same universal rate, so the condition ?? in Proposition 6 is satisfied. ◻

Next, we use Theorem 16 to prove the sketching and generalization rates in Theorem 18. The following proof is similar to the proof of Theorem 14.

Proof (Theorem 18).. First suppose \(f\) is \(L\)-Lipschitz with respect to \(d_{\mathrm{samp}}\). Then \[\label{eq:comp1} |f(x)-f(\mathsf{E}_n(x))|\leq Ld_{\mathrm{samp}}(x,\mathsf{E}_n(x))\leq \frac{Lr(\sqrt{2}+2\epsilon)}{\sqrt{n}},\tag{26}\] with probability at least \(1-e^{-2\epsilon^2}\) by Theorem 16(1). The same theorem gives \[\label{eq:comp2} |f(x)-\mathbb{E}f(\mathsf{E}_n(x))|\leq L\mathbb{E}d_{\mathrm{samp}}(x,\mathsf{E}_n(x))\leq Lr\sqrt{\frac{2}{n}}.\tag{27}\] Second, if \(f\) is \(L\)-Lipschitz with respect to \((x,y)\mapsto W_1(\mathsf{B}_k(x),\mathsf{B}_k(y))\), then Theorem 16(1) gives the bounds 26 and 27 using the same arguments.

Now suppose \(f\) is unchanged by zero-padding and that each restriction \(f|_{\mathbb{V}_n}\) is \(L\)-Lipschitz in 2-norm. Then by Lemma 2 we have \[|f(x)-f(\mathsf{E}_n(x))| = |f(x)-f(\mathscr{E}_n(x))|\leq L\|x-\mathscr{E}_n(x)\|_2\leq \frac{Lr(1+2\epsilon)}{\sqrt{n}},\] with probability at least \(1-e^{-2\epsilon^2}\), where the last inequality follows from 17 and the fact that \(\|x-\mathscr{E}_n(x)\|_2\) and the latter is \(\frac{4r^2}{n}\)-subgaussian. Likewise, it follows from 17 that \(|f(x)-\mathbb{E}f(\mathsf{E}_n(x))|\leq \frac{Lr}{\sqrt{n}}\).

We have thus proved the claimed sketching rates under all the three conditions in Theorem 18. To obtain the generalization rates, let \(f,\widehat f\) satisfy either of the three conditions in the theorem (possibly different ones) and fix any \(x\in\bigsqcup_n\Omega_n\). If \(m=\lfloor n/D\rfloor\), then \(\mathsf{E}_m(x)\in\Omega_{mD}\subseteq\Omega_{\leq n}\), and hence \[|f(x)-\widehat f(x)|\leq |f(x)-\mathbb{E}f(\mathsf{E}_m(x))| + |\mathbb{E}f(\mathsf{E}_m(x))-\mathbb{E}\widehat f(\mathsf{E}_m(x))| + |\mathbb{E}\widehat f(\mathsf{E}_m(x))-\widehat f(x)|\leq \mathrm{e}_{n} + 2Lr\sqrt{\frac{2}{\lfloor n/D\rfloor}}.\] Finally, suppose \((\mu_n)\) is equipartition-consistent. By Theorem 17, there is a measure \(\mu\in\mathcal{P}(\overline{\Omega}_{\infty})\) such that \(\mu_n=\mathrm{Law}(\mathsf{B}_n(X))\) for \(X\sim\mu\) independent of \(\mathsf{B}_n\). Arguing as above, we have \[\begin{align} \mathrm{e}_{\mu_{\infty}} &= \mathbb{E}|f(X)-\widehat f(X)|\leq \mathbb{E}_X|f(X)-\mathbb{E}_{\mathsf{B}_n}f(\mathsf{B}_n(X))| + \mathbb{E}|f(\mathsf{B}_n(X))-\widehat f(\mathsf{B}_n(X))|\\ &\quad + \mathbb{E}_X|\mathbb{E}_{\mathsf{B}_n}\widehat f(\mathsf{B}_n(X))-\widehat f(X)| \leq \mathrm{e}_{\mu_n} + 2Lr\sqrt{\frac{2D(3D-1)}{n}}, \end{align}\] using Lemma 5 (together with a limiting argument to handle limit objects, like in the proof of Theorem 17 above). This is the last claimed bound. ◻

We now apply Theorem 18 to analyze the DeepSets-like functions from Corollary 7.

Proof (Corollary 7).. The first claim follows from the observation that if \(x,y\in\mathbb{V}_n\) then \[|f(x)-f(y)|\leq L_{\sigma}\sum_i\|\rho(x_i)-\rho(y_i)\|\leq L_{\sigma}L_{\rho}\sum_i\|x_i-y_i\|_2\sqrt{\|x_i\|_1+\|y_i\|_1}\leq L_{\sigma}L_{\rho}\sqrt{2r}\|x-y\|_2.\] For the second claim, consider the sequence \(x^{(n)}=(\frac{1}{2n}e_1,\ldots,\frac{1}{2n}e_1,-\frac{1}{2n}e_1,\ldots,-\frac{1}{2n}e_1)\in\mathbb{V}_{2n}\), where both entries are repeated \(n\) times. Note that \(x^{(n)}\to0\) in sampling metric. Indeed, we have \(\mathsf{B}_k(x^{(n)})\overset{d}{=}\frac{1}{2n}\mathsf{B}_k(\mathbb{1}_ne_1^\top) - \frac{1}{2n}\mathsf{B}_k'(\mathbb{1}_ne_1^\top)\) where \(\mathsf{B}_k,\mathsf{B}_k'\) are independent. Since \(\mathsf{B}_k(\frac{1}{n}\mathbb{1}_ne_1^\top)=(\frac{N_1}{n}e_1,\ldots,\frac{N_k}{n}e_1)\) where \((N_1,\ldots,N_k)\sim\mathrm{Multinom}(n,k,\mathbb{1}_k/k)\), we get \(\mathbb{E}\|\mathsf{B}_k(x^{(n)})\|_2^2 = \frac{1}{2}\sum_{i=1}^k\mathrm{Var}(N_i/n) = \frac{1-1/k}{2n}\), proving that \(\mathsf{B}_k(x^{(n)})\to0\) weakly for each \(k\). However, we have \(f(x^{(n)})\equiv 1\) for all \(n\), proving that \(f\) is discontinuous in sampling metric. ◻

We turn to proving Corollary 9 analyzing certain graph neural networks.

Proof (Corollary 9).. It is easy to verify that \(f\) is unchanged by zero-padding. If \(\|A\|_1+\|X\|_1\leq r\), we have \[\begin{align} &\|F(A,X)-F(B,Y)\|_2\leq \|A-B\|_2 + L_{\sigma}\left\|\sum_{d=0}^DA^dX\Theta_d - \sum_{d=0}^DB^dY\Theta_d\right\|_2\\&\leq \|A-B\|_2 + L_{\sigma}\sum_{d=0}^D\Big(\|A^dX\Theta_d-A^dY\Theta_d\|_2 + \|A^dY\Theta_d-B^dY\Theta_d\|_2\Big)\\ &\leq \|A-B\|_2 + L_{\sigma}\sum_{d=0}^D\|A\|_2^d\|\Theta_d\|_{\mathrm{op}}\|X-Y\|_2 + \sum_{d=0}^D\|A^d-B^d\|_{\mathrm{op}}\|Y\|_2\|\Theta_d\|_{\mathrm{op}}\\ &\leq \left(L_{\sigma}\sum_{d=0}^Dr^d\|\Theta_d\|_{\mathrm{op}}\right)\|X-Y\|_2 + \left(1+L_{\sigma}\sum_{d=0}^Ddr^d\|\Theta_d\|_{\mathrm{op}}\right)\|A-B\|_2,\\ &\leq \underbrace{\left(1+L_{\sigma}\sum_{d=0}^Dr^d\|\Theta_d\|_{\mathrm{op}} + L_{\sigma}\sum_{d=0}^Ddr^d\|\Theta_d\|_{\mathrm{op}}\right)}_{=L(r)}\|(A,X)-(B,Y)\|_2. \end{align}\] Finally, note that if \(\|A\|_1+\|X\|_1\leq r\), then \[\begin{align} \|F(A,X)\|_1\leq \|A\|_1+L_{\sigma}\sqrt{d}\sum_{d=0}^D\|\Theta_d\|_1\|A^d\|_1\|X\|_1&\leq r+L_{\sigma}\sqrt{d}\sum_{d=0}^Dr^{d+1}\|\Theta_d\|_1. \end{align}\] Denoting the last bound above by \(R(r)\), after \(j\) applications of \(F(A,X)\) we have \(\|F^{\circ j}(A,X)\|_1\leq R^{\circ j}(r)\), and hence is Lipschitz with constant \(\prod_{j=1}^{\ell}L(R^{\circ (j-1)}(r))\). Since \(f=P\circ F^{\circ\ell}\) and \(P\) is \(L_{\rho}\sqrt{2R^{\circ \ell}(r)}\)-Lipschitz in 2-norm on the 1-norm ball of radius \(R^{\circ \ell}(r)\) by Corollary 7(1), we obtain the claim. ◻

Finally, we prove Proposition 19 showing that convergence of species samples is equivalent to joint convergence of the random binnings of positive and negative parts. To this end, we shall need the following two lemmas. The first lemma is an analog of the first bound in Theorem 16(1) with the roles of random binning and species sampling reversed.

Lemma 6. Let \((\mathcal{I}_n)\) be a compatible sequence of degree \(D\) and let \(x\in\mathbb{R}^{\mathcal{I}_N}\) with \(x\geq0\). Then \[\mathbb{E}_{\mathsf{B}_n}W_1(\mathsf{E}_k(x),\mathsf{E}_k\circ\mathsf{B}_n(x))\leq \|x\|_1\frac{kD(kD-1)}{n}.\]

Proof. By homogeneity of \(\mathsf{E}_k\) and \(\mathsf{E}_k\circ\mathsf{B}_n\), it suffices to prove the claim for \(x\in\Delta^{\mathcal{I}_N}\). After zero-padding \(x\) if needed, we may assume that \(N\geq kD\). Fix a realization \(F_{n,N}\colon[N]\to[n]\) of a uniformly random map, so \(\mathsf{B}_n(x)\overset{d}{=}\beta(F_{n,N})x\).

Following the construction in Section 2.3.2, sample \(\alpha_1,\ldots,\alpha_k\in\mathcal{I}_N\) from \(x\), define \(\mathscr{E}_k(x)=\frac{1}{k}\sum_{i=1}^ke_{\alpha_i}\), and let \(t_1,\ldots,t_{\ell}\) be a random enumeration of \(S=\bigcup_{i=1}^k\mathrm{supp}(\alpha_i)\subseteq[N]\), where \(\ell\leq kD\) and if \(\alpha=H(j_1,\ldots,j_d)\) for some \(H\subseteq\mathfrak{S}_d\) we denote \(\mathrm{supp}(\alpha)=\{j_1,\ldots,j_d\}\). Recall from the proof of Lemma 3 that \(\theta(F_{n,N})(\alpha_1),\ldots,\theta(F_{n,N})(\alpha_k)\) are iid samples from \(\beta(F_{n,N})x\), so \(\beta(F_{n,N})\mathscr{E}_k(x)\overset{d}{=}\mathscr{E}_k(\beta(F_{n,N})x)\).

If \(F_{n,N}\) is injective on the random and independent set \(S\), then a uniformly random enumeration of \(\bigcup_{i=1}^k\mathrm{supp}(\theta(F_{n,N})(\alpha_i))=F_{n,N}(S)\) is given by \(F_{n,N}(t_1),\ldots,F_{n,N}(t_{\ell})\). Setting \(X_k,Y_k\in\Delta^{\mathcal{I}_k}\) to be \[\begin{align} &(X_k)_{H(i_1,\ldots,i_d)} = \mathscr{E}_k(x)_{H(t_{i_1},\ldots,t_{i_d})} = \frac{1}{k}\sum_{i=1}^k\mathbb{1}[\alpha_i=H(t_{i_1},\ldots,t_{i_d})],\\ &(Y_k)_{H(i_1,\ldots,i_d)} = [\beta(F_{n,N})\mathscr{E}_k(x)]_{H(F_{n,N}(t_{i_1}),\ldots,F_{n,N}(t_{i_d}))} = \frac{1}{k}\sum_{i=1}^k\mathbb{1}[\theta(F_{n,N})(\alpha_i)=H(F_{n,N}(t_{i_1}),\ldots,F_{n,N}(t_{i_d}))], \end{align}\] for each \(H(i_1,\ldots,i_d)\in \mathcal{I}_k\). If \(F_{n,N}\) is injective on \(S\), then \(X_k\overset{d}{=}\mathsf{E}_k(x)\), \(Y_k\overset{d}{=}\mathsf{E}_k(\beta(F_{n,N})x)\), and \(X_k=Y_k\) because \(\alpha_i = H(t_{i_1},\ldots,t_{i_d})\) if and only if \[\theta(F_{n,N})(\alpha_i)=\theta(F_{n,N})H(t_{i_1},\ldots,t_{i_d}) = H(F_{n,N}(t_{i_1}),\ldots,F_{n,N}(t_{i_d})).\] If \(F_{n,N}\) is not injective on \(S\), let \(X_k\) and \(Y_k\) be arbitrary couplings of \(\mathsf{E}_k(x)\) and \(\mathsf{E}_k(\beta(F_{n,N})x)\), which always satisfy \(\|X_k-Y_k\|_2\leq \|X_k\|_1+\|Y_k\|_1 = 2\). We conclude that \[\mathbb{E}_{\mathsf{B}_n}W_1(\mathsf{E}_k(x),\mathsf{E}_k\circ\mathsf{B}_n(x))\leq 2\mathbb{P}[F_{n,N} \textrm{ not injective on } S] \leq 2\frac{\binom{kD}{2}}{n} = \frac{kD(kD-1)}{n},\] as claimed. ◻

We proceed to relate convergence with respect to species sampling and random binning.

Lemma 7. Let \((\mathcal{I}_n)\) be a compatible sequence of finite degree, set \(\mathbb{V}_n=\mathbb{R}^{\mathcal{I}_n}\), and let \((x_i)\subseteq \bigsqcup_n\mathbb{V}_n\).

  1. If \((\mathsf{E}_k(x_i))\) converges weakly for each \(k\), then \((\mathsf{B}_k(x_i))\) converges weakly for each \(k\).

  2. If \((\mathsf{B}_k(x_i))\) converges weakly for each \(k\) and \(x_i\geq0\) for all \(i\), then \((\mathsf{E}_k(x_i))\) converges weakly for each \(k\).

Proof. For the first claim, suppose \((\mathsf{E}_n(x_i))_i\) converges weakly for each \(n\). In particular, the sequence of norms \(\|x_i\|_1=|\mathsf{E}_1(x_i)|\) converges, so we can find \(r>0\) such that \(\sup_i\|x_i\|_1\leq r\). Choose \(\epsilon>0\) and \(n\geq 2(r/\epsilon)^2\). By Skorokhod’s representation theorem, we can find a coupling \((X_{i,n})_i\) of \((\mathsf{E}_n(x_i))_i\) converging almost surely. For any \(k,i,j\in\mathbb{N}\), we then have \[\begin{align} &W_1(\mathsf{B}_k(x_i),\mathsf{B}_k(x_j))\leq \mathbb{E}_{\mathsf{E}_n}W_1(\mathsf{B}_k(x_i), \mathsf{B}_k\circ\mathsf{E}_n(x_i)) + \mathbb{E}_{X_{i,n},X_{j,n}}W_1(\mathsf{B}_k(X_{i,n}),\mathsf{B}_k(X_{j,n}))\\ &\quad + \mathbb{E}_{\mathsf{E}_n}W_1(\mathsf{B}_k\circ\mathsf{E}_n(x_j),\mathsf{B}_k(x_j)) \leq 2\epsilon + \mathbb{E}\|\mathsf{B}_k(X_{i,n}-X_{j,n})\|_2, \end{align}\] by Theorem 16(1) and our choice of \(n\), where in the last line \(\mathsf{B}_k\) is independent of \(X_{i,n},X_{j,n}\). Noting that \(\|\mathsf{B}_k(X_{i,n}-X_{j,n})\|_2\leq \|X_{i,n}-X_{j,n}\|_1\to0\) almost surely, we have \(\limsup_{i,j\to\infty}W_1(\mathsf{B}_k(x_i),\mathsf{B}_k(x_j))\leq 2\epsilon\) for any \(\epsilon>0\), and hence that \((\mathsf{B}_k(x_i))\) converges for each \(k\). This proves the first claim.

Now interchange the roles of species sampling and random binning, using Lemma 6 instead of Theorem 16(1). We conclude that if \((\mathsf{B}_n(x_i))_i\) converges for each \(n\), then \[W_1(\mathsf{E}_k(x_i),\mathsf{E}_k(x_j))\leq 2\epsilon + \mathbb{E}_{X_{i,n},X_{j,n}}W_1(\mathsf{E}_k(X_{i,n}),\mathsf{E}_k(X_{j,n})),\] where \((X_{i,n})_i\) is an almost-surely convergent coupling of \((\mathsf{B}_n(x_i))\). Since \(X_{i,n}\geq0\), either \(X_{i,n}\to0\) in which case \(W_1(\mathsf{E}_k(X_{i,n}),\mathsf{E}_k(X_{j,n}))\to0\), or \(\lim_i\|X_{i,n}\|_1>0\), in which case \[\begin{align} W_1(\mathsf{E}_k(X_{i,n}),\mathsf{E}_k(X_{j,n})) \leq &\|X_{i,n}\|_1W_1(\mathsf{E}_k(X_{i,n}/\|X_{i,n}\|_1),\mathsf{E}_k(X_{j,n}/\|X_{j,n}\|_1)) + \Big| \|X_{i,n}\|_1 - \|X_{j,n}\|_1\Big|. \end{align}\] Both terms converge to zero almost surely, the second because \((\|X_{i,n}\|_1=\|\mathsf{B}_1(x_i)\|_1)_i\) converges, and the first because \(W_1(\mathsf{E}_k(x),\mathsf{E}_k(y))\leq k\|x-y\|_1\) for \(x,y\in\Delta^{\mathcal{I}_n}\). This can be seen by noting that \(\frac{1}{2}\|x-y\|_1\) is the total variation distance between the distributions defined by \(x\) and \(y\) on \(\mathcal{I}_n\), so there is a coupling between \(k\) iid samples from these distributions that are equal with probability at least \(1-\frac{k}{2}\|x-y\|_1\). Applying this fact to the construction of \(\mathsf{E}_k(x)\) and \(\mathsf{E}_k(y)\) from Section 2.3.2 yields the claimed bound. ◻

We are ready to prove Proposition 19.

Proof (Proposition 19).. Define a new compatible sequence \((\mathcal{J}_n=\mathcal{I}_n\sqcup\mathcal{I}_n)\), consisting of two disjoint copies of the original one. Note that its degree is also \(D\). We have maps \(S\colon\mathbb{R}^{\mathcal{I}_n}\to \mathbb{R}^{\mathcal{J}_n}_+\) into nonnegative vectors sending \(x\mapsto (x^+,x^-)\), and \(Q\colon \mathbb{R}^{\mathcal{J}_n}_+\to \mathbb{R}^{\mathcal{I}_n}\) sending \((y,z)\mapsto y-z\). Observe that \(\mathsf{E}_k(x)\overset{d}{=}Q\circ\mathsf{E}_k\circ S(x)\) for any \(x\in\mathbb{R}^{\mathcal{I}_N}\) and any \(N\) by construction in Section 2.3.2. Indeed, the empirical sample \(\mathscr{E}_k(x)=\|x\|_1\mathrm{sign}(x)\odot\mathscr{E}_k(|x|/\|x\|_1)\) can equivalently be formed by sampling \(k\) iid elements \((\alpha_1,s_1),\ldots,(\alpha_k,s_k)\) from the distribution \((x^+,x^-)/\|x\|_1\) on \(\mathcal{J}_n\), where \(s_i=1\) if \(\alpha_i\) is sampled from \(x^+\) and \(s_i=-1\) if it is sampled from \(x^-\). We then have \(Q\circ\mathscr{E}_k\circ S(x)\overset{d}{=}\frac{1}{k}\sum_{i=1}^ks_ie_{\alpha_i} \overset{d}{=} \mathscr{E}_k(x)\). Relabelling the sampled \(\alpha_i\) randomly as in 13 shows that the same identity holds for \(\mathsf{E}_k\) instead of \(\mathscr{E}_k\).

We conclude that \((\mathsf{E}_k(x_i))_i\) converge weakly if and only if \((Q\circ\mathsf{E}_k\circ S(x_i))_i\) converges weakly. Since \(\mathsf{E}_k\circ S(x_i) = (Y_i,Z_i)\) and the supports of \(Y_i\) and \(Z_i\) are disjoint almost surely, we have \(\mathsf{E}_k\circ S(x_i)=S\circ Q\circ \mathsf{E}_k\circ S(x_i)\) for all \(i\), so \((Q\circ\mathsf{E}_k\circ S(x_i))_i\) converges weakly if and only if \((\mathsf{E}_k\circ S(x_i))_i\) converges weakly. In turn, since \(S(x_i)\geq 0\), we conclude by Lemma 7 that \((\mathsf{E}_k\circ S(x_i))_i\) converges weakly for all \(k\) if and only if \((\mathsf{B}_k\circ S(x_i))_i\) converges weakly for all \(k\). Finally, observe that \(\mathsf{B}_k(x_i^+,x_i^-)\overset{d}{=}(\mathsf{B}_k(x_i^+),\mathsf{B}_k(x_i^-))\) by construction of random binning in 5 (see also Section 2.3.1). ◻

5 Conclusions↩︎

We have considered the closely-related problems of generalization and sketching of any-dimensional functions. To tackle these problems, we compare objects of different sizes by comparing distributions of their random samples. By using the right sampling maps, depending on the application domain and the relations between inputs of different sizes there, we obtain rich families of compact sets on which we get uniform rates for generalization and sketching, and a correspondence between limit objects and any-dimensional data distributions. Focusing on specific generalizations of sampling with replacement, random binning, and species sampling, we then obtain precise quantitative rates for approximation, sketching, and generalization. Some of the function classes for which our framework applies include polynomials, permutation-invariant transformers, and several neural network architectures defined for sets, point clouds, and graphs of all sizes. We end with a few directions for future work.

  1. Can we characterize the collection of sequences \((\mathrm{Law}(\mathsf{E}_k(X)))_k\) for random \(X\) in terms of the relations of these distributions across dimensions, analogously to Theorems 13 and 17? These sequences of distributions include random partitions of integers [8][11] and edge-exchangeable random graph models [13], [55].

  2. While we focused on three particular notions of sampling in this paper, there are other notions that might be appropriate for different applications. For example, in the context of natural language sentences, which are not permutation-invariant, is there a different notion of sampling that can summarize long sentences by short ones?

  3. In this paper, we consider summarizing objects using random sampling, and comparing these random summaries in Wasserstein distance. Another type of summary studied in the context of certain graph limits involves summarizing an object by forming sets consisting of all possible projections of it, suitably defined, and comparing these sets in Hausdorff distance, see [12] and [28] for example. Can we develop a general framework and rates for such summaries?

Acknowledgements↩︎

The authors were supported in part by AFOSR grant FA9550-23-1-0070 and by NSF grant DMS-2502377. Some ideas in the proofs of Proposition 10(1), Theorem 16(2), and Proposition 19 were suggested by the ChatGPT 5.5 Thinking model. This work was conducted while EL was at the department of Computing and Mathematical Sciences at Caltech.

References↩︎

[1]
L. Lovász and B. Szegedy, “Limits of dense graph sequences,” Journal of Combinatorial Theory, Series B, vol. 96, no. 6, pp. 933–957, 2006, doi: https://doi.org/10.1016/j.jctb.2006.05.002.
[2]
C. Borgs, J. T. Chayes, L. Lovász, V. T. Sós, and K. Vesztergombi, “Convergent sequences of dense graphs I: Subgraph frequencies, metric properties and testing,” Advances in Mathematics, vol. 219, no. 6, pp. 1801–1851, 2008, doi: https://doi.org/10.1016/j.aim.2008.07.008.
[3]
P. Diaconis and S. Janson, “Graph limits and exchangeable random graphs,” arXiv preprint arXiv:0712.2749, 2007.
[4]
R. Abraham, J.-F. Delmas, and J. Weibel, Probability-graphons: Limits of large dense weighted graphs,” Innovations in Graph Theory, vol. 2, pp. 25–117, Mar. 2025, doi: 10.5802/igt.7.
[5]
G. Cormode and S. Muthukrishnan, “An improved data stream summary: The count-min sketch and its applications,” Journal of Algorithms, vol. 55, no. 1, pp. 58–75, 2005, doi: https://doi.org/10.1016/j.jalgor.2003.12.001.
[6]
Q. Shi, J. Petterson, G. Dror, J. Langford, A. Smola, and S. Vishwanathan, “Hash kernels for structured data,” Journal of Machine Learning Research, vol. 10, no. 11, 2009.
[7]
M. H. Yassaee, M. R. Aref, and A. Gohari, “Achievability proof via output statistics of random binning,” IEEE Transactions on Information Theory, vol. 60, no. 11, pp. 6760–6786, 2014.
[8]
A. Rodriguez and P. Müller, “Nonparametric bayesian inference,” in NSF-CBMS regional conference series in probability and statistics, 2013, vol. 9, pp. i–110.
[9]
J. Pitman, “Exchangeable and partially exchangeable random partitions,” Probability theory and related fields, vol. 102, no. 2, pp. 145–158, 1995.
[10]
J. F. C. Kingman, “The representation of partition structures,” Journal of the London Mathematical Society, vol. s2–18, no. 2, pp. 374–380, Oct. 1978, doi: 10.1112/jlms/s2-18.2.374.
[11]
J. F. C. Kingman, “Random partitions in population genetics,” Proceedings of the Royal Society of London. A. Mathematical and Physical Sciences, vol. 361, no. 1704, pp. 1–20, May 1978, doi: 10.1098/rspa.1978.0089.
[12]
L. Lovász, Large networks and graph limits, vol. 60. American Mathematical Soc., 2012.
[13]
E. Levin and V. Chandrasekaran, “Limits of weighted graphs via random quotients,” arXiv preprint arXiv:2512.23149, 2025.
[14]
V. Vapnik, The nature of statistical learning theory. Springer, 1999.
[15]
E. Levin and V. Chandrasekaran, “Any-dimensional polynomial optimization via de Finetti theorems,” arXiv preprint arXiv:2507.15632, 2025.
[16]
E. Levin, Y. Ma, M. Dı́az, and S. Villar, “On transferring transferability: Towards a theory for size generalization,” arXiv preprint arXiv:2505.23599, 2025.
[17]
T. Furuya, M. V. de Hoop, and G. Peyré, “Transformers are universal in-context learners,” in The thirteenth international conference on learning representations, 2025, [Online]. Available: https://openreview.net/forum?id=6S4WQD1LZR.
[18]
M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. R. Salakhutdinov, and A. J. Smola, “Deep sets,” in Advances in neural information processing systems, 2017, vol. 30, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2017/file/f22e4747da1aa27e363d86d40ff442fe-Paper.pdf.
[19]
C. R. Qi, H. Su, K. Mo, and L. J. Guibas, “PointNet: Deep learning on point sets for 3D classification and segmentation,” in Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), 2017.
[20]
F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini, “The graph neural network model,” IEEE Transactions on Neural Networks, vol. 20, no. 1, pp. 61–80, 2009, doi: 10.1109/TNN.2008.2005605.
[21]
C. Bueno and A. Hylton, “On the representation power of set pooling networks,” Advances in Neural Information Processing Systems, vol. 34, pp. 17170–17182, 2021.
[22]
H. Maron, H. Ben-Hamu, N. Shamir, and Y. Lipman, “Invariant and equivariant graph networks,” in International conference on learning representations, 2019, [Online]. Available: https://openreview.net/forum?id=Syx72jC9tm.
[23]
L. Ruiz, L. Chamon, and A. Ribeiro, “Graphon neural networks and the transferability of graph neural networks,” in Advances in neural information processing systems, 2020, vol. 33, pp. 1702–1712, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2020/file/12bcd658ef0a540cabc36cdf2b1046fd-Paper.pdf.
[24]
T. Lin, Y. Wang, X. Liu, and X. Qiu, “A survey of transformers,” AI Open, vol. 3, pp. 111–132, 2022, doi: https://doi.org/10.1016/j.aiopen.2022.10.001.
[25]
Q. Wen et al., “Transformers in time series: A survey,” in Proceedings of the thirty-second international joint conference on artificial intelligence, 2023, doi: 10.24963/ijcai.2023/759.
[26]
S. Maskey, R. Levie, and G. Kutyniok, “Transferability of graph neural networks: An extended graphon approach,” Applied and Computational Harmonic Analysis, vol. 63, pp. 48–83, 2023.
[27]
S. Maskey, R. Levie, Y. Lee, and G. Kutyniok, “Generalization analysis of message passing neural networks on large random graphs,” in Advances in neural information processing systems, 2022, vol. 35, pp. 4805–4817, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2022/file/1eeaae7c89d9484926db6974b6ece564-Paper-Conference.pdf.
[28]
T. Le and S. Jegelka, “Limits, approximation and size transferability for GNNs on sparse graphs via graphops,” in Advances in neural information processing systems, 2023, vol. 36, pp. 41305–41342, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2023/file/8154c89c8d3612d39fd1ed6a20f4bab1-Paper-Conference.pdf.
[29]
Y. Zhou, U. Alon, X. Chen, X. Wang, R. Agarwal, and D. Zhou, “Transformers can achieve length generalization but not robustly,” in ICLR 2024 workshop on mathematical and empirical understanding of foundation models, 2024, [Online]. Available: https://openreview.net/forum?id=DWkWIh3vFJ.
[30]
X. Huang et al., “A formal framework for understanding length generalization in transformers,” in International conference on learning representations, 2025, vol. 2025, pp. 58095–58179, [Online]. Available: https://proceedings.iclr.cc/paper_files/paper/2025/file/928170bcb050fe64a63fe781b82265aa-Paper-Conference.pdf.
[31]
A. Kazemnejad, I. Padhi, K. Natesan Ramamurthy, P. Das, and S. Reddy, “The impact of positional encoding on length generalization in transformers,” in Advances in neural information processing systems, 2023, vol. 36, pp. 24892–24928, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2023/file/4e85362c02172c0c6567ce593122d31c-Paper-Conference.pdf.
[32]
A. Yang, P. Bergsträßer, G. Zetzsche, D. Chiang, and A. W. Lin, “Length generalization bounds for transformers,” arXiv preprint arXiv:2603.02238, 2026.
[33]
T. Furuya, D. Mis, I. Dokmanić, M. V. de Hoop, and M. Lassas, “Function graph transformers universally approximate operators between function spaces,” arXiv preprint arXiv:2605.17968, 2026.
[34]
C. Yun, S. Bhojanapalli, A. S. Rawat, S. Reddi, and S. Kumar, “Are transformers universal approximators of sequence-to-sequence functions?” in International conference on learning representations, 2020, [Online]. Available: https://openreview.net/forum?id=ByxRM0Ntvr.
[35]
M. Díaz, D. Drusvyatskiy, J. Kendrick, and R. R. Thomas, “Invariant kernels: Rank stabilization and generalization across dimensions,” arXiv preprint arXiv:2502.01886, 2025.
[36]
N. Fournier, “Convergence of the empirical measure in expected wasserstein distance: Non-asymptotic explicit bounds in \(\mathbb{R}^d\),” ESAIM: Probability and Statistics, vol. 27, pp. 749–775, 2023.
[37]
L. Lovász and B. Szegedy, “Szemerédi’s lemma for the analyst,” GAFA Geometric And Functional Analysis, vol. 17, no. 1, pp. 252–270, 2007.
[38]
O. Kallenberg, Foundations of modern probability. Springer, 1997.
[39]
N. Niu and D. I. Spivak, Polynomial functors: A mathematical theory of interaction. Cambridge University Press, 2025.
[40]
A. Ortega, P. Frossard, J. Kovačević, J. M. F. Moura, and P. Vandergheynst, “Graph signal processing: Overview, challenges, and applications,” Proceedings of the IEEE, vol. 106, no. 5, pp. 808–828, 2018, doi: 10.1109/JPROC.2018.2820126.
[41]
P. Cardaliaguet, “Notes on mean field games,” Technical report, 2010.
[42]
Z. Zhang and M. Grabchak, “Entropic representation and estimation of diversity indices,” Journal of Nonparametric Statistics, vol. 28, no. 3, pp. 563–575, 2016, doi: 10.1080/10485252.2016.1190357.
[43]
P. Diaconis and D. Freedman, Finite Exchangeable Sequences,” The Annals of Probability, vol. 8, no. 4, pp. 745–764, 1980, doi: 10.1214/aop/1176994663.
[44]
E. Hewitt and L. J. Savage, “Symmetric measures on cartesian products,” Transactions of the American Mathematical Society, vol. 80, no. 2, pp. 470–501, 1955, Accessed: May 29, 2025. [Online]. Available: http://www.jstor.org/stable/1992999.
[45]
E. B. Dynkin, “Classes of equivalent random quantities,” Uspekhi Matematicheskikh Nauk, vol. 8, no. 2, pp. 125–130, 1953.
[46]
A. J. Stam, “Distance between sampling with and without replacement,” Statistica Neerlandica, vol. 32, no. 2, pp. 81–91, 1978, doi: https://doi.org/10.1111/j.1467-9574.1978.tb01387.x.
[47]
M. J. Wainwright, High-dimensional statistics: A non-asymptotic viewpoint, vol. 48. Cambridge university press, 2019.
[48]
P. Bartlett, “Theoretical statistics, lecture 14.” https://www.stat.berkeley.edu/~bartlett/courses/2013spring-stat210b/notes/14notes.pdf, 2013.
[49]
A. N. Kolmogorov and V. M. Tikhomirov, \(\varepsilon\)-entropy and \(\varepsilon\)-capacity of sets in function spaces,” Uspekhi Matematicheskikh Nauk, vol. 14, no. 2, pp. 3–86, 1959.
[50]
U. von Luxburg and O. Bousquet, “Distance-based classification with Lipschitz functions,” Journal of Machine Learning Research, vol. 5, no. Jun, pp. 669–695, 2004.
[51]
T. Furuya, D. Murari, and C.-B. Schönlieb, “Approximation theory for lipschitz continuous transformers,” arXiv preprint arXiv:2602.15503, 2026.
[52]
F. Vaccarino, “The ring of multisymmetric functions,” Annales de l’Institut Fourier, vol. 55, no. 3, pp. 717–731, 2005, doi: 10.5802/aif.2111.
[53]
R. P. Stanley and S. Fomin, Enumerative combinatorics. Cambridge University Press, 1999.
[54]
I. G. Macdonald, Symmetric functions and Hall polynomials. Oxford university press, 1998.
[55]
S. Janson, “On edge exchangeable random graphs,” Journal of statistical physics, vol. 173, no. 3, pp. 448–484, 2018.

  1. Emails: eitanl@uchicago.edu, venkatc@caltech.edu↩︎

  2. Wasserstein distances are defined between distributions, but to avoid notational clutter, we define these distances between random variables with the understanding that they apply to the laws of these variables.↩︎

  3. We assume infinite-precision self-attention and mean pooling for the last layer, see Corollary 5.↩︎

  4. The Wasserstein distance between two random variables is given by the distance between the associated laws, i.e., if \(X,Y\) are random variables, then \(W_1(X,Y)=W_1(\mathrm{Law}(X),\mathrm{Law}(Y))\).↩︎

  5. We can also view \(\mathsf{S}_k\) as a kernel, i.e., a map \(\bigsqcup_n\mathbb{V}_n\to\mathcal{P}(\mathbb{V}_k)\). The two views are equivalent by [38].↩︎

  6. Here we endow the space of random probability measures \(\mathcal{P}(\mathcal{P}([0,1]))\) with the weak topology with respect to the weak topology on \(\mathcal{P}([0,1])\). See [13] for more details.↩︎

  7. In the language of category theory, this is a functor from the category \(\mathrm{FinSet}\) of finite sets to itself.↩︎

  8. Our notion of degree is closely related to the degree of a polynomial functor [39].↩︎

  9. Such composition-reversing and composition-preserving linear actions of maps between finite sets were called \(\mathrm{FinSet}^{\mathrm{op}}\)- and \(\mathrm{FinSet}\)-representations, respectively, in [15].↩︎

  10. An equipartition is a map with equal-sized fibers.↩︎