SlowGuess/NeurIPS_2023_OCR huggingface dataset:
RoeyMagen
Weizmann Institute of Science roey.magen@weizmann.ac.il
Weizmann Institute of Science
ohad.shamir@weizmann.ac.il
We provide several new results on the sample complexity of vector-valued linear predictors (parameterized by a matrix), and more generally neural networks. Focusing on size-independent bounds, where only the Frobenius norm distance of the parameters from some fixed reference matrix  $W_{0}$  is controlled, we show that the sample complexity behavior can be surprisingly different than what we may expect considering the well-studied setting of scalar-valued linear predictors. This also leads to new sample complexity bounds for feed-forward neural networks, tackling some open questions in the literature, and establishing a new convex linear prediction problem that is provably learnable without uniform convergence.
In this paper, we consider the sample complexity of learning function classes, where each function is a composition of one or more transformations given by
$$
\mathbf {x} \rightarrow f (W \mathbf {x}),
$$
where  $\mathbf{x}$  is a vector,  $W$  is a parameter matrix, and  $f$  is some fixed Lipschitz function. A natural example is vanilla feed-forward neural networks, where each such transformation corresponds to a layer with weight matrix  $W$  and some activation function  $f$ . A second natural example are vector-valued linear predictors (e.g., for multi-class problems), where  $W$  is the predictor matrix and  $f$  corresponds to some loss function. A special case of the above are scalar-valued linear predictors (composed with some scalar loss or nonlinearity  $f$ ), namely  $\mathbf{x} \rightarrow f(\mathbf{w}^\top \mathbf{x})$ , whose sample complexity is extremely well-studied. However, we are interested in the more general case of matrix-valued  $W$ , which (as we shall see) is far less understood.
Clearly, in order for learning to be possible, we must impose some constraints on the size of the function class. One possibility is to bound the number of parameters (i.e., the dimensions of the matrix  $W$ ), in which case learnability follows from standard VC-dimension or covering number arguments (see Anthony and Bartlett [1999]). However, an important thread in statistical learning theory is understanding whether bounds on the number of parameters can be replaced by bounds on the magnitude of the weights – say, a bound on some norm of  $W$ . For example, consider the class of scalar-valued linear predictors of the form
$$
\left\{\mathbf {x} \rightarrow \mathbf {w} ^ {\top} \mathbf {x}: \mathbf {w}, \mathbf {x} \in \mathbb {R} ^ {d}, \| \mathbf {w} \| \leq B \right\}
$$
and inputs  $||\mathbf{x}|| \leq 1$ , where  $||\cdot||$  is the Euclidean norm. For this class, it is well-known that the sample complexity required to achieve excess error  $\epsilon$  (w.r.t. Lipschitz losses) scales as  $O(B^2/\epsilon^2)$ , independent of the number of parameters  $d$  (e.g., Bartlett and Mendelson [2002], Shalev-Shwartz and Ben-David [2014]). Moreover, the same bound holds when we replace  $\mathbf{w}^\top \mathbf{x}$  by  $f(\mathbf{w}^\top \mathbf{x})$  for some 1-Lipschitz function  $f$ . Therefore, it is natural to ask whether similar size-independent bounds can be obtained when  $W$  is a matrix, as described above. This question is the focus of our paper.
When studying the matrix case, there are two complicating factors: The first is that there are many possible generalizations of the Euclidean norm for matrices (namely, matrix norms which reduce to the Euclidean norm in the case of vectors), so it is not obvious which one to study. A second is that rather than constraining the norm of  $W$ , it is increasingly common in recent years to constrain the distance to some fixed reference matrix  $W_0$ , capturing the standard practice of non-zero random initialization (see, e.g., Bartlett et al. [2017]). Following a line of recent works in the context of neural networks (e.g., Vardi et al. [2022], Daniely and Granot [2019, 2022]), we will be mainly interested in the case where we bound the spectral norm  $||\cdot||$  of  $W_0$ , and the distance of  $W$  from  $W_0$  in the Frobenius norm  $||\cdot||_F$ , resulting in function classes of the form
$$
\left\{\mathbf {x} \rightarrow f (W \mathbf {x}): W \in \mathbb {R} ^ {n \times d}, | | W - W _ {0} | | _ {F} \leq B \right\}. \tag {1}
$$
for some Lipschitz, possibly non-linear function  $f$  and a fixed  $W_0$  of bounded spectral norm. This is a natural class to consider, as we know that spectral norm control is necessary (but insufficient) for finite sample complexity guarantees (see, e.g., Golowich et al. [2018]), whereas controlling the (larger) Frobenius norm is sufficient in many cases. Moreover, the Frobenius norm (which is simply the Euclidean norm of all matrix entries) is the natural metric to measure distance from initialization when considering standard gradient methods, and also arises naturally when studying the implicit bias of such methods (see Lyu and Li [2019]). As to  $W_0$ , we note that in the case of scalar-valued linear predictors (where  $W, W_0$  are vectors), the sample complexity is not affected by  $W_0$ . This is intuitive, since the function class corresponds to a ball of radius  $B$  in parameter space, and  $W_0$  affects the location of the ball but not its size. A similar weak dependence on  $W_0$  is also known to occur in other settings that were studied (e.g., Bartlett et al. [2017]).
In this paper, we provide several new contributions on the size-independent sample complexity of this and related function classes, in several directions.
In the first part of the paper (Section 3), we consider function classes as in Eq. (1), without further assumptions on  $f$  besides being Lipschitz, and assuming  $\mathbf{x}$  has a bounded Euclidean norm. As mentioned above, this is a very natural class, corresponding (for example) to vector-valued linear predictors with generic Lipschitz losses, or neural networks composed of a single layer and some general Lipschitz activation. In this setting, we make the following contributions:
- In subsection 3.1 we study the case of  $W_0 = 0$ , and prove that the size-independent sample complexity (up to some accuracy  $\epsilon$ ) is both upper and lower bounded by  $2^{\tilde{\Theta}(B^2 / \epsilon^2)}$ . This is unusual and perhaps surprising, as it implies that this function class does enjoy a finite, size-independent sample complexity bound, but the dependence on the problem parameters  $B, \epsilon$  are exponential. This is in very sharp contrast to the scalar-valued case, where the sample complexity is just  $O(B^2 / \epsilon^2)$  as described earlier. Moreover, and again perhaps unexpectedly, this sample complexity remains the same even if we consider the much larger function class of all bounded Lipschitz functions, composed with all norm-bounded linear functions (as opposed to having a single fixed Lipschitz function).
- Building on the result above, we prove a size-independent sample complexity upper bound for deep feed-forward neural networks, which depends only on the Frobenius norm of the first layer, and the product of the spectral norms of the other layers. In particular, it has no dependence whatsoever on the network depth, width or any other matrix norm constraints, unlike previous works in this setting.
- In subsection 3.2, we turn to consider the case of  $W_0 \neq 0$ , and ask if it is possible to achieve similar size-independent sample complexity guarantees. Perhaps unexpectedly, we show that the answer is no, even for  $W_0$  with very small spectral norm. Again, this is in sharp qualitative contrast to the scalar-valued case and other settings in the literature involving a  $W_0$  term, where the choice of  $W_0$  does not strongly affect the bounds.
- In subsection 3.3, we show that the negative result above yields a new construction of a convex linear prediction problem which is learnable (via stochastic gradient descent), but where uniform convergence provably does not hold. This adds to a well-established line of works in statistical learning theory, studying when uniform convergence is provably unnecessary for distribution-free
1More precisely, it is an easy exercise to show that the Rademacher complexity of the function class  $\{\mathbf{x}\to f(\mathbf{w}^{\top}\mathbf{x}):\mathbf{w}\in \mathbb{R}^{d},||\mathbf{w} - \mathbf{w}_{0}||\leq B\}$  , for some fixed Lipschitz function  $f$  , can be upper bounded independent of  $\mathbf{w}_0$
learnability (e.g., Shalev-Shwartz et al. [2010], Daniely et al. [2011], Feldman [2016], see also Nagarajan and Kolter [2019], Glasgow et al. [2022] in a somewhat different direction).
In the second part of our paper (Section 4), we turn to a different and more specific choice of the function  $f$ , considering one-hidden-layer neural networks with activation applied element-wise:
$$
\mathbf {x} \longrightarrow \mathbf {u} ^ {\top} \sigma (W \mathbf {x}) = \sum_ {j} u _ {j} \sigma (\mathbf {w} _ {j} ^ {\top} \mathbf {x}),
$$
with weight matrix  $W \in R^{n \times d}$ , weight vector  $\mathbf{u} \in \mathbb{R}^n$ , and a fixed (generally non-linear) Lipschitz activation function  $\sigma(\cdot)$ . As before, We focus on an Euclidean setting, where  $\mathbf{x}$  and  $\mathbf{u}$  has a bounded Euclidean norm and  $||W - W_0||_F$  is bounded, for some initialization  $W_0$  with bounded spectral norm. In this part, our sample complexity bounds have polynomial dependencies on the norm bounds and on the target accuracy  $\epsilon$ . Our contributions here are as follows:
- We prove a fully size-independent Rademacher complexity bound for this function class, under the assumption that the activation  $\sigma(\cdot)$  is smooth. In contrast, earlier results that we are aware of were either not size-independent, or assumed  $W_0 = 0$ . Although we do not know whether the smoothness assumption is necessary, we consider this an interesting example of how smoothness can be utilized in the context of sample complexity bounds.
- With  $W_0 = 0$ , we show an upper bound on the Rademacher complexity of deep neural networks (more than one layer) that is fully independent of the network width or the input dimension, and for generic element-wise Lipschitz activations. For constant-depth networks, this bound is fully independent of the network size.
These two results answer some of the open questions in Vardi et al. [2022]. We conclude with a discussion of open problems in Section 5. Formal proofs of our results appear in the appendix.
1.1 Comparison to Previous Work
Deep neural networks and the Frobenius norm. A size-independent uniform convergence guarantee, depending on the product of Frobenius norm of all layers, has been established in Neyshabur et al. [2015] for constant-depth networks, and in Golowich et al. [2018] for arbitrary-depth networks. However, these bounds are specific to element-wise, homogeneous activation functions, whereas we tackle general Lipschitz activations. Bounds based on other norms include Anthony and Bartlett [1999], Bartlett et al. [2017], but are potentially more restrictive than the Frobenius norm, or not independent of the width. All previous bounds of this type (that we are aware of) strongly depend on various norms of all layers, which can be arbitrarily larger than the spectral norm in a size-independent setting (such as the Frobenius norm and the  $(1,2)$ -norm), or make strong assumptions on the activation function.
Rademacher complexity of vector-valued functions. Maurer [2016] showed a contraction inequality for Rademacher averages that extended to Lipschitz functions with vector-valued domains. As an application, he showed an upper bound on the Rademacher complexity of vector-valued linear predictors. However, his bound depends polynomially on the number of parameters (i.e. on  $\sqrt{n}$ ), where we focus on size-independent bounds, which do not depend on the input's dimension or number of parameters. The sample complexity of vector-valued predictors has also been extensively studied in the context of multiclass classification (see for example Mohri et al. [2018]). However, these results generally depend polynomially on the vector dimension (e.g., number of classes), and are not size-independent.
Non-zero initialization. Bartlett et al. [2017] upper bound the sample complexity of neural networks with non-zero initialization, but they used a much stronger assumption than ours: They control the  $(1,2)$ -matrix norm (sum of  $L_{2}$ -norms of the columns), and the gap between this norm and the Frobenius norm can be arbitrarily large, depending on the matrix size. Daniely and Granot [2022] also recently studied the non-zero initialization case, with element-wise activations and Frobenius norm constraints. However, their results in this case are not size-independent and employ a different proof technique than ours.
Non-element-wise activations. Daniely and Granot [2022] provide a fat-shattering lower bound for a general (possibly non-element-wise) Lipschitz activation, which implies that neural networks on  $\mathbb{R}^d$
with bounded Frobenius norm and width  $n$  can shatter  $n$  points with constant margin, assuming that the inputs have norm  $\sqrt{d}$  and that  $n = O(2^d)$ . However, this lower bound does not separate between the input norm bound and the width of the hidden layer. Therefore, their result does not contradict our upper bound (Thm. 2) which implies that it is possible to achieve a size-independent upper bound on the sample complexity, when the input norm is fixed independent of the network width.
Notations. We use bold-face letters to denote vectors, and let  $[m]$  be shorthand for  $\{1,2,\ldots,m\}$ . Given a vector  $\mathbf{x}$ ,  $x_{j}$  denotes its  $j$ -th coordinate. Given a matrix  $W$ ,  $\mathbf{w}_{j}$  is its  $j$ -th row, and  $W_{j,i}$  is its entry in row  $j$  and column  $i$ . Let  $0_{n\times d}$  denote the zero matrix in  $\mathbb{R}^{n\times d}$ , and let  $I_{d\times d}$  be the  $d\times d$  identity matrix. Given a function  $\sigma(\cdot)$  on  $\mathbb{R}$ , we somewhat abuse notation and let  $\sigma(\mathbf{x})$  (for a vector  $\mathbf{x}$ ) or  $\sigma(M)$  (for a matrix  $M$ ) denote applying  $\sigma(\cdot)$  element-wise. We use standard big-Oh notation, with  $\Theta(\cdot), \Omega(\cdot), O(\cdot)$  hiding constants and  $\tilde{\Theta}(\cdot), \tilde{\Omega}(\cdot), \tilde{O}(\cdot)$  hiding constants and factors that are polylogarithmic in the problem parameters.
We let  $\|\cdot\|$  denote the operator norm: For vectors, it is the Euclidean norm, and for matrices, the spectral norm (i.e.,  $\|M\| = \sup_{x:\|\mathbf{x}\|=1} \|M\mathbf{x}\|$ ).  $\|\cdot\|_F$  denotes the Frobenius norm (i.e.,  $\|M\|_F = \sqrt{\sum_{i,j} M_{i,j}^2}$ ). It is well-known that the spectral norm of a matrix is equal to its largest singular value, and that the Frobenius norm is equal to  $\sqrt{\sum_i \sigma_i^2}$ , where  $\sigma_1, \sigma_2, \ldots$  are the singular values of the matrix.
When we say that a function  $f$  is Lipschitz, we refer to the Euclidean metric unless specified otherwise. We say that  $f: \mathbb{R}^d \to \mathbb{R}$  is  $\mu$ -smooth if  $f$  is continuously differentiable and its gradient  $\nabla f$  is  $\mu$ -Lipschitz.
Given a metric space  $(\mathcal{X},d)$  and  $\epsilon >0$  , we say that  $N\subseteq \mathcal{X}$  is an  $\epsilon$  -cover for  $\mathcal{U}\subseteq \mathcal{X}$  if for every  $x\in U$  , there exists  $x^{\prime}\in N$  such that  $d(x,x^{\prime})\leq \epsilon$  . We say that  $P\subseteq \mathcal{X}$  is an  $\epsilon$  -packing (or  $\epsilon$  -separated), if for every  $x,x^{\prime}\in P$  such that  $x\neq x^{\prime}$  we have that  $d(x,x^{\prime})\geq \epsilon$
Sample Complexity Measures. In our results and proofs, we consider several standard complexity measures of a given class of functions, which are well-known to control uniform convergence, and imply upper or lower bounds on the sample complexity:
- Fat-Shattering dimension: It is well-known that the fat-shattering dimension (at scale  $\epsilon$ ) lower bounds the number of samples needed to learn in a distribution-free learning setting, up to accuracy  $\epsilon$  (see for example Anthony and Bartlett [2002]). It is formally defined as follows:
Definition 1 (Fat-Shattering). A class of functions  $\mathcal{F}$  on an input domain  $\mathcal{X}$  shatters  $m$  points  $\mathbf{x}_1, \ldots, \mathbf{x}_m \in \mathcal{X}$  with margin  $\epsilon$ , if there exists a number  $s$ , such that for all  $y \in \{0,1\}^m$  we can find some  $f \in \mathcal{F}$  such that
$$
\forall i \in [ m ], f (\mathbf {x} _ {i}) \leq s - \epsilon \text {i f} y _ {i} = 0 \text {a n d} f (\mathbf {x} _ {i}) \geq s + \epsilon \text {i f} y _ {i} = 1
$$
The fat-shattering dimension of  $F$  (at scale  $\epsilon$ ) is the cardinality  $m$  of the largest set of points in  $\mathcal{X}$  for which the above holds.
Thus, by proving the existence of a large set of points shattered by the function class, we get lower bounds on the fat-shattering dimension, which translate to lower bounds on the sample complexity.
- Rademacher Complexity: This measure can be used to obtain upper bounds on the sample complexity: Indeed, the number of inputs  $m$  required to make the Rademacher complexity of a function class  $\mathcal{F}$  smaller than some  $\epsilon$  is generally an upper bound on the number of samples required to learn  $\mathcal{F}$  up to accuracy  $\epsilon$  (see Shalev-Shwartz and Ben-David [2014]).
Definition 2 (Rademacher complexity). Given a class of functions  $\mathcal{F}$  on a domain  $\mathcal{X}$ , its Rademacher complexity is defined as  $R_{m}(\mathcal{F}) = \sup_{\{\mathbf{x}_{i}\}_{i=1}^{m} \subseteq \mathcal{X}} \mathbb{E}_{\epsilon} \left[ \sup_{f \in \mathcal{F}} \frac{1}{m} \sum_{i=1}^{m} \epsilon_{i} f_{i}(\mathbf{x}_{i}) \right]$ , where  $\epsilon = (\epsilon_{1}, \dots, \epsilon_{m})$  is uniformly distributed on  $\{-1, +1\}^{m}$ .
- Covering Numbers: This is a central tool in the analysis of the complexity of classes of functions (see, e.g., Anthony and Bartlett [2002]), which we use in our proofs.
Definition 3 (Covering Number). Given any class of functions  $\mathcal{F}$  from  $\mathcal{X}$  to  $\mathcal{Y}$ , a metric  $d$  over functions from  $\mathcal{X}$  to  $\mathcal{Y}$ , and  $\epsilon > 0$ , we let the covering number  $N(\mathcal{F}, d, \epsilon)$  denote the minimal
number  $n$  of functions  $f_1, f_2, \ldots, f_n$  from  $\mathcal{X}$  to  $\mathcal{Y}$ , such that for all  $f \in \mathcal{F}$ , there exists some  $f_i$  with  $d(f_i, f) \leq \epsilon$ . In this case we also say that  $\{f_1, f_2, \ldots, f_n\}$  is an  $\epsilon$ -cover for  $\mathcal{F}$ .
In particular, we will consider covering numbers with respect to the empirical  $L_{2}$  metric defined as  $d_{m}(f,f^{\prime}) = \sqrt{\frac{1}{m}\sum_{i = 1}^{m}\left\|f(\mathbf{x}_{i}) - f^{\prime}(\mathbf{x}_{i})\right\|^{2}}$  for some fixed set of inputs  $\mathbf{x}_1,\ldots ,\mathbf{x}_m$ . In addition, if  $\{f_1,f_2,\dots,f_n\} \subseteq \mathcal{F}$ , then we say that this cover is proper. It is well known that the distinction between proper and improper covers is minor, in the sense that the proper  $\epsilon$ -covering number is sandwiched between the improper  $\epsilon$ -covering number and the improper  $\frac{\epsilon}{2}$ -covering number (see the appendix for a formal proof):
Observation 1. Let  $\mathcal{F}$  be a class of functions. Then the proper  $\epsilon$ -covering number for  $\mathcal{F}$  is at least  $N(\mathcal{F}, d, \epsilon)$  and at most  $N(\mathcal{F}, d, \frac{\epsilon}{2})$ .
3 Linear Predictors and Neural Networks with General Activations
We begin by considering the following simple matrix-parameterized class of functions on  $\mathcal{X} = \{\mathbf{x}\in$ $\mathbb{R}^d:||\mathbf{x}||\leq 1\}$  ..
$$
\mathcal {F} _ {B, n, d} ^ {f, W _ {0}} := \left\{\mathbf {x} \rightarrow f (W \mathbf {x}): W \in \mathbb {R} ^ {n \times d}, | | W - W _ {0} | | _ {F} \leq B \right\},
$$
where  $f$  is assumed to be some fixed  $L$ -Lipschitz function, and  $W_{0}$  is a fixed matrix in  $\mathbb{R}^{n\times d}$  with a bounded spectral norm. As discussed in the introduction, this can be interpreted as a class of vector-valued linear predictors composed with some Lipschitz loss function, or alternatively as a generic model of one-hidden-layer neural networks with a generic Lipschitz activation function. Moreover,  $W_{0}$  denotes an initialization/reference point which may or may not be 0.
In this section, we study the sample complexity of this class (via its fat-shattering dimension for lower bounds, and Rademacher complexity for upper bounds). Our focus is on size-independent bounds, which do not depend on the input dimension  $d$  or the matrix size/network width  $n$ . Nevertheless, to understand the effect of these parameters, we explicitly state the conditions on  $d, n$  necessary for the bounds to hold.
Remark 1. Enforcing  $f$  to be Lipschitz and the domain  $\mathcal{X}$  to be bounded is known to be necessary for meaningful size-independent bounds, even in the case of scalar-valued linear predictors  $\mathbf{x} \mapsto f(\mathbf{w}^\top \mathbf{x})$  (e.g., Shalev-Shwartz and Ben-David [2014]). For simplicity, we mostly focus on the case of  $\mathcal{X}$  being the Euclidean unit ball, but this is without much loss of generality: For example, if we consider the domain  $\{\mathbf{x} \in \mathbb{R}^d : ||\mathbf{x}|| \leq b_x\}$  in Euclidean space for some  $b_x \geq 0$ , we can embed  $b_x$  into the weight constraints, and analyze instead the class  $\mathcal{F}_{b_xB,n,d}^{f,b_xW_0}$  over the Euclidean unit ball  $\{\mathbf{x} \in \mathbb{R}^d : ||\mathbf{x}|| \leq 1\}$ .
3.1 Size-Independent Sample Complexity Bounds with  $W_0 = 0$
First, we study the case of initialization at zero (i.e.  $W_0 = 0_{n\times d}$ ). Our first lower bound shows that the size-independent fat-shattering dimension of  $\mathcal{F}_{B,n,d}^{f,W_0}$  (at scale  $\epsilon$ ) is at least exponential in  $B^2/\epsilon^2$ :
Theorem 1. For any  $B, L \geq 1$  and  $\epsilon \in (0,1]$  s.t.  $\frac{L^2B^2}{128\epsilon^2} \geq 20$ , there exists large enough  $d = \Theta(L^2B^2/\epsilon^2)$ ,  $n = \exp(\Theta(L^2B^2/\epsilon^2))$  and an  $L$ -Lipschitz function  $f: \mathbb{R}^n \to \mathbb{R}$  for which  $\mathcal{F}_{B,n,d}^{f,W_0=0}$  can shatter
$$
\exp (c L ^ {2} B ^ {2} / \epsilon^ {2})
$$
points from  $\{\mathbf{x}\in \mathbb{R}^d:||\mathbf{x}||\leq 1\}$  with margin  $\epsilon$  where  $c > 0$  is a universal constant.
The proof is directly based on the proof technique of Theorem 3 in Daniely and Granot [2022], and differs from them mainly in that we focus on the dependence on  $B, \epsilon$  (whereas they considered the dependence on  $n, d$ ). The main idea is to use the probabilistic method to show the existence of  $\mathbf{x}_1, \ldots, \mathbf{x}_m \in \mathbb{R}^d$  and  $W_1, \ldots, W_{2^m} \in \mathbb{R}^{n \times d}$  for  $m = \Theta(B^2 / \epsilon^2)$ , with the property that every two different vectors from  $\{W_y \mathbf{x}_i : i \in m, y \in [2^m]\}$  are far enough from each other. We then construct an  $L$ -Lipschitz function  $f$  which assigns arbitrary outputs to all these points, resulting in a shattering as we range over  $W_1, \ldots, W_{2^m}$ .
We now turn to our more novel contribution, which shows that the bound above is nearly tight, in the sense that we can upper bound the Rademacher complexity of the function class by a similar quantity. In fact, and perhaps surprisingly, a much stronger statement holds: A similar quantity upper bounds the complexity of the much larger class of all  $L$ -Lipschitz function  $f$  on  $\mathbb{R}^n$ , composed with all norm-bounded linear functions from  $\mathbb{R}^d$  to  $\mathbb{R}^n$ :