Scaling Neural Tangent Kernels via Sketching and Random Features

Amir Zandieh, Insu Han, Haim Avron, Neta Shoham, Chaewon Kim, Jinwoo Shin

Introduction

Recent results have shown that over-parameterized Deep Neural Networks (DNNs), generalize surprisingly well. In an effort to understand this phenomena, researchers have studied ultra-wide DNNs and shown that in the infinite width limit, a fully connected DNN trained by gradient descent under least-squares loss is equivalent to kernel regression with respect to the Neural Tangent Kernel (NTK) . This connection has shed light on DNNs’ ability to generalize and optimize (train) their parameters efficiently . More recently, Arora et al. proved an analogous equivalence between convolutional DNNs with infinite number of channels and Convolutional NTK (CNTK). Beyond the aforementioned theoretical purposes, several papers have explored the algorithmic use of this kernel. Arora et al. and Geifman et al. showed that NTK based kernel models can outperform trained DNNs (of finite width). Additionally, CNTK kernel regression sets an impressive performance record on CIFAR-10 for kernel methods without trainable kernels . The NTK has also been used in experimental design and predicting training time .

There is a rich literature on kernel approximations for large-scale learning. One of the most popular approaches is the random features method which works by randomly sampling the feature space of the kernel function, originally due to the seminal work of Rahimi and Recht . Another popular approach which is developed in linear sketching literature , works by designing sketches that can be efficiently applied to the feature space of a kernel without needing to explicitly form the high dimensional feature space. This approach has been successful at designing efficient subspace embeddings for the polynomial kernel . In this paper, we propose solutions for scaling the NTK and CNTK by building on both of these kernel approximations techniques and designing efficient feature maps that approximate the NTK/CNTK evaluation. Consequently, we can simply transform the input dataset to these feature spaces, and then apply fast linear learning methods to approximate the answer of the corresponding nonlinear kernel method efficiently. The performance of such approximate methods is similar or sometimes better than the exact kernel methods due to implicit regularization effects of the approximation algorithms .

One of our results is an efficient random features construction for the NTK. Our starting point is the explicit NTK feature map suggested by Bietti and Mairal based on tensor product of the feature maps of arc-cosine kernels. We obtain our random features, by sampling the feature space of arc-cosine kernels . However, the naïve construction of the features would incur an exponential cost in the depth of the NTK, due to the tensor product of features generated in consecutive layers. We remedy this issue, by utilizing an efficient sketching algorithm for tensor products known as TensorSRHT which can effectively approximate the tensor products of vectors while preserving their inner products. We provide a rigorous error analysis of the proposed scheme in Theorem 2.

Our next results are sketching methods for both NTK and CNTK using a runtime that is linearly proportional to the sparsity of the input dataset (or number of pixels of images). Our methods rely on the arc-cosine kernels’ feature space defined by their Taylor expansion. By careful truncation of their Taylor series, we approximate the arc-cosine kernels with bounded-degree polynomial kernels. Because the feature space of a polynomial kernel is the tensor product of its input space, its dimensionality is exponential in the degree of the kernel. Fortunately, Ahle et al. have developed a linear sketch known as PolySketch that can reduce the dimensionality of high-degree tensor products very efficiently, therefore, we can sketch the resulting polynomial kernels using this technique. We then combine the transformed features from consecutive layers by further sketching their tensor products. In case of CNTK, we have an extra operation which sketches the direct sum of the features of neighbouring pixels at each layer that precisely corresponds to the convolution operation in CNNs. We carefully analyze the errors introduced by polynomial approximations and various sketching steps in our algorithms and also bound their runtimes in Theorems 1 and 4.

Furthermore, we improve the arc-cosine random features to spectrally approximate the entire kernel matrix, which is advocated in recent literature for ensuring high approximation quality in downstream tasks . Our construction is based on leverage score sampling, which entertains better convergence bounds . However, computing this distribution is as expensive as solving the kernel methods exactly. We propose a simple distribution that tightly upper bounds the leverage scores of arc-cosine kernels and for further efficiency, use Gibbs sampling to generate random features from our proposed distribution. We provide our spectral approximation guarantee in Theorem 3.

Finally, we empirically benchmark our proposed methods on various classification/regression tasks and demonstrate that our methods perform similar to or better than exact kernel method with NTK and CNTK while running extremely faster. In particular, we classify CIFAR-10 dataset 150×\times faster than exact CNTK and at the same time achieve higher test accuracy.

2 Related Works

There has been a long line of work on the correspondence between DNN and kernel machines . Furthermore, there has been many efforts in understanding a variety of NTK properties including optimization , generalization , loss surface , etc.

A popular line of work on kernel approximation problem is based on the Fourier features method , which works well for shift-invariant kernels and with some modifications can embed the Gaussian kernel near optimally . Other random feature constructions have been suggested for a variety of kernels, e.g., arc-cosine kernels , polynomial kernels . In linear sketching literature, Avron et al. proposed a subspace embedding for the polynomial kernel which was recently extended to general dot product kernels . The runtime of this method, while nearly linear in sparsity of the input dataset, scales exponentially in kernel’s degree. Recently, Ahle et al. improved this exponential dependence to polynomial which enabled them to sketch high-degree polynomial kernels and led to near-optimal embeddings for Gaussian kernel. In fact, this sketching technology constitutes one of the main ingredients of our proposed methods. Additionally, combining sketching with leverage score sampling can improve the runtime of the polynomial kernel embeddings .

3 Preliminaries: PolySketch and TensorSRHT Transforms

ReLU Neural Tangent Kernel

Let κ0(α)\kappa_{0}(\alpha) and κ1(α)\kappa_{1}(\alpha) be 0th0^{th} and 1st1^{st} order arc-cosine kernels defined as follows,

The connection between ReLU-NTK function Krelu(L)K_{\tt relu}^{(L)} and the NTK kernel Θntk(L)\Theta_{\tt ntk}^{(L)} is formalized bellow,

Sketching and Random Features for NTK

The main results of this section are efficient oblivious sketching as well as random features for the fully-connected NTK. As shown in ?? and ??, the NTK Θntk(L)\Theta_{\tt ntk}^{(L)}, is constructed by recursive composition of arc-cosine kernels κ1(⋅)\kappa_{1}(\cdot) and κ0(⋅)\kappa_{0}(\cdot). So, to design efficient sketches for the NTK we crucially need efficient methods for approximating these functions. Generally, there are two main approaches to approximating these functions; one is random features sampling and the other is truncated Taylor series expansion coupled with fast sketching. We design algorithms by exploiting both of these techniques.

Our main tool is approximating the arc-cosine kernels with low-degree polynomials, and then applying PolySketch to the resulting polynomial kernels. The features for multi-layer NTK are the recursive tensor product of arc-cosine sketches at consecutive layers, which in turn can be sketched efficiently using PolySketch. We present our oblivious sketch in ??.

Now we present our main theorem on NTKSketch algorithm as follows.

For a proof, see ??. One can observe that the runtime of our NTKSketch is faster than the gradient features of an ultra-wide random DNN, studied by Arora et al. , by a factor of L3/ε2L^{3}/\varepsilon^{2}.

2 NTK Random Features

The proof of ?? is provided in ??. Arora et al. proved that the gradient of randomly initialized ReLU network with finite width can approximate the NTK, but their feature dimension should be Ω(L13ε8log⁡2Lδ+L6ε4⋅log⁡Lδ⋅d)\Omega\left(\frac{L^{13}}{\varepsilon^{8}}\log^{2}\frac{L}{\delta}+\frac{L^{6}}{\varepsilon^{4}}\cdot\log\frac{L}{\delta}\cdot d\right) which is larger than ours by a factor of L7ε4log⁡Lδ\frac{L^{7}}{\varepsilon^{4}}\log\frac{L}{\delta}. In ??, we also empirically show that ?? requires far fewer features than random gradients.

3 Spectral Approximation for NTK via Leverage Scores Sampling

Although the above NTK approximations can estimate the kernel function itself, it is still questionable how it affects the performance of downstream tasks. Several works on kernel approximation adopt spectral approximation bound with regularization λ>0\lambda>0 and approximation factor ε>0\varepsilon>0, that is,

where Ψ(L):=[Ψ(L)(x1),…,Ψ(L)(xn)]\bm{\Psi}^{(L)}:=\left[\Psi^{(L)}(x_{1}),\dots,\Psi^{(L)}(x_{n})\right] and [Kntk(L)]i,j=Θntk(L)(xi,xj)[{\bm{K}}^{(L)}_{\tt ntk}]_{i,j}=\Theta_{\tt ntk}^{(L)}(x_{i},x_{j}). The spectral bound can provide rigorous guarantees for downstream applications including kernel ridge regression , clustering and PCA . We first provide spectral bounds for arc-cosine kernels, then we present our spectral approximation bound for two-layer ReLU networks, which is the first in the literature.

To guarantee that the arc-cosine random features in ?? provide spectral approximation, we will use the leverage score sampling framework of . We reduce the variance of random features by performing importance sampling. The challenge is to find a proper modified distribution that certainly reduces the variance. It turns out that the original 0th0^{th} order arc-cosine random features has a small enough variance. More precisely, let K0{\bm{K}}_{0} be the 0th0^{th} order arc-cosine kernel matrix, i.e., [K0]i,j=κ0(⟨xi,xj⟩∥xi∥2∥xj∥2)[{\bm{K}}_{0}]_{i,j}=\kappa_{0}\left(\frac{\langle x_{i},x_{j}\rangle}{\|x_{i}\|_{2}\|x_{j}\|_{2}}\right), and Φ0:=[Φ0(x1),…,Φ0(xn)]\bm{\Phi}_{0}:=\left[\Phi_{0}(x_{1}),\ldots,\Phi_{0}(x_{n})\right], where Φ0(x)\Phi_{0}(x) is defined in ??. If the number of features m0≥83nλε2log⁡(16sλδ)m_{0}\geq\frac{8}{3}\frac{n}{\lambda\varepsilon^{2}}\log\left(\frac{16s_{\lambda}}{\delta}\right), then

The details are provided in ?? and ??. We are now ready to state our spectral approximation bound for our modified random features.

For a proof see ??. To generalize the current proof technique to deeper networks, one needs a monotone property of arc-cosine kernels, i.e., κ1(X)⪯κ1(Y)\kappa_{1}({\bm{X}})\preceq\kappa_{1}({\bm{Y}}) for X⪯Y{\bm{X}}\preceq{\bm{Y}}. However, this property does not hold in general and we leave the extension to deeper networks to future work.

Sketching Convolutional Neural Tangent Kernel

Similar to NTKSketch our method relies on approximating the arc-cosine kernels with low-degree polynomials via Taylor expansion, and then applying PolySketch to the resulting polynomial kernels. Our sketch computes the features for each pixel of the input image, by tensor product of arc-cosine sketches at consecutive layers, which in turn can be sketched efficiently using PolySketch . Additionally, the features of pixels that lie in the same patch get locally combined at each layer via direct sum operation. This precisely corresponds to the convolution operation in neural networks. We present our CNTKSketch algorithm in ?? and give its performance guarantee in the following theorem.

The proof is in ??. Runtime of our CNTKSketch is only linear in the number of image pixels d1d2d_{1}d_{2}, which is in stark contrast to quadratic scaling of the exact CNTK computation .

Experiments

In this section, we empirically show that running least squares regression on the features generated by our methods is extremely fast and effective for learning with NTK and CNTK kernel machines. We run experiments on a system with an Intel E5-2630 CPU with 256 GB RAM and a single GeForce RTX 2080 GPUs with 12 GB RAM. Codes are available at https://github.com/insuhan/ntk-sketch-rf.

We first benchmark our proposed NTK approximation algorithms on MNIST dataset and compare against gradient-based NTK random features (GradRF) as a baseline method. To apply our methods and GradRF into classification task, we encode class labels into one-hot vectors with zero-mean and solve the ridge regression problem. We search the ridge parameter with a random subset of training set and choose the one that achieves the best validation accuracy. We use the ReLU network with depth L=1L=1. In ??, we observe that our random features (NTKRF ) achieves the best test accuracy. The NTKSketch narrowly follows the performance of NTKRF and the Grad-RF is the worst method which confirms the observations of Arora et al. , i.e., gradient of a finite width network degrades practical performances.

As shown in ??, the NTK is a normalized dot-product kernel characterized by the function Krelu(L)(α)K^{(L)}_{\tt relu}(\alpha). This function can be easily computed using O(L)\mathcal{O}(L) operations at any desired α∈\alpha\in, therefore, we can efficiently fit a polynomial to this function using numerical methods (for instance, it is shown in ?? that a degree-88 polynomial can tightly approximate the depth-33 ReLU-NTK function Krelu(3)K_{\tt relu}^{(3)}). Then, we can efficiently sketch the resulting polynomial kernel using PolySketch , as was previously done for Gaussian and general dot-product kernels . Therefore, we can accelerate our NTKSketch for deeper networks (L>2L>2), using this heuristic.

2 CNTK Classification on CIFAR-10

Next we test our CNTKSketch on CIFAR-10 dataset . We choose a convolutional network of depth L=3L=3 and compare CNTKSketch and GradRF for various feature dimensions. We borrow results of both CNTK and CNN from Arora et al. . The results are provided in ?? and ??. Somewhat surprisingly, CNTKSketch even performs better than the exact CNTK regression by achieving 72.06%72.06\% when feature dimension is set to 16,38416{,}384. The likely explanation is that CNTKSketch takes advantages of implicit regularization effects of approximate feature map and powerful expressiveness of the CNTK. Moreover, computing the CNTK matrix takes over 250 hours (12 days) under our setting which is at least 150×150\times slower than our CNTKSketch.

3 Regression on Large-scale UCI Datasets

Discussion and Conclusion

In this work, we propose efficient low-rank feature maps for the NTK and CNTK kernel matrices based on both sketching and random features. Computing NTK have been raised severe computational problems when they apply to practical applications. Our methods runs remarkably faster than the NTK with performance improvement.

Potential negative societal impact. This is a technical work proposing provable algorithms which stand alone independently of data, e.g., do not learn any private information of input data. We think there is no particular potential negative societal impact due to our work.

Limitations. This paper only considers fully-connected and convolutional neural networks, and our ideas are not directly applicable to scale up NTK of other deep networks, e.g., transformers .

Acknowledgments and Disclosure of Funding

Amir Zandieh was partially supported by the Swiss NSF grant No. P2ELP2_195140. Haim Avron and Neta Shoham were partially supported by BSF grant 2017698 and ISF grant 1272/17. Jinwoo Shin was partially supported by the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF_2018R1A5A1059921) and Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019_0_00075, Artificial Intelligence Graduate School Program (KAIST)).

References

Appendix A ReLU-NTK Expression

For h=1,2,…Lh=1,2,\ldots L, define the derivative covariance as,

Let Θntk(0)(y,z):=Σ(0)(y,z)\Theta_{\tt ntk}^{(0)}(y,z):=\Sigma^{(0)}(y,z) and for every integer L≥1L\geq 1, the depth-LL NTK expression is defined recursively as:

First note that the main component of the DP given in ??, ??, and ?? is the Activation Covariances:

Proof of ??: Consider the NTK expression given in ??, ??, and ??. We first prove by induction on h=0,1,2,…Lh=0,1,2,\ldots L that the covariance function Σ(h)(y,z)\Sigma^{(h)}(y,z) defined in ?? satisfies:

The base of induction is trivial for h=0h=0 due to Σ(0)(y,z)=⟨y,z⟩=∥y∥2∥z∥2⋅Σrelu(0)(⟨y,z⟩∥y∥2∥z∥2)\Sigma^{(0)}(y,z)=\langle y,z\rangle=\|y\|_{2}\|z\|_{2}\cdot\Sigma_{\tt relu}^{(0)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right).

To prove the inductive step, suppose that the inductive hypothesis holds for h−1h-1, i.e.,

Using a similar argument we have ∥g∥22=∥z∥22\|g\|_{2}^{2}=\|z\|_{2}^{2}. Therefore, by ??, we can write

Since we assumed that Λ(h)(y,z)=(f⊤g⊤)⋅(fg)\Lambda^{(h)}(y,z)=\begin{pmatrix}f^{\top}\\ g^{\top}\end{pmatrix}\cdot\begin{pmatrix}f&g\end{pmatrix}, we have ⟨f,g⟩=Σ(h−1)(y,z)\langle f,g\rangle=\Sigma^{(h-1)}(y,z). By inductive hypothesis along with ??, we find that

which completes the induction and proves that for every h=0,1,…,Lh=0,1,\dots,L,

Since we assumed that Λ(h)(y,z)=(f⊤g⊤)⋅(fg)\Lambda^{(h)}(y,z)=\begin{pmatrix}f^{\top}\\ g^{\top}\end{pmatrix}\cdot\begin{pmatrix}f&g\end{pmatrix}, ⟨f,g⟩=Σ(h−1)(y,z)=∥y∥2∥z∥2⋅Σrelu(h−1)(⟨y,z⟩∥y∥2∥z∥2)\langle f,g\rangle=\Sigma^{(h-1)}(y,z)=\|y\|_{2}\|z\|_{2}\cdot\Sigma_{\tt relu}^{(h-1)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right). Therefore, by ??, for every h∈{1,2,…L}h\in\{1,2,\dots L\},

Now we prove by induction on integer LL that the NTK with LL layers and ReLU activation given in ?? satisfies

The base of induction, trivially holds because, by ??:

To prove the inductive step, suppose that the inducive hypothesis holds for L−1L-1, that is Θntk(L−1)(y,z)=∥y∥2∥z∥2⋅Krelu(L−1)(⟨y,z⟩∥y∥2∥z∥2)\Theta_{\tt ntk}^{(L-1)}(y,z)=\|y\|_{2}\|z\|_{2}\cdot K_{\tt relu}^{(L-1)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right). Now using the recursive definition of Θntk(L)(y,z)\Theta_{\tt ntk}^{(L)}(y,z) given in ?? along with ?? and ?? we can write,

Appendix B Sketching Preliminaries: PolySketch and SRHT

Our sketching algorithms use the Subsampled Randomized Hadamard Transform (SRHT) to reduce the dimensionality of the intermediate vectors that arise in our computations. Next lemma gives the performance of SRHT sketches which is proved, for instance, in Theorem 9 of ,

Now we restate the ?? and present the proof,

This immediately proves the first statement of the lemma.

As shown in , the sketch Qp{\bm{Q}}^{p} can be applied to tensor product vectors of the form v1⊗v2⊗…vpv_{1}\otimes v_{2}\otimes\ldots v_{p} by recursive application of O(p)\mathcal{O}(p) independent instances of OSNAP transform and a novel variant of the SRHT , proposed in called TensorSRHT, on vectors viv_{i} and their sketched versions. The sketch Qp{\bm{Q}}^{p}, as shown in ??, can be represented by a binary tree with pp leaves where the leaves are OSNAP sketches and the internal nodes are the TensorSRHT. The use of OSNAP in the leaves of this sketch structure ensures excellent runtime for sketching sparse input vectors. However, note that if the input vectors are not sparse, i.e., nnz(vi)=Ω~(d){\rm nnz}(v_{i})=\widetilde{\Omega}(d) for input vectors viv_{i}, then we can simply remove the OSNAP transforms from the leaves of this structure and achieve improved runtime, without hurting the approximation guarantee. Therefore, the sketch Qp{\bm{Q}}^{p} that satisfies the statement of the lemma is exactly the one introduced in for sparse input vectors and for non-sparse inputs is obtained by removing the OSNAP transforms from the leaves of the sketch structure given in ??.

Furthermore, the sketch Qp{\bm{Q}}^{p} can be applied to tensor product of any collection of pp vectors. The time to apply Qp{\bm{Q}}^{p} to the tensor product v1⊗v2⊗…vpv_{1}\otimes v_{2}\otimes\ldots v_{p} consists of time of applying OSNAP to each of the vectors v1,v2…vpv_{1},v_{2}\ldots v_{p} and time of applying O(p)\mathcal{O}(p) instances of TensorSRHT to intermediate vectors which are of size mm. This runtime can be upper bounded by O(p2log⁡pεε2log⁡31εδ+p3/2εd⋅log⁡1δ)\mathcal{O}\left(\frac{p^{2}\log\frac{p}{\varepsilon}}{\varepsilon^{2}}\log^{3}\frac{1}{\varepsilon\delta}+\frac{p^{3/2}}{\varepsilon}d\cdot\log\frac{1}{\delta}\right), which proves the third statement of the ??. ∎

Appendix C NTK Sketch: Claims and Invariants

We start by proving that the polynomials Prelu(p)(⋅)P_{\tt relu}^{(p)}(\cdot) and P˙relu(p′)(⋅)\dot{P}_{\tt relu}^{(p^{\prime})}(\cdot) defined in ?? of ?? closely approximate the arc-cosine functions κ1(⋅)\kappa_{1}(\cdot) and κ0(⋅)\kappa_{0}(\cdot) on the interval $$.

Remark. Observe that κ0(α)=ddα(κ1(α))\kappa_{0}(\alpha)=\frac{d}{d\alpha}\left(\kappa_{1}(\alpha)\right).

If we let κ1(⋅)\kappa_{1}(\cdot) and κ0(⋅)\kappa_{0}(\cdot) be defined as in ?? of ??, then for any integer p≥19ε2/3p\geq\frac{1}{9\varepsilon^{2/3}}, the polynomial Prelu(p)(⋅)P_{\tt relu}^{(p)}(\cdot) defined in ?? of ?? satisfies,

Moreover, for any integer p′≥126ε2p^{\prime}\geq\frac{1}{26\varepsilon^{2}}, the polynomial P˙relu(p′)(⋅)\dot{P}_{\tt relu}^{(p^{\prime})}(\cdot) defined as in ?? of ??, satisfies,

Proof of ??: We start by Taylor series expansion of κ0(⋅)\kappa_{0}(\cdot) around α=0\alpha=0, κ0(α)=12+1π⋅∑i=0∞(2i)!22i⋅(i!)2⋅(2i+1)⋅α2i+1\kappa_{0}(\alpha)=\frac{1}{2}+\frac{1}{\pi}\cdot\sum_{i=0}^{\infty}\frac{(2i)!}{2^{2i}\cdot(i!)^{2}\cdot(2i+1)}\cdot\alpha^{2i+1}. Therefore, we have

To prove the second part of the lemma, we consider the Taylor expansion of κ1(⋅)\kappa_{1}(\cdot) at α=0\alpha=0. Since κ0(α)=ddα(κ1(α))\kappa_{0}(\alpha)=\frac{d}{d\alpha}\left(\kappa_{1}(\alpha)\right), the Taylor series of κ1(α)\kappa_{1}(\alpha) can be obtained from the Taylor series of κ0(α)\kappa_{0}(\alpha) as follows,

Therefore, it is possible to approximate the function κ0(⋅)\kappa_{0}(\cdot) up to error ε\varepsilon using a polynomial of degree O(1ε2)\mathcal{O}\left(\frac{1}{\varepsilon^{2}}\right). Also if we want to approximate κ1(⋅)\kappa_{1}(\cdot) using a polynomial up to error ε\varepsilon on the interval $,itsufficestouseapolynomialofdegree, it suffices to use a polynomial of degree\mathcal{O}\left(\frac{1}{\varepsilon^{2/3}}\right).OnecanseethatsincetheTaylorexpansionsof. One can see that since the Taylor expansions of\kappa_{1}andand\kappa_{0}containnon−negativecoefficientsonly,bothofthesefunctionsarepositivedefinite.Additionally,thepolynomialapproximationscontain non-negative coefficients only, both of these functions are positive definite. Additionally, the polynomial approximationsP_{\tt relu}^{(p)}andand\dot{P}_{\tt relu}^{(p^{\prime})}$ given in ?? of ?? are positive definite functions.

In order to prove ??, we also need the following lemma on the error sensitivity of polynomials Prelu(p)P_{\tt relu}^{(p)} and P˙relu(p′)\dot{P}_{\tt relu}^{(p^{\prime})},

For any integer p≥3p\geq 3, any α∈\alpha\in, and any α′\alpha^{\prime} such that ∣α−α′∣≤16p|\alpha-\alpha^{\prime}|\leq\frac{1}{6p}, if we let the polynomials Prelu(p)(α)P_{\tt relu}^{(p)}(\alpha) and P˙relu(p)(α)\dot{P}_{\tt relu}^{(p)}(\alpha) be defined as in ?? of ??, then

Proof of ??: Note that an α′\alpha^{\prime} that satisfies the preconditions of the lemm, is in the range [−1−16p,1+16p]\left[-1-\frac{1}{6p},1+\frac{1}{6p}\right]. Now we bound the derivative of the polynomial P˙relu(p)\dot{P}_{\tt relu}^{(p)} on the interval [−1−16p,1+16p]\left[-1-\frac{1}{6p},1+\frac{1}{6p}\right],

therefore, the second statement of lemma holds.

To prove the first statement of lemma, we bound the derivative of the polynomial Prelu(p)P_{\tt relu}^{(p)} on the interval [−1−16p,1+16p]\left[-1-\frac{1}{6p},1+\frac{1}{6p}\right] as follows,

therefore, the second statement of the lemma follows. This completes the proof of ??. ∎

For the rest of this section, we need two basic properties of tensor products and direct sums:

for vectors x,y,z,wx,y,z,w with conforming sizes.

Now we are in a position to analyze the invariants that are maintained throughout the execution of NTKSketch (??):

The mapping ϕ(h)(⋅)\phi^{(h)}(\cdot) computed by NTKSketch in line 4 and ?? of ?? satisfy

The mapping ψ(h)(⋅)\psi^{(h)}(\cdot) computed by NTKSketch in line 5 and ?? of ?? satisfy

Proof of ??: The proof is by induction on the value of h=0,1,2,…Lh=0,1,2,\ldots L. More formally, consider the following statements for every h=0,1,2,…Lh=0,1,2,\ldots L:

Additionally, by induction, we prove that for every h=1,2,…Lh=1,2,\ldots L,

(1) Base of induction (h=0h=0): By line 4 of ??, ϕ(0)(y)=1∥y∥2⋅S⋅Q1⋅y\phi^{(0)}(y)=\frac{1}{\|y\|_{2}}\cdot{\bm{S}}\cdot{\bm{Q}}^{1}\cdot y and ϕ(0)(z)=1∥z∥2⋅S⋅Q1⋅z\phi^{(0)}(z)=\frac{1}{\|z\|_{2}}\cdot{\bm{S}}\cdot{\bm{Q}}^{1}\cdot z, thus, ?? implies the following

By using the above together with ?? and union bound as well as triangle inequality, we have

Using union bound, this proves the base of induction for statement P1(0)P_{1}(0), i.e.,

Moreover, by line 5 of ??, ψ(0)(y)=V⋅ϕ(0)(y)\psi^{(0)}(y)={\bm{V}}\cdot\phi^{(0)}(y) and ψ(0)(z)=V⋅ϕ(0)(z)\psi^{(0)}(z)={\bm{V}}\cdot\phi^{(0)}(z), thus, ?? implies that,

By conditioning on P1(0)P_{1}(0) and using the above together with triangle inequality it follows that,

Similarly we can prove that with probability 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right) we have ∣∥ψ(0)(y)∥22−Krelu(0)(1)∣≤ε10L\left|\left\|\psi^{(0)}(y)\right\|_{2}^{2}-K_{\tt relu}^{(0)}(1)\right|\leq\frac{\varepsilon}{10L} and ∣∥ψ(0)(z)∥22−Krelu(0)(1)∣≤ε10L\left|\left\|\psi^{(0)}(z)\right\|_{2}^{2}-K_{\tt relu}^{(0)}(1)\right|\leq\frac{\varepsilon}{10L}, which proves the base of induction for the second statement, i.e., Pr⁡[P2(0)∣P1(0)]≥1−O(δ/L)\Pr[P_{2}(0)|P_{1}(0)]\geq 1-\mathcal{O}\left({\delta}/{L}\right). This completes the base of induction.

(2) Inductive step: Assume that the inductive hypothesis holds for h−1h-1. First, note that by ?? and using ?? we have the following,

where A:=∑j=02p+2cj∥Zj(h)(y)∥22⋅∑j=02p+2cj∥Zj(h)(z)∥22A:=\sqrt{\sum_{j=0}^{2p+2}c_{j}\|Z^{(h)}_{j}(y)\|_{2}^{2}}\cdot\sqrt{\sum_{j=0}^{2p+2}c_{j}\|Z^{(h)}_{j}(z)\|_{2}^{2}} and the collection of vectors {Zj(h)(y)}j=02p+2\left\{Z^{(h)}_{j}(y)\right\}_{j=0}^{2p+2} and {Zj(h)(z)}j=02p+2\left\{Z^{(h)}_{j}(z)\right\}_{j=0}^{2p+2} and coefficients {cj}j=02p+2\{c_{j}\}_{j=0}^{2p+2} are defined as per ?? and ??, respectively.

By ?? together with union bound, the following inequalities simultaneously hold for all j=0,…,2p+2j=0,\dots,2p+2, with probability at least 1−O(δ/L)1-\mathcal{O}\left(\delta/L\right):

Therefore, by plugging ?? to ?? and using union bound, triangle inequality and Cauchy–Schwarz inequality we find that,

where B:=Prelu(p)(∥ϕ(h−1)(y)∥22)⋅Prelu(p)(∥ϕ(h−1)(z)∥22)B:=\sqrt{P^{(p)}_{\tt relu}\left(\|\phi^{(h-1)}(y)\|_{2}^{2}\right)\cdot P^{(p)}_{\tt relu}\left(\|\phi^{(h-1)}(z)\|_{2}^{2}\right)} and Prelu(p)(α)=∑j=02p+2cj⋅αjP^{(p)}_{\tt relu}(\alpha)=\sum_{j=0}^{2p+2}c_{j}\cdot\alpha^{j} is the polynomial defined in ??. Using the inductive hypothesis P1(h−1)P_{1}(h-1), we have that

Therefore, by ?? we have ∣Prelu(p)(∥ϕ(h−1)(y)∥22)−Prelu(p)(1)∣≤h⋅ε260L3\left|P_{\tt relu}^{(p)}\left(\|\phi^{(h-1)}(y)\|_{2}^{2}\right)-P_{\tt relu}^{(p)}(1)\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}} and ∣Prelu(p)(∥ϕ(h−1)(z)∥22)−Prelu(p)(1)∣≤h⋅ε260L3\left|P_{\tt relu}^{(p)}\left(\|\phi^{(h-1)}(z)\|_{2}^{2}\right)-P_{\tt relu}^{(p)}(1)\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}}. Consequently, since Prelu(p)(1)≤Prelu(+∞)(1)=1P_{\tt relu}^{(p)}(1)\leq P_{\tt relu}^{(+\infty)}(1)=1, we obtain that B≤1110.B\leq\frac{11}{10}. By plugging this into ?? we have,

Furthermore, the inductive hypothesis P1(h−1)P_{1}(h-1) implies that

By incorporating the above inequality into ?? using triangle inequality we find that,

Now, by invoking ?? and using the fact that p=⌈2L2/ε4/3⌉p=\left\lceil 2L^{2}/{\varepsilon}^{4/3}\right\rceil we have,

By combining the above inequality with ?? using triangle inequality and using the fact that κ1(Σrelu(h−1)(⟨y,z⟩∥y∥2∥z∥2))=Σrelu(h)(⟨y,z⟩∥y∥2∥z∥2)\kappa_{1}\left(\Sigma_{\tt relu}^{(h-1)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right)\right)=\Sigma_{\tt relu}^{(h)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right) (by ??), we get the following bound,

This is sufficient to prove the inductive step by union bound, i.e., Pr⁡[P1(h)∣P1(h−1)]≥1−O(δL)\Pr[P_{1}(h)|P_{1}(h-1)]\geq 1-\mathcal{O}\left(\frac{\delta}{L}\right).

Now we prove the inductive step for statement P2(h)P_{2}(h), that is, we prove that conditioned on P2(h−1),P1(h),P1(h−1)P_{2}(h-1),P_{1}(h),P_{1}(h-1), statement P2(h)P_{2}(h) holds with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right). First, note that by ?? and using ?? we have,

where A^:=∑j=02p′+1bj∥Yj(h)(y)∥22⋅∑j=02p′+1bj∥Yj(h)(z)∥22\widehat{A}:=\sqrt{\sum_{j=0}^{2p^{\prime}+1}b_{j}\|Y^{(h)}_{j}(y)\|_{2}^{2}}\cdot\sqrt{\sum_{j=0}^{2p^{\prime}+1}b_{j}\|Y^{(h)}_{j}(z)\|_{2}^{2}} and the collection of vectors {Yj(h)(y)}j=02p′+1\left\{Y^{(h)}_{j}(y)\right\}_{j=0}^{2p^{\prime}+1} and {Yj(h)(z)}j=02p′+1\left\{Y^{(h)}_{j}(z)\right\}_{j=0}^{2p^{\prime}+1} and coefficients {bj}j=02p′+1\{b_{j}\}_{j=0}^{2p^{\prime}+1} are defined as per ?? and ??, respectively. By invoking ?? along with union bound, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following inequalities hold true simultaneously for all j=0,1,…2p′+1j=0,1,\ldots 2p^{\prime}+1

Therefore, by plugging ?? into ?? and using union bound, triangle inequality and Cauchy–Schwarz inequality we find that,

where B^:=P˙relu(p′)(∥ϕ(h−1)(y)∥22)⋅P˙relu(p′)(∥ϕ(h−1)(z)∥22)\widehat{B}:=\sqrt{\dot{P}^{(p^{\prime})}_{\tt relu}\left(\|\phi^{(h-1)}(y)\|_{2}^{2}\right)\cdot\dot{P}^{(p^{\prime})}_{\tt relu}\left(\|\phi^{(h-1)}(z)\|_{2}^{2}\right)} and P˙relu(p′)(α)=∑j=02p′+1bj⋅αj\dot{P}^{(p^{\prime})}_{\tt relu}(\alpha)=\sum_{j=0}^{2p^{\prime}+1}b_{j}\cdot\alpha^{j} is the polynomial defined in ??. By inductive hypothesis P1(h−1)P_{1}(h-1) we have ∣∥ϕ(h−1)(y)∥22−1∣≤h⋅ε260L3\left|\left\|\phi^{(h-1)}(y)\right\|_{2}^{2}-1\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}} and ∣∥ϕ(h−1)(z)∥22−1∣≤h⋅ε260L3\left|\left\|\phi^{(h-1)}(z)\right\|_{2}^{2}-1\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}}. Therefore, using the fact that p′=⌈9L2/ε2⌉p^{\prime}=\left\lceil 9L^{2}/\varepsilon^{2}\right\rceil and ??, ∣P˙relu(p′)(∥ϕ(h−1)(y)∥22)−P˙relu(p′)(1)∣≤h⋅ε20L2\left|\dot{P}_{\tt relu}^{(p^{\prime})}\left(\|\phi^{(h-1)}(y)\|_{2}^{2}\right)-\dot{P}_{\tt relu}^{(p^{\prime})}(1)\right|\leq\frac{h\cdot\varepsilon}{20L^{2}} and ∣P˙relu(p′)(∥ϕ(h−1)(z)∥22)−P˙relu(p′)(1)∣≤h⋅ε20L2\left|\dot{P}_{\tt relu}^{(p^{\prime})}\left(\|\phi^{(h-1)}(z)\|_{2}^{2}\right)-\dot{P}_{\tt relu}^{(p^{\prime})}(1)\right|\leq\frac{h\cdot\varepsilon}{20L^{2}}. Consequently, since P˙relu(p′)(1)≤P˙relu(+∞)(1)=1\dot{P}_{\tt relu}^{(p^{\prime})}(1)\leq\dot{P}_{\tt relu}^{(+\infty)}(1)=1, we find that B^≤1110.\widehat{B}\leq\frac{11}{10}. By plugging this into ?? we have,

Furthermore, inductive hypothesis P1(h−1)P_{1}(h-1) implies ∣<ϕ(h−1)(y),ϕ(h−1)(z)>−Σrelu(h−1)(⟨y,z⟩∥y∥2∥z∥2)∣≤h⋅ε260L3\left|\left<\phi^{(h-1)}(y),\phi^{(h-1)}(z)\right>-\Sigma_{\tt relu}^{(h-1)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right)\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}}, hence, by invoking ?? we find that,

By plugging the above inequality into ?? using triangle inequality, we find that,

Now, by invoking ?? and using the fact that p′=⌈9L2/ε2⌉p^{\prime}=\left\lceil 9L^{2}/{\varepsilon}^{2}\right\rceil we have,

By combining the above inequality with ?? using triangle inequality and using the fact that κ0(Σrelu(h−1)(⟨y,z⟩∥y∥2∥z∥2))=Σ˙relu(h)(⟨y,z⟩∥y∥2∥z∥2)\kappa_{0}\left(\Sigma_{\tt relu}^{(h-1)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right)\right)=\dot{\Sigma}_{\tt relu}^{(h)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right) (by ??), we get the following bound,

Now let f:=ψ(h−1)(y)⊗ϕ˙(h)(y)f:=\psi^{(h-1)}(y)\otimes\dot{\phi}^{(h)}(y) and g:=ψ(h−1)(z)⊗ϕ˙(h)(z)g:=\psi^{(h-1)}(z)\otimes\dot{\phi}^{(h)}(z). Then by ?? and using ?? we have the following,

where D:=∥Q2f⊕ϕ(h)(y)∥2∥Q2g⊕ϕ(h)(z)∥2D:=\left\|{\bm{Q}}^{2}f\oplus\phi^{(h)}(y)\right\|_{2}\left\|{\bm{Q}}^{2}g\oplus\phi^{(h)}(z)\right\|_{2}. By the fact that we conditioned on P1(h)P_{1}(h),

By ??, we can further obtain an upper bound:

Now note that because we conditioned on P2(h−1)P_{2}(h-1) and using ??, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right) the following holds:

Similarly, ∥g∥22≤1110h\left\|g\right\|_{2}^{2}\leq\frac{11}{10}h with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), thus, by union bound:

Therefore, by combining the above with ?? via union bound we find that,

Now note that <Q2f⊕ϕ(h)(y),Q2g⊕ϕ(h)(z)>=<Q2f,Q2g>+<ϕ(h)(y),ϕ(h)(z)>\left<{\bm{Q}}^{2}f\oplus\phi^{(h)}(y),{\bm{Q}}^{2}g\oplus\phi^{(h)}(z)\right>=\left<{\bm{Q}}^{2}f,{\bm{Q}}^{2}g\right>+\left<\phi^{(h)}(y),\phi^{(h)}(z)\right>. We proceed by bounding the term ∣<Q2f,Q2g>−<f,g>∣\left|\left<{\bm{Q}}^{2}f,{\bm{Q}}^{2}g\right>-\left<f,g\right>\right| using ??, as follows,

We proved that conditioned on P2(h−1)P_{2}(h-1) and P1(h−1)P_{1}(h-1), ∥f∥22≤11h/10\left\|f\right\|_{2}^{2}\leq 11h/10 and ∥g∥22≤11h/10\left\|g\right\|_{2}^{2}\leq 11h/10 with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right). Hence, by union bound we find that,

Note that <f,g>=<ψ(h−1)(y),ψ(h−1)(z)>⋅<ϕ˙(h)(y),ϕ˙(h)(z)>\left<f,g\right>=\left<\psi^{(h-1)}(y),\psi^{(h-1)}(z)\right>\cdot\left<\dot{\phi}^{(h)}(y),\dot{\phi}^{(h)}(z)\right>, thus by conditioning on inductive hypothesis P2(h−1)P_{2}(h-1) and ?? we have,

By combining the above inequality with ??, P1(h)P_{1}(h), and ?? using triangle inequality and union bound we get the following inequality,

By noting that Krelu(h−1)(α)⋅Σ˙relu(h)(α)+Σrelu(h)(α)=Krelu(h)(α)K_{\tt relu}^{(h-1)}\left(\alpha\right)\cdot\dot{\Sigma}_{\tt relu}^{(h)}\left(\alpha\right)+\Sigma_{\tt relu}^{(h)}\left(\alpha\right)=K_{\tt relu}^{(h)}\left(\alpha\right) (see ??) we have proved that

Similarly we can prove the following inequalities hold with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

This proves the inductive step for the statement P2(h)P_{2}(h) follows, i.e.,

Therefore, by union bounding over all h=0,1,2,…Lh=0,1,2,\ldots L, it follows that the statements of the lemma hold simultaneously for all hh with probability at least 1−δ1-\delta. This completes the proof of ??. ∎

We now analyze the runtime of the NTKSketch algorithm:

Proof of ??: There are three main components to the runtime of this procedure that we have to account for. The first is the time to apply the sketch Q1{\bm{Q}}^{1} to xx in line 4 of ??. By ??, the runtime of computing Q1⋅x{\bm{Q}}^{1}\cdot x is O(L6ε4⋅log⁡3Lεδ+L3ε2⋅log⁡Lεδ⋅nnz(x))\mathcal{O}\left(\frac{L^{6}}{\varepsilon^{4}}\cdot\log^{3}\frac{L}{\varepsilon\delta}+\frac{L^{3}}{\varepsilon^{2}}\cdot\log\frac{L}{\varepsilon\delta}\cdot{\rm nnz}(x)\right). The second heavy operation corresponds to computing vectors Zj(h)(x)=Q2p+2⋅([ϕ(h−1)(x)]⊗j⊗e1⊗2p+2−j)Z_{j}^{(h)}(x)={\bm{Q}}^{2p+2}\cdot\left(\left[\phi^{(h-1)}(x)\right]^{\otimes j}\otimes{e}_{1}^{\otimes 2p+2-j}\right) for j=0,1,2,…2p+2j=0,1,2,\ldots 2p+2 and h=1,2,…Lh=1,2,\ldots L in ??. By ??, the time to compute Zj(h)(x)Z_{j}^{(h)}(x) for a fixed hh and all j=0,1,2,…2p+2j=0,1,2,\ldots 2p+2 is bounded by,

The total time to compute vectors Zj(h)(x)Z_{j}^{(h)}(x) for all h=1,2,…Lh=1,2,\ldots L and all j=0,1,2,…2p+2j=0,1,2,\ldots 2p+2 is thus O(L11ε6.7⋅log⁡3Lεδ)\mathcal{O}\left(\frac{L^{11}}{\varepsilon^{6.7}}\cdot\log^{3}\frac{L}{\varepsilon\delta}\right). Finally, the last computationally expensive operation is computing vectors Yj(h)(x)=Q2p′+1⋅([ϕ(h−1)(x)]⊗j⊗e1⊗2p′+1−j)Y_{j}^{(h)}(x)={\bm{Q}}^{2p^{\prime}+1}\cdot\left(\left[\phi^{(h-1)}(x)\right]^{\otimes j}\otimes{e}_{1}^{\otimes 2p^{\prime}+1-j}\right) for j=0,1,2,…2p′+1j=0,1,2,\ldots 2p^{\prime}+1 and h=1,2,…Lh=1,2,\ldots L in ??. By ??, the runtime of computing Yj(h)(x)Y_{j}^{(h)}(x) for a fixed hh and all j=0,1,2,…2p′+1j=0,1,2,\ldots 2p^{\prime}+1 is bounded by,

Hence, the total time to compute vectors Yj(h)(x)Y_{j}^{(h)}(x) for all h=1,2,…Lh=1,2,\ldots L and all j=0,1,2,…2p′+1j=0,1,2,\ldots 2p^{\prime}+1 is O(L9ε6⋅log⁡3Lεδ)\mathcal{O}\left(\frac{L^{9}}{\varepsilon^{6}}\cdot\log^{3}\frac{L}{\varepsilon\delta}\right). The total runtime of the NTK Sketch is obtained by summing up these three contributions. This completes the proof of ??. ∎

Now we are ready to prove the main theorem on NTKSketch. See 1

Because G{\bm{G}} is a matrix of i.i.d normal entries with s∗=C⋅1ε2⋅log⁡1δs^{*}=C\cdot\frac{1}{\varepsilon^{2}}\cdot\log\frac{1}{\delta} rows, for a large enough constant CC, G{\bm{G}} is a JL transform and hence Ψntk(L)\Psi_{\tt ntk}^{(L)} satisfies the following,

where A:=∥y∥2∥z∥2∥ψ(L)(y)∥2∥ψ(L)(z)∥2A:={\|y\|_{2}}{\|z\|_{2}}\left\|\psi^{(L)}({y})\right\|_{2}\left\|\psi^{(L)}({z})\right\|_{2}. By ?? and using the fact that Krelu(L)(1)=L+1K_{\tt relu}^{(L)}(1)=L+1, the following bounds hold with probability at least 1−O(δ)1-\mathcal{O}(\delta):

Additionally, by ??, the following holds with probability at least 1−O(δ)1-\mathcal{O}(\delta):

Hence by union bound and triangle inequality we have,

Now note that by ??, ∥y∥2∥z∥2⋅Krelu(L)(⟨y,z⟩∥y∥2∥z∥2)=Θntk(L)(y,z){\|y\|_{2}}{\|z\|_{2}}\cdot K_{\tt relu}^{(L)}\left(\frac{\langle y,z\rangle}{\|y\|_{2}\|z\|_{2}}\right)=\Theta_{\tt ntk}^{(L)}(y,z), and also note that for every L≥2L\geq 2 and any α∈\alpha\in, Krelu(L)(α)≥(L+1)/9K_{\tt relu}^{(L)}\left(\alpha\right)\geq(L+1)/9, therefore,

Remark on the fact that Krelu(L)(α)≥(L+1)/9K_{\tt relu}^{(L)}\left(\alpha\right)\geq(L+1)/9 for every L≥2L\geq 2 and any α∈\alpha\in. Note that from the definition of Σrelu(h)\Sigma_{\tt relu}^{(h)} in ??, we have that for any α∈\alpha\in: Σrelu(0)(α)≥−1\Sigma_{\tt relu}^{(0)}(\alpha)\geq-1, Σrelu(1)(α)≥0\Sigma_{\tt relu}^{(1)}(\alpha)\geq 0, Σrelu(2)(α)≥1π\Sigma_{\tt relu}^{(2)}(\alpha)\geq\frac{1}{\pi}, and Σrelu(h)(α)≥12\Sigma_{\tt relu}^{(h)}(\alpha)\geq\frac{1}{2} for every h≥3h\geq 3 because κ1(⋅)\kappa_{1}(\cdot) is a monotonically increasing function on the interval $.Moreover,usingthedefinitionof. Moreover, using the definition of\dot{\Sigma}_{\tt relu}^{(h)}in??,wehavethatforanyin ??, we have that for any\alpha\in::\dot{\Sigma}_{\tt relu}^{(1)}(\alpha)\geq 0,,\dot{\Sigma}_{\tt relu}^{(2)}(\alpha)\geq\frac{1}{2},and, and\dot{\Sigma}_{\tt relu}^{(h)}(\alpha)\geq\frac{3}{5}foreveryfor everyh\geq 3becausebecause\kappa_{0}(\cdot)isamonotonicallyincreasingfunctionontheintervalis a monotonically increasing function on the interval.Byaninduciveproofandusingthedefinitionof. By an inducive proof and using the definition ofK_{\tt relu}^{(L)}in??,wecanshowthatin ??, we can show thatK_{\tt relu}^{(L)}\left(\alpha\right)\geq(L+1)/9foreveryfor everyL\geq 2andanyand any\alpha\in$

Runtime analysis: By ??, runtime to compute the NTKSketch is

Appendix D NTK Random Features: Claims and Proofs

In this section we prove ??. We first restate the theorem: See 2

In the proof of this theorem we use the following results from the literature,

and note that Δ0=0\Delta_{0}=0. Recall that, by ?? and ??:

We use the recursive relation to approximate:

For notational simplicity, we define the following events:

Our proof is based on the following claims:

First we claim that, there exists a constant C1>0C_{1}>0 such that for any m1≥C1L6ε4log⁡(Lδ)m_{1}\geq C_{1}\frac{L^{6}}{\varepsilon^{4}}\log\left(\frac{L}{\delta}\right):

which directly follows by invoking ?? with (x,x′)∈{(y∥y∥2,z∥z∥2),(y∥y∥2,y∥y∥2),(z∥z∥2,z∥z∥2)}(x,x^{\prime})\in\left\{\left(\frac{y}{\|y\|_{2}},\frac{z}{\|z\|_{2}}\right),\left(\frac{y}{\|y\|_{2}},\frac{y}{\|y\|_{2}}\right),\left(\frac{z}{\|z\|_{2}},\frac{z}{\|z\|_{2}}\right)\right\} and setting ε1=ε2100L2\varepsilon_{1}=\frac{\varepsilon^{2}}{100L^{2}} and δ1=δ9L\delta_{1}=\frac{\delta}{9L} and applying union bound over choices of (x,x′)(x,x^{\prime}).

Our second claim is that there exists a constant C0>0C_{0}>0 such that if m0≥C0L2ε2log⁡(Lδ)m_{0}\geq C_{0}\frac{L^{2}}{\varepsilon^{2}}\log\left(\frac{L}{\delta}\right) then

The above statement is a direct consequence of invoking ?? with (x,x′)∈{(y∥y∥2,z∥z∥2),(y∥y∥2,y∥y∥2),(z∥z∥2,z∥z∥2)}(x,x^{\prime})\in\left\{\left(\frac{y}{\|y\|_{2}},\frac{z}{\|z\|_{2}}\right),\left(\frac{y}{\|y\|_{2}},\frac{y}{\|y\|_{2}}\right),\left(\frac{z}{\|z\|_{2}},\frac{z}{\|z\|_{2}}\right)\right\} and union bounding over choices of (x,x′)(x,x^{\prime}). In ??, we choose ε2=ε10L,δ2=δ9L\varepsilon_{2}=\frac{\varepsilon}{10L},\delta_{2}=\frac{\delta}{9L} and m0≥3200L2ε2log⁡(54Lδ)m_{0}\geq\frac{3200L^{2}}{\varepsilon^{2}}\log\left(\frac{54L}{\delta}\right) for ε,δ∈(0,1)\varepsilon,\delta\in(0,1) to obtain ?? by union bound.

If the events in ??, ?? and ?? hold, then

When L≥2L\geq 2, we showed in the proof of ?? that Krelu(L)(⋅)≥L+19K_{\tt relu}^{(L)}(\cdot)\geq\frac{L+1}{9}, therefore,

Since Ψrf(L)(x)=∥x∥2⋅ψ(L)(x){\Psi}_{\tt rf}^{(L)}(x)=\|x\|_{2}\cdot{\psi}^{(L)}(x) and Ψrf(L)(x′)=∥x′∥2⋅ψ(L)(x′){\Psi}_{\tt rf}^{(L)}(x^{\prime})=\|x^{\prime}\|_{2}\cdot{\psi}^{(L)}(x^{\prime}), this implies that,

D.2 Proof of Auxiliary Claims

See 1 Proof of ??: The proof is based on ?? that provides an upper bound on variance of the PolySketch. By using the definition of f(x),f(x′)f(x),f(x^{\prime}) and ??, with probability at least 1−δ9L1-\frac{\delta}{9L}, we have

Union bounding over the choices of (x,x′)(x,x^{\prime}) completes the proof of ??. ∎

Furthermore, the assumption that ?? holds, implies that,

For the third part in ??, we observe that

Appendix E Spectral Approximation via Leverage Scores Sampling

The proofs here rely on Theorem 3.3 in which states spectral approximation bounds of random features for general kernels equipped with the leverage score sampling. This result is a generalization of on the Random Fourier Features.

If m≥83ε−2sτ~log⁡(16sλ/δ)m\geq\frac{8}{3}\varepsilon^{-2}s_{\widetilde{\tau}}\log\left(16s_{\lambda}/\delta\right) then

holds with probability at least 1−δ1-\delta.

We now ready to provide spectral approximation guarantee for arc-cosine kernels of order zero.

In order to utilize ??, we need an upper bound of τλ(w)\tau_{\lambda}(w) as below:

E.2 First Order Arc-Cosine Kernels

Now note that by definition of K1{\bm{K}}_{1}, we have [K1]i,j=∥xi∥2∥xj∥2⋅κ1(⟨xi,xj⟩∥xi∥2∥xj∥2)[{\bm{K}}_{1}]_{i,j}=\|x_{i}\|_{2}\|x_{j}\|_{2}\cdot\kappa_{1}\left(\frac{\langle x_{i},x_{j}\rangle}{\|x_{i}\|_{2}\|x_{j}\|_{2}}\right). Therefore, using the Taylor expansion of the function κ1(α)=1π+α2+1π⋅∑i=0∞(2i)!22i⋅(i!)2⋅(2i+1)⋅(2i+2)⋅α2i+2\kappa_{1}(\alpha)=\frac{1}{\pi}+\frac{\alpha}{2}+\frac{1}{\pi}\cdot\sum_{i=0}^{\infty}\frac{(2i)!}{2^{2i}\cdot(i!)^{2}\cdot(2i+1)\cdot(2i+2)}\cdot\alpha^{2i+2} and the fact that its Taylor coefficients are all non-negative, we have,

Using the above inequality along with ??, we can write,

To obtain an upper bound of the third term in ??, we consider the singular value decomposition of X=VΣU⊤{\bm{X}}={\bm{V}}\bm{\Sigma}{\bm{U}}^{\top}. And we have

Therefore, plugging this into ?? and ?? gives,

and recall that the modified random features are defined as

Putting all together into ??, we derive the result. This completes the proof of ??. ∎

E.3 Proof of ??

Our proof relies on spectral approximation bounds of PolySketch given in the fourth part of ??.

Proof of ??: Note that the NTK of two-layer ReLU network can be formulated as

where K0{\bm{K}}_{0} and K1{\bm{K}}_{1} are the arc-cosine kernel matrices of order and 11 with dataset X{\bm{X}}, respectively.

Let Φ0\bm{\Phi}_{0} and Φ1\bm{\Phi}_{1} be the random features of K0{\bm{K}}_{0} and K1{\bm{K}}_{1}, defined as per ?? and ??, respectively. Also let Ψrf\bm{\Psi}_{\tt rf} be the feature matrix that ?? outputs, that is each column of this matrix is obtained by applying this algorithm on the dataset X{\bm{X}}. By basic properties of tensor products we have,

Our proof is a combination of spectral analysis of Φ0⊤Φ0,Φ1⊤Φ1\bm{\Phi}_{0}^{\top}\bm{\Phi}_{0},\bm{\Phi}_{1}^{\top}\bm{\Phi}_{1} and (Q2(Φ0⊗X))⊤⋅Q2(Φ0⊗X)\left({\bm{Q}}^{2}\left(\bm{\Phi}_{0}\otimes{\bm{X}}\right)\right)^{\top}\cdot{\bm{Q}}^{2}\left(\bm{\Phi}_{0}\otimes{\bm{X}}\right) which are stated in ??, ?? and ??, respectively.

From ??, if m0≥48nλε2log⁡(48sλδ)m_{0}\geq 48\frac{n}{\lambda\varepsilon^{2}}\log\left(\frac{48s_{\lambda}}{\delta}\right) then with probability at least 1−δ31-\frac{\delta}{3} it holds that,

Now we bound the trace of (Φ0⊗X)⊤⋅(Φ0⊗X)=Φ0⊤Φ0⊙X⊤X\left(\bm{\Phi}_{0}\otimes{\bm{X}}\right)^{\top}\cdot\left(\bm{\Phi}_{0}\otimes{\bm{X}}\right)=\bm{\Phi}_{0}^{\top}\bm{\Phi}_{0}\odot{\bm{X}}^{\top}{\bm{X}}:

To guarantee spectral approximation of (Q2(Φ0⊗X))⊤⋅Q2(Φ0⊗X)\left({\bm{Q}}^{2}\left(\bm{\Phi}_{0}\otimes{\bm{X}}\right)\right)^{\top}\cdot{\bm{Q}}^{2}\left(\bm{\Phi}_{0}\otimes{\bm{X}}\right), we will use the result of ??. Using ?? along with ?? and the fact that ms≥Cε2⋅n1+λlog⁡3nεδm_{s}\geq\frac{C}{\varepsilon^{2}}\cdot\frac{n}{1+\lambda}\log^{3}\frac{n}{\varepsilon\delta} for some constant CC, and union bound, with probability at least 1−δ21-\frac{\delta}{2}, we have

where the inequality in second line follows from ?? and the fourth line follows from the assumption ∥X(:,i)∥2≤1\left\|{\bm{X}}_{(:,i)}\right\|_{2}\leq 1 for all i∈[n]i\in[n] which leads that I⊙(X⊤X)⪯I{\bm{I}}\odot({\bm{X}}^{\top}{\bm{X}})\preceq{\bm{I}}. The last inequality holds since ε∈(0,1/2)\varepsilon\in(0,1/2).

Similarly, we can obtain the following lower bound:

Furthermore, by taking a union bound over all events, ?? holds with probability at least 1−δ1-\delta. This completes the proof of ??. ∎

E.4 Auxiliary Lemmas

If A,B,C{\bm{A}},{\bm{B}},{\bm{C}} are positive semi-definite matrices of conforming sizes such that B⪯C{\bm{B}}\preceq{\bm{C}}, then,

Proof of ??: We want to show that for any vector vv, v⊤A⊙Bv⪯v⊤A⊙Cvv^{\top}{\bm{A}}\odot{\bm{B}}v\preceq v^{\top}{\bm{A}}\odot{\bm{C}}v. Because the matrices A,B,C{\bm{A}},{\bm{B}},{\bm{C}} are PSD, there exist matrices X,Y,Z{\bm{X}},{\bm{Y}},{\bm{Z}} of appropriate sizes such that we can decompose these matrices as follows,

Using this and basic properties of tensor products, we have the following for any vector vv,

Appendix F ReLU-CNTK: Expression and Main Properties

The final CNTK expressions is defined as:

Now we show how to recursively compute the ReLU-CNTK as follows,

For every positive integers q,Lq,L, the LL-layer CNTK for ReLU activation function and convolutional filter size of q×qq\times q is defined as follows

The final CNTK expressions for ReLU activation is:

In what follows we prove that the procedure in ?? precisely computes the CNTK kernel function corresponding to ReLU activation and additionally, we present useful corollaries and consequences of this fact.

To prove the inductive step, suppose that the inductive hypothesis Ni,j(h−1)(x)=Σi,j,i,j(h−2)(x,x)N^{(h-1)}_{i,j}(x)=\Sigma^{(h-2)}_{i,j,i,j}(x,x) holds for some h≥2h\geq 2. Now we show that conditioned on the inductive hypothesis, the inductive claim holds. By ??, we have,

Therefore, this proves that Ni,j(h)(x)≡Σi,j,i,j(h−1)(x,x)N^{(h)}_{i,j}(x)\equiv\Sigma^{(h-1)}_{i,j,i,j}(x,x) for every xx and every integer h≥1h\geq 1.

where the third line follows from ?? and fourth line follows because we have ⟨f,g⟩=Σi,j,i′,j′(h−1)(y,z)\langle f,g\rangle=\Sigma^{(h-1)}_{i,j,i^{\prime},j^{\prime}}(y,z). The fifth line above follows from ??. This proves the equivalence between the tensor covariance defined in ?? and the one defined in ?? of ??. Similarly, by using ??, we can prove the statement of the lemma about Γ˙i,j,i′,j′(h)(y,z)\dot{\Gamma}^{(h)}_{i,j,i^{\prime},j^{\prime}}(y,z) as follows,

We describe some of the basic properties of the function Γ(h)(y,z)\Gamma^{(h)}(y,z) defined in ?? in the following lemma,

Cauchy–Schwarz inequality: ∣Γi,j,i′,j′(h)(y,z)∣≤Ni,j(h)(y)⋅Ni′,j′(h)(z)q2\left|\Gamma_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z)\right|\leq\frac{\sqrt{N_{i,j}^{(h)}(y)\cdot N_{i^{\prime},j^{\prime}}^{(h)}(z)}}{q^{2}}.

Norm value: Γi,j,i,j(h)(y,y)=Ni,j(h)(y)q2≥0\Gamma_{i,j,i,j}^{(h)}(y,y)=\frac{N_{i,j}^{(h)}(y)}{q^{2}}\geq 0.

Proof of ??: We prove the lemma by induction on hh. The base of induction corresponds to h=0h=0. In the base case, by ?? and ?? and Cauchy–Schwarz inequality, we have

This proves the base for the first statement. Additionally we have, Γi,j,i,j(0)(y,y)=∑l=1cyi,j,l2=Ni,j(0)(y)q2≥0\Gamma_{i,j,i,j}^{(0)}(y,y)=\sum_{l=1}^{c}y_{i,j,l}^{2}=\frac{N^{(0)}_{i,j}(y)}{q^{2}}\geq 0 which proves the base for the second statement of the lemma. Now, in order to prove the inductive step, suppose that statements of the lemma hold for h−1h-1, where h≥1h\geq 1. Then, conditioned on this, we prove that the lemma holds for hh. First note that by conditioning on the inductive hypothesis, applying Cauchy–Schwarz inequality, and using the definition of N(h)N^{(h)} in ??, we can write

where the second line above follows because of the fact that κ1(⋅)\kappa_{1}(\cdot) is a monotonically increasing function. This completes the inductive step for the first statement of lemma. Now we prove the inductive step for the second statement as follows,

where we used ?? to conclude that ∑a=−q−12q−12∑b=−q−12q−12Γi+a,j+b,i+a,j+b(h−1)(y,y)=Ni,j(h)(y)\sum_{a=-\frac{q-1}{2}}^{\frac{q-1}{2}}\sum_{b=-\frac{q-1}{2}}^{\frac{q-1}{2}}\Gamma^{(h-1)}_{i+a,j+b,i+a,j+b}(y,y)=N^{(h)}_{i,j}(y) and then used the fact that Ni,j(h)(y)N^{(h)}_{i,j}(y) is non-negative. This completes the inductive proof of the lemma. This completes the proof of ??. ∎

We also describe some of the main properties of the function Γ˙(h)(y,z)\dot{\Gamma}^{(h)}(y,z) defined in ?? in the following lemma,

Cauchy–Schwarz inequality: ∣Γ˙i,j,i′,j′(h)(y,z)∣≤1q2\left|\dot{\Gamma}_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z)\right|\leq\frac{1}{q^{2}}.

Norm value: Γ˙i,j,i,j(h)(y,y)=1q2≥0\dot{\Gamma}_{i,j,i,j}^{(h)}(y,y)=\frac{1}{q^{2}}\geq 0.

Proof of ??: First, note that by ?? and the definition of N(h)N^{(h)} in ?? we have,

We also need to use some properties of Π(h)(y,z)\Pi^{(h)}(y,z) defined in ?? and ??. We present these propertied in the next lemma,

Cauchy–Schwarz inequality: Πi,j,i′,j′(h)(y,z)≤Πi,j,i,j(h)(y,y)⋅Πi′,j′,i′,j′(h)(z,z)\Pi_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z)\leq\sqrt{\Pi_{i,j,i,j}^{(h)}(y,y)\cdot\Pi_{i^{\prime},j^{\prime},i^{\prime},j^{\prime}}^{(h)}(z,z)}.

Norm value: Πi,j,i,j(h)(y,y)={h⋅Ni,j(h+1)(y)if h<LL−1q2⋅Ni,j(L)(y)if h=L\Pi_{i,j,i,j}^{(h)}(y,y)=\begin{cases}h\cdot N_{i,j}^{(h+1)}(y)&\text{if }h<L\\ \frac{L-1}{q^{2}}\cdot N_{i,j}^{(L)}(y)&\text{if }h=L\end{cases}.

Proof of ??: The proof is by induction on hh. The base of induction corresponds to h=0h=0. By definition of Πi,j,i,j(0)≡0\Pi_{i,j,i,j}^{(0)}\equiv 0 in ??, the base of induction for both statements of the lemma follow immediately.

Now we prove the inductive hypothesis. Suppose that the lemma statement holds for h−1h-1. We prove that conditioned on this, the statements of the lemma hold for hh. There are two cases. The first case corresponds to h<Lh<L. In this case, by definition of Πi,j,i,j(h)(x,x)\Pi_{i,j,i,j}^{(h)}(x,x) in ?? and using ?? and ?? we can write,

where the second line above follows from inductive hypothesis along with ?? and ??. The third and fourth lines above follow by Cauchy–Schwarz inequality. The second case corresponds to h=Lh=L. In this case, by definition of Πi,j,i′,j′(L)(y,z)\Pi_{i,j,i^{\prime},j^{\prime}}^{(L)}(y,z) in ?? and using ?? and ?? along with the inductive hypothesis we can write,

where the second line above follows from inductive hypothesis along with ??. This completes the inductive step and in turn proves the first statement of the lemma.

To prove the inductive step for the second statement of lemma we consider two cases again. The first case is h<Lh<L. In this case, note that by using inductive hypothesis together with ?? and ?? we can write,

where the last line above follows from definition of N(h)N^{(h)} in ??. The second case corresponds to h=Lh=L. In this case, by inductive hypothesis together with ?? and ?? we can write,

This completes the inductive step for the second statement and in turn proves the second statement of the lemma. This completes the proof of ??. ∎

Appendix G CNTK Sketch: Algorithm, Claims and Invariants

In this section we give our sketching algorithm for the CNTK kernel and prove our main theorem for this algorithm, i.e., ??. We start by introducing our CNTKSketch algorithm in the following definition:

Let s=O~(L2ε2)s=\widetilde{\mathcal{O}}\left(\frac{L^{2}}{\varepsilon^{2}}\right), r=O~(L6ε4)r=\widetilde{\mathcal{O}}\left(\frac{L^{6}}{\varepsilon^{4}}\right), n1=O~(L4ε4)n_{1}=\widetilde{\mathcal{O}}\left(\frac{L^{4}}{\varepsilon^{4}}\right), m=O~(L8ε16/3)m=\widetilde{\mathcal{O}}\left(\frac{L^{8}}{\varepsilon^{16/3}}\right), and s∗=O(1ε2log⁡1δ)s^{*}=\mathcal{O}(\frac{1}{\varepsilon^{2}}\log\frac{1}{\delta}) and Prelu(p)(α)=∑l=02p+2cl⋅αlP^{(p)}_{\tt relu}(\alpha)=\sum_{l=0}^{2p+2}c_{l}\cdot\alpha^{l} and P˙relu(p′)(α)=∑l=02p′+1bl⋅αl\dot{P}^{(p^{\prime})}_{\tt relu}(\alpha)=\sum_{l=0}^{2p^{\prime}+1}b_{l}\cdot\alpha^{l} be the polynomials defined in ??.

For every i∈[d1]i\in[d_{1}], j∈[d2]j\in[d_{2}], and h=0,1,2,…Lh=0,1,2,\ldots L compute Ni,j(h)(x)N_{i,j}^{(h)}(x) as per ?? of ??.

In the following lemma, we analyze the correctness of the CNTKSketch algorithm by giving the invariants that the algorithm maintains at all times,

The mapping ϕi,j(h)(⋅)\phi_{i,j}^{(h)}(\cdot) computed by the CNTK Sketch algorithm in ?? and ?? of ?? satisfy the following,

The mapping ψi,j(h)(⋅)\psi_{i,j}^{(h)}(\cdot) computed by the CNTK Sketch algorithm in ?? and ?? of ?? satisfy the following,

Proof of ??: The proof is by induction on the value of h=0,1,2,…Lh=0,1,2,\ldots L. More formally, consider the following statements for every h=0,1,2,…Lh=0,1,2,\ldots L:

Simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

Simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

We prove that probabilities Pr⁡[P1(0)]\Pr[P_{1}(0)] and Pr⁡[P2(0)∣P1(0)]\Pr[P_{2}(0)|P_{1}(0)] are both greater than 1−O(δ/L)1-\mathcal{O}(\delta/L). Additionally, for every h=1,2,…Lh=1,2,\ldots L, we prove that the conditional probabilities Pr⁡[P1(h)∣P1(h−1)]\Pr[P_{1}(h)|P_{1}(h-1)] and Pr⁡[P2(h)∣P2(h−1),P1(h),P1(h−1)]\Pr[P_{2}(h)|P_{2}(h-1),P_{1}(h),P_{1}(h-1)] are greater than 1−O(δ/L)1-\mathcal{O}(\delta/L).

The base of induction corresponds to h=0h=0. By ??, ϕi,j(0)(y)=S⋅y(i,j,:)\phi_{i,j}^{(0)}(y)={\bm{S}}\cdot y_{(i,j,:)} and ϕi′,j′(0)(z)=S⋅z(i′,j′,:)\phi_{i^{\prime},j^{\prime}}^{(0)}(z)={\bm{S}}\cdot z_{(i^{\prime},j^{\prime},:)}, thus, ?? implies the following

Similarly, we can prove that with probability at least 1−O(δd12d22L)1-\mathcal{O}\left(\frac{\delta}{d_{1}^{2}d_{2}^{2}L}\right), the following hold

By union bounding over all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}], this proves the base of induction for statement P1(h)P_{1}(h), i.e., Pr⁡[P1(0)]≥1−O(δ/L)\Pr[P_{1}(0)]\geq 1-\mathcal{O}(\delta/L).

Moreover, by ??, we have that ψi,j(0)(y)=0\psi_{i,j}^{(0)}(y)=0 and ψi′,j′(0)(z)=0\psi_{i^{\prime},j^{\prime}}^{(0)}(z)=0, thus, by ??, it trivially holds that Pr⁡[P2(0)∣P1(0)]=1≥1−O(δ/L)\Pr[P_{2}(0)|P_{1}(0)]=1\geq 1-\mathcal{O}(\delta/L). This completes the base of induction.

Now, we proceed to prove the inductive step. That is, by assuming the inductive hypothesis for h−1h-1, we prove that statements P1(h)P_{1}(h) and P2(h)P_{2}(h) hold. More precisely, first we condition on the statement P1(h−1)P_{1}(h-1) being true for some h≥1h\geq 1, and then prove that P1(h)P_{1}(h) holds with probability at least 1−O(δ/L)1-\mathcal{O}(\delta/L). Next we show that conditioned on statements P2(h−1),P1(h),P1(h−1)P_{2}(h-1),P_{1}(h),P_{1}(h-1) being true, P2(h)P_{2}(h) holds with probability at least 1−O(δ/L)1-\mathcal{O}(\delta/L). This will complete the induction.

First, note that by ??, union bound, and using ??, the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

where A:=Ni,j(h)(y)Ni′,j′(h)(z)q2⋅∑l=02p+2cl∥[Zi,j(h)(y)]l∥22⋅∑l=02p+2cl∥[Zi′,j′(h)(z)]l∥22A:=\frac{\sqrt{N^{(h)}_{i,j}(y)N^{(h)}_{i^{\prime},j^{\prime}}(z)}}{q^{2}}\cdot\sqrt{\sum_{l=0}^{2p+2}c_{l}\left\|\left[Z^{(h)}_{i,j}(y)\right]_{l}\right\|_{2}^{2}}\cdot\sqrt{\sum_{l=0}^{2p+2}c_{l}\left\|\left[Z^{(h)}_{i^{\prime},j^{\prime}}(z)\right]_{l}\right\|_{2}^{2}} and the collection of vectors {[Zi,j(h)(y)]l}l=02p+2\left\{\left[Z^{(h)}_{i,j}(y)\right]_{l}\right\}_{l=0}^{2p+2} and {[Zi′,j′(h)(z)]l}l=02p+2\left\{\left[Z^{(h)}_{i^{\prime},j^{\prime}}(z)\right]_{l}\right\}_{l=0}^{2p+2} and coefficients c0,c1,c2,…c2p+2c_{0},c_{1},c_{2},\ldots c_{2p+2} are defined as per ?? and ??, respectively. Additionally, by ?? and union bound, the following inequalities hold, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), simultaneously for all l=0,1,2,…2p+2l=0,1,2,\ldots 2p+2, all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

Therefore, by plugging ?? back to ?? and using union bound and triangle inequality as well as Cauchy–Schwarz inequality, we find that with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}]

where B:=Ni,j(h)(y)Ni′,j′(h)(z)q2⋅Prelu(p)(∥μi,j(h)(y)∥22)⋅Prelu(p)(∥μi′,j′(h)(z)∥22)B:=\frac{\sqrt{N^{(h)}_{i,j}(y)N^{(h)}_{i^{\prime},j^{\prime}}(z)}}{q^{2}}\cdot\sqrt{P^{(p)}_{\tt relu}\left(\|\mu^{(h)}_{i,j}(y)\|_{2}^{2}\right)\cdot P^{(p)}_{\tt relu}\left(\|\mu^{(h)}_{i^{\prime},j^{\prime}}(z)\|_{2}^{2}\right)} and Prelu(p)(α)=∑l=02p+2cl⋅αlP^{(p)}_{\tt relu}(\alpha)=\sum_{l=0}^{2p+2}c_{l}\cdot\alpha^{l} is the polynomial defined in ??. By using the definition of μi,j(h)(⋅)\mu_{i,j}^{(h)}(\cdot) in ?? we have,

Hence, by conditioning on the inductive hypothesis P1(h−1)P_{1}(h-1) and using ?? and ?? we have,

Therefore, by invoking ??, it follows that ∣Prelu(p)(∥μi,j(h)(y)∥22)−Prelu(p)(1)∣≤h⋅ε260L3\left|P_{\tt relu}^{(p)}\left(\|\mu^{(h)}_{i,j}(y)\|_{2}^{2}\right)-P_{\tt relu}^{(p)}(1)\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}} and ∣Prelu(p)(∥μi′,j′(h)(z)∥22)−Prelu(p)(1)∣≤h⋅ε260L3\left|P_{\tt relu}^{(p)}\left(\|\mu^{(h)}_{i^{\prime},j^{\prime}}(z)\|_{2}^{2}\right)-P_{\tt relu}^{(p)}(1)\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}}. Consequently, because Prelu(p)(1)≤Prelu(+∞)(1)=1P_{\tt relu}^{(p)}(1)\leq P_{\tt relu}^{(+\infty)}(1)=1, we find that

For shorthand we use the notation β:=Ni,j(h)(y)Ni′,j′(h)(z)q2\beta:=\frac{\sqrt{N^{(h)}_{i,j}(y)N^{(h)}_{i^{\prime},j^{\prime}}(z)}}{q^{2}}. By plugging this into ?? and using the notation β\beta, we find that the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

Furthermore, by conditioning on the inductive hypothesis P1(h−1)P_{1}(h-1) and combining it with ?? and applying Cauchy–Schwarz inequality and invoking ?? we find that,

For shorthand, we use the notation γ:=∑a=−q−12q−12∑b=−q−12q−12Γi+a,j+b,i′+a,j′+b(h−1)(y,z)Ni,j(h)(y)⋅Ni′,j′(h)(z)\gamma:=\frac{\sum_{a=-\frac{q-1}{2}}^{\frac{q-1}{2}}\sum_{b=-\frac{q-1}{2}}^{\frac{q-1}{2}}\Gamma_{i+a,j+b,i^{\prime}+a,j^{\prime}+b}^{(h-1)}\left(y,z\right)}{\sqrt{N^{(h)}_{i,j}(y)\cdot N^{(h)}_{i^{\prime},j^{\prime}}(z)}}. Note that by ?? and ??, −1≤γ≤1-1\leq\gamma\leq 1. Hence, we can invoke ?? and use ?? to find that,

By incorporating the above inequality into ?? using triangle inequality we find that, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

Additionally, since −1≤γ≤1-1\leq\gamma\leq 1, we can invoke ?? and use the fact that p=⌈2L2/ε4/3⌉p=\left\lceil 2L^{2}/{\varepsilon}^{4/3}\right\rceil to conclude,

By combining the above inequality with ?? via triangle inequality and using the fact that, by ??, β⋅κ1(γ)≡Γi,j,i′,j′(h)(y,z)\beta\cdot\kappa_{1}(\gamma)\equiv\Gamma_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z) we get the following inequality, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

Similarly, we can prove that with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right) the following hold, simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}],

This is sufficient to prove the inductive step for statement P1(h)P_{1}(h), i.e., Pr⁡[P1(h)∣P1(h−1)]≥1−O(δ/L)\Pr[P_{1}(h)|P_{1}(h-1)]\geq 1-\mathcal{O}(\delta/L).

Now we prove the inductive step for statement P2(h)P_{2}(h). That is, we prove that conditioned on P2(h−1),P1(h)P_{2}(h-1),P_{1}(h), and P1(h−1)P_{1}(h-1), P2(h)P_{2}(h) holds with probability at least 1−O(δ/L)1-\mathcal{O}(\delta/L). First, note that by ?? and using ?? and union bound, we have the following simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-O\left(\frac{\delta}{L}\right),

where A^:=1q2⋅∑l=02p′+1bl∥[Yi,j(h)(y)]l∥22⋅∑l=02p′+1bl∥[Yi′,j′(h)(z)]l∥22\widehat{A}:=\frac{1}{q^{2}}\cdot\sqrt{\sum_{l=0}^{2p^{\prime}+1}b_{l}\left\|\left[Y^{(h)}_{i,j}(y)\right]_{l}\right\|_{2}^{2}}\cdot\sqrt{\sum_{l=0}^{2p^{\prime}+1}b_{l}\left\|\left[Y^{(h)}_{i^{\prime},j^{\prime}}(z)\right]_{l}\right\|_{2}^{2}} and the collection of vectors {[Yi,j(h)(y)]l}l=02p′+1\left\{\left[Y^{(h)}_{i,j}(y)\right]_{l}\right\}_{l=0}^{2p^{\prime}+1} and {[Yi′,j′(h)(z)]l}l=02p′+1\left\{\left[Y^{(h)}_{i^{\prime},j^{\prime}}(z)\right]_{l}\right\}_{l=0}^{2p^{\prime}+1} and coefficients b0,b1,b2,…b2p′+1b_{0},b_{1},b_{2},\ldots b_{2p^{\prime}+1} are defined as per ?? and ??, respectively. By ?? and union bound, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following inequalities hold true simultaneously for all l∈{0,1,2,…2p′+1}l\in\{0,1,2,\ldots 2p^{\prime}+1\}, all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}],

Therefore, by plugging ?? into ?? and using union bound and triangle inequality as well as Cauchy–Schwarz inequality, we find that with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}]

where B^:=1q2⋅P˙relu(p′)(∥μi,j(h)(y)∥22)⋅P˙relu(p′)(∥μi′,j′(h)(z)∥22)\widehat{B}:=\frac{1}{q^{2}}\cdot\sqrt{\dot{P}^{(p^{\prime})}_{\tt relu}\left(\|\mu_{i,j}^{(h)}(y)\|_{2}^{2}\right)\cdot\dot{P}^{(p^{\prime})}_{\tt relu}\left(\|\mu_{i^{\prime},j^{\prime}}^{(h)}(z)\|_{2}^{2}\right)} and P˙relu(p)(α)=∑l=02p′+1bl⋅αl\dot{P}^{(p)}_{\tt relu}(\alpha)=\sum_{l=0}^{2p^{\prime}+1}b_{l}\cdot\alpha^{l} is the polynomial defined in ??. By conditioning on the inductive hypothesis P1(h−1)P_{1}(h-1) and using ?? and ?? we have ∣∥μi,j(h)(y)∥22−1∣≤h⋅ε260L3\left|\left\|\mu_{i,j}^{(h)}(y)\right\|_{2}^{2}-1\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}} and ∣∥μi′,j′(h)(z)∥22−1∣≤h⋅ε260L3\left|\left\|\mu_{i^{\prime},j^{\prime}}^{(h)}(z)\right\|_{2}^{2}-1\right|\leq h\cdot\frac{\varepsilon^{2}}{60L^{3}}. Therefore, using the fact that p′=⌈9L2/ε2⌉p^{\prime}=\left\lceil 9L^{2}/\varepsilon^{2}\right\rceil and by invoking ??, it follows that ∣P˙relu(p′)(∥μi,j(h)(y)∥22)−P˙relu(p′)(1)∣≤h⋅ε20L2\left|\dot{P}_{\tt relu}^{(p^{\prime})}\left(\|\mu^{(h)}_{i,j}(y)\|_{2}^{2}\right)-\dot{P}_{\tt relu}^{(p^{\prime})}(1)\right|\leq\frac{h\cdot\varepsilon}{20L^{2}} and ∣P˙relu(p′)(∥μi′,j′(h)(z)∥22)−P˙relu(p′)(1)∣≤h⋅ε20L2\left|\dot{P}_{\tt relu}^{(p^{\prime})}\left(\|\mu^{(h)}_{i^{\prime},j^{\prime}}(z)\|_{2}^{2}\right)-\dot{P}_{\tt relu}^{(p^{\prime})}(1)\right|\leq\frac{h\cdot\varepsilon}{20L^{2}}. Consequently, because P˙relu(p′)(1)≤P˙relu(+∞)(1)=1\dot{P}_{\tt relu}^{(p^{\prime})}(1)\leq\dot{P}_{\tt relu}^{(+\infty)}(1)=1, we find that

By plugging this into ?? we get the following, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

Furthermore, recall the notation γ=∑a=−q−12q−12∑b=−q−12q−12Γi+a,j+b,i′+a,j′+b(h−1)(y,z)Ni,j(h)(y)⋅Ni′,j′(h)(z)\gamma=\frac{\sum_{a=-\frac{q-1}{2}}^{\frac{q-1}{2}}\sum_{b=-\frac{q-1}{2}}^{\frac{q-1}{2}}\Gamma_{i+a,j+b,i^{\prime}+a,j^{\prime}+b}^{(h-1)}\left(y,z\right)}{\sqrt{N^{(h)}_{i,j}(y)\cdot N^{(h)}_{i^{\prime},j^{\prime}}(z)}} and note that by ?? and ??, −1≤γ≤1-1\leq\gamma\leq 1. Hence, we can invoke ?? and use the fact that p′=⌈9L2/ε2⌉p^{\prime}=\lceil 9L^{2}/\varepsilon^{2}\rceil to find that ?? implies the following,

By incorporating the above inequality into ?? using triangle inequality, we find that, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

Since −1≤γ≤1-1\leq\gamma\leq 1, we can invoke ?? and use the fact that p′=⌈9L2/ε2⌉p^{\prime}=\left\lceil 9L^{2}/{\varepsilon}^{2}\right\rceil to conclude,

By combining above inequality with ?? via triangle inequality and using the fact that, by ??, 1q2⋅κ0(γ)≡Γ˙i,j,i′,j′(h)(y,z)\frac{1}{q^{2}}\cdot\kappa_{0}(\gamma)\equiv\dot{\Gamma}_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z) we get the following bound simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right):

Similarly we can prove that with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following hold simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}],

We will use ?? and ?? to prove the inductive step for P2(h)P_{2}(h).

Next, we consider two cases for the value of hh. When h<Lh<L, the vectors ψi,j(h)(y),ψi′,j′(h)(z)\psi_{i,j}^{(h)}(y),\psi_{i^{\prime},j^{\prime}}^{(h)}(z) are defined in ?? and when h=Lh=L, these vectors are defined differently in ??. First we consider the case of h<Lh<L. Note that in this case, if we let ηi,j(h)(y)\eta_{i,j}^{(h)}(y) and ηi′,j′(h)(z)\eta_{i^{\prime},j^{\prime}}^{(h)}(z) be the vectors defined in ??, then by ?? and union bound, the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right):

where D:=∑a=−q−12q−12∑b=−q−12q−12∥ηi+a,j+b(h)(y)∥22⋅∑a=−q−12q−12∑b=−q−12q−12∥ηi′+a,j′+b(h)(z)∥22D:=\sqrt{\sum_{a=-\frac{q-1}{2}}^{\frac{q-1}{2}}\sum_{b=-\frac{q-1}{2}}^{\frac{q-1}{2}}\|\eta_{i+a,j+b}^{(h)}(y)\|_{2}^{2}}\cdot\sqrt{\sum_{a=-\frac{q-1}{2}}^{\frac{q-1}{2}}\sum_{b=-\frac{q-1}{2}}^{\frac{q-1}{2}}\|\eta_{i^{\prime}+a,j^{\prime}+b}^{(h)}(z)\|_{2}^{2}}. Now, if we let fi,j:=ψi,j(h−1)(y)⊗ϕ˙i,j(h)(y)f_{i,j}:=\psi^{(h-1)}_{i,j}(y)\otimes\dot{\phi}_{i,j}^{(h)}(y) and gi′,j′:=ψi′,j′(h−1)(z)⊗ϕ˙i′,j′(h)(z)g_{i^{\prime},j^{\prime}}:=\psi^{(h-1)}_{i^{\prime},j^{\prime}}(z)\otimes\dot{\phi}_{i^{\prime},j^{\prime}}^{(h)}(z), then by ??, ηi,j(h)(y)=(Q2⋅fi,j)⊕ϕi,j(h)(y)\eta_{i,j}^{(h)}(y)=\left({\bm{Q}}^{2}\cdot f_{i,j}\right)\oplus\phi_{i,j}^{(h)}(y) and ηi′,j′(h)(z)=(Q2⋅gi′,j′)⊕ϕi′,j′(h)(z)\eta_{i^{\prime},j^{\prime}}^{(h)}(z)=\left({\bm{Q}}^{2}\cdot g_{i^{\prime},j^{\prime}}\right)\oplus\phi_{i^{\prime},j^{\prime}}^{(h)}(z). Thus by ?? and union bound, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), we have the following inequalities simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

Therefore, if we condition on inductive hypotheses P1(h)P_{1}(h) and P2(h−1)P_{2}(h-1), then by using ??, ??, the inequality ?? and ?? along with the fact that ∥fi,j∥22=∥ψi,j(h−1)(y)∥22⋅∥ϕ˙i,j(h)(y)∥22\|f_{i,j}\|_{2}^{2}=\|\psi^{(h-1)}_{i,j}(y)\|_{2}^{2}\cdot\|\dot{\phi}_{i,j}^{(h)}(y)\|_{2}^{2}, we have:

where the fourth line above follows from the inductive hypothesis P2(h−1)P_{2}(h-1) along with ?? and ?? and ??. The last line above follows from ?? and ??. Similarly we can prove, ∑a=−q−12q−12∑b=−q−12q−12∥ηi′+a,j′+b(h)(z)∥22≤1210⋅h⋅Ni′,j′(h+1)(z)\sum_{a=-\frac{q-1}{2}}^{\frac{q-1}{2}}\sum_{b=-\frac{q-1}{2}}^{\frac{q-1}{2}}\|\eta_{i^{\prime}+a,j^{\prime}+b}^{(h)}(z)\|_{2}^{2}\leq\frac{12}{10}\cdot h\cdot N^{(h+1)}_{i^{\prime},j^{\prime}}(z), thus conditioned on P2(h−1),P1(h),P1(h−1)P_{2}(h-1),P_{1}(h),P_{1}(h-1), with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right):

By incorporating this into ?? it follows that if we condition on P2(h−1),P1(h),P1(h−1)P_{2}(h-1),P_{1}(h),P_{1}(h-1), then, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}],

Now we bound the term ∣<ηi,j(h)(y),ηi′,j′(h)(z)>−⟨fi,j,gi′,j′⟩−<ϕi,j(h)(y),ϕi′,j′(h)(z)>∣\left|\left<\eta^{(h)}_{i,j}(y),\eta^{(h)}_{i^{\prime},j^{\prime}}(z)\right>-\langle f_{i,j},g_{i^{\prime},j^{\prime}}\rangle-\left<\phi_{i,j}^{(h)}(y),\phi_{i^{\prime},j^{\prime}}^{(h)}(z)\right>\right| using ??, ??, and ?? along with inductive hypotheses P2(h−1)P_{2}(h-1) and ??. With probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right) the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

where the last line above follows from ?? together with the fact that Γ˙i,j,i,j(h)(y,y)=Γ˙i′,j′,i′,j′(h)(z,z)=1q2\dot{\Gamma}_{i,j,i,j}^{(h)}(y,y)=\dot{\Gamma}_{i^{\prime},j^{\prime},i^{\prime},j^{\prime}}^{(h)}(z,z)=\frac{1}{q^{2}}.

By combining the above with inductive hypotheses P1(h),P2(h−1)P_{1}(h),P_{2}(h-1) and ?? via triangle inequality and invoking ?? we get that the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

By plugging the above bound into ?? using triangle inequality and using ?? we get the following, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right):

Similarly, we can prove that with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right) the following hold simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and all j,j′∈[d2]j,j^{\prime}\in[d_{2}],

This is sufficient to prove the inductive step for statement P2(h)P_{2}(h), in the case of h<Lh<L, i.e., Pr⁡[P2(h)∣P2(h−1),P1(h),P1(h−1)]≥1−O(δ/L)\Pr[P_{2}(h)|P_{2}(h-1),P_{1}(h),P_{1}(h-1)]\geq 1-\mathcal{O}(\delta/L).

Now we prove the inductive step for P2(h)P_{2}(h) in the case of h=Lh=L. Similar to before, if we let fi,j:=ψi,j(L−1)(y)⊗ϕ˙i,j(L)(y)f_{i,j}:=\psi^{(L-1)}_{i,j}(y)\otimes\dot{\phi}_{i,j}^{(L)}(y) and gi′,j′:=ψi′,j′(L−1)(z)⊗ϕ˙i′,j′(L)(z)g_{i^{\prime},j^{\prime}}:=\psi^{(L-1)}_{i^{\prime},j^{\prime}}(z)\otimes\dot{\phi}_{i^{\prime},j^{\prime}}^{(L)}(z), then by ??, we have ψi,j(L)(y)=Q2⋅fi,j\psi_{i,j}^{(L)}(y)={\bm{Q}}^{2}\cdot f_{i,j} and ψi′,j′(L)(z)=Q2⋅gi′,j′\psi_{i^{\prime},j^{\prime}}^{(L)}(z)={\bm{Q}}^{2}\cdot g_{i^{\prime},j^{\prime}}. Thus by ?? and union bound, we find that, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following inequality holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}]:

Therefore, using ?? and ?? along with inductive hypotheses P2(L−1)P_{2}(L-1) and ??, with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right), the following holds simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}],

By combining the above with inductive hypotheses P1(L),P2(L−1)P_{1}(L),P_{2}(L-1) and ?? via triangle inequality and invoking ?? and also using the definition of Π(L)(y,z)\Pi^{(L)}(y,z) given in ??, we get that the following holds, simultaneously for all i,i′∈[d1]i,i^{\prime}\in[d_{1}] and j,j′∈[d2]j,j^{\prime}\in[d_{2}], with probability at least 1−O(δL)1-\mathcal{O}\left(\frac{\delta}{L}\right),

This proves the inductive step for statement P2(h)P_{2}(h), in the case of h=Lh=L, i.e., Pr⁡[P2(L)∣P2(L−1),P1(L),P1(L−1)]≥1−O(δ/L)\Pr[P_{2}(L)|P_{2}(L-1),P_{1}(L),P_{1}(L-1)]\geq 1-\mathcal{O}(\delta/L). The induction is complete and hence the statements of lemma are proved by union bounding over all h=0,1,2,…Lh=0,1,2,\ldots L. This completes the proof of ??. ∎

In the following lemma we analyze the runtime of the CNTK Sketch algorithm,

Proof of ??: First note that the total time to compute Ni,j(h)(x)N_{i,j}^{(h)}(x) for all i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}] and h=0,1,…Lh=0,1,\ldots L as per ?? is bounded by O(q2L⋅d1d2)\mathcal{O}\left(q^{2}L\cdot d_{1}d_{2}\right). Besides the time to compute Ni,j(h)(x)N_{i,j}^{(h)}(x), there are two other main components to the runtime of this procedure. The first heavy operation corresponds to computing vectors [Zi,j(h)(x)]l=Q2p+2⋅([μi,j(h)(x)]⊗l⊗e1⊗2p+2−l)\left[Z_{i,j}^{(h)}(x)\right]_{l}={\bm{Q}}^{2p+2}\cdot\left(\left[\mu_{i,j}^{(h)}(x)\right]^{\otimes l}\otimes{e}_{1}^{\otimes 2p+2-l}\right) for l=0,1,2,…2p+2l=0,1,2,\ldots 2p+2 and h=1,2,…Lh=1,2,\ldots L and all indices i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}], in ??. By ??, the time to compute [Zi,j(h)(x)]l\left[Z_{i,j}^{(h)}(x)\right]_{l} for a fixed hh, fixed i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}], and all l=0,1,2,…2p+2l=0,1,2,\ldots 2p+2 is bounded by,

The total time to compute vectors [Zi,j(h)(x)]l\left[Z_{i,j}^{(h)}(x)\right]_{l} for all h=1,2,…Lh=1,2,\ldots L and all l=0,1,2,…2p+2l=0,1,2,\ldots 2p+2 and all indices i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}] is thus bounded by O(L11ε6.7⋅(d1d2)⋅log⁡3d1d2Lεδ)\mathcal{O}\left(\frac{L^{11}}{\varepsilon^{6.7}}\cdot(d_{1}d_{2})\cdot\log^{3}\frac{d_{1}d_{2}L}{\varepsilon\delta}\right). The next computationally expensive operation is computing vectors [Yi,j(h)(x)]l\left[Y_{i,j}^{(h)}(x)\right]_{l} for l=0,1,2,…2p′+1l=0,1,2,\ldots 2p^{\prime}+1 and h=1,2,…Lh=1,2,\ldots L, and all indices i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}], in ??. By ??, the runtime of computing [Yi,j(h)(x)]l\left[Y_{i,j}^{(h)}(x)\right]_{l} for a fixed hh, fixed i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}], and all l=0,1,2,…2p′+1l=0,1,2,\ldots 2p^{\prime}+1 is bounded by,

Hence, the total time to compute vectors [Yi,j(h)(x)]l\left[Y_{i,j}^{(h)}(x)\right]_{l} for all h=1,2,…Lh=1,2,\ldots L and l=0,1,2,…2p′+1l=0,1,2,\ldots 2p^{\prime}+1 and all indices i∈[d1]i\in[d_{1}] and j∈[d2]j\in[d_{2}] is O(L9ε6log⁡2Lε⋅(d1d2)⋅log⁡3d1d2Lεδ)\mathcal{O}\left(\frac{L^{9}}{\varepsilon^{6}}\log^{2}\frac{L}{\varepsilon}\cdot(d_{1}d_{2})\cdot\log^{3}\frac{d_{1}d_{2}L}{\varepsilon\delta}\right). The total runtime bound is obtained by summing up these three contributions. This completes the proof of ??. ∎

The matrix G{\bm{G}} is defined in ?? to be a matrix of i.i.d. normal entries with s∗=C⋅1ε2⋅log⁡1δs^{*}=C\cdot\frac{1}{\varepsilon^{2}}\cdot\log\frac{1}{\delta} rows for large enough constant CC. shows that G{\bm{G}} is a JL transform and hence Ψcntk(L)\Psi_{\tt cntk}^{(L)} satisfies the following,

where A:=1d12d22⋅∥∑i∈[d1]∑j∈[d2]ψi,j(L)(y)∥2⋅∥∑i∈[d1]∑j∈[d2]ψi,j(L)(z)∥2A:=\frac{1}{d_{1}^{2}d_{2}^{2}}\cdot\left\|\sum_{i\in[d_{1}]}\sum_{j\in[d_{2}]}\psi_{i,j}^{(L)}(y)\right\|_{2}\cdot\left\|\sum_{i\in[d_{1}]}\sum_{j\in[d_{2}]}\psi_{i,j}^{(L)}(z)\right\|_{2}. By triangle inequality together with ?? and ??, the following bounds hold with probability at least 1−O(δ)1-\mathcal{O}(\delta):

Therefore, by union bound we find that, with probability at least 1−O(δ)1-\mathcal{O}(\delta):

Be combining the above with ?? using triangle inequality and union bound and also using ??, the following holds with probability at least 1−O(δ)1-\mathcal{O}(\delta):

Furthermore, it follows from ?? that Γ˙i,j,i′,j′(1)(y,z)≥0\dot{\Gamma}_{i,j,i^{\prime},j^{\prime}}^{(1)}(y,z)\geq 0 for any i,i′,j,j′i,i^{\prime},j,j^{\prime} because the function κ0\kappa_{0} is non-negative everywhere on $.Additionally,. Additionally,\dot{\Gamma}_{i,j,i^{\prime},j^{\prime}}^{(2)}(y,z)\geq\frac{1}{2q^{2}}becausebecause\kappa_{0}(\alpha)\geq\frac{1}{2}foreveryfor every\alpha\in.Byusingtheinequality. By using the inequality\Gamma_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z)\geq\frac{\sqrt{N^{(h)}_{i,j}(y)\cdot N^{(h)}_{i^{\prime},j^{\prime}}(z)}}{q^{2}}\cdot\Sigma_{\tt relu}^{(h)}(-1)thatweprovedabovealongwiththefactthatthat we proved above along with the fact that\kappa_{0}(\cdot)isamonotoneincreasingfunctionandrecursivelyusing??and??,itfollowsthatforeveryis a monotone increasing function and recursively using ?? and ??, it follows that for everyh\geq 1,wehave, we have\dot{\Gamma}_{i,j,i^{\prime},j^{\prime}}^{(h)}(y,z)\geq\frac{1}{q^{2}}\cdot\dot{\Sigma}_{\tt relu}^{(h)}(-1)$.

By using these inequalities and Definition of Π(h)\Pi^{(h)} in ?? together with ??, recursively, it follows that, for every i,i′,j,j′i,i^{\prime},j,j^{\prime} and h=2,…L−1h=2,\ldots L-1:

Therefore, using this inequality and ?? we have that for every L≥2L\geq 2:

Now using this inequality and ??, the following holds for every L≥2L\geq 2:

Therefore, by incorporating the above into ?? we get that,

Runtime analysis: By ??, time to compute the CNTK Sketch is O(L11ε6.7⋅(d1d2)⋅log⁡3d1d2Lεδ)\mathcal{O}\left(\frac{L^{11}}{\varepsilon^{6.7}}\cdot(d_{1}d_{2})\cdot\log^{3}\frac{d_{1}d_{2}L}{\varepsilon\delta}\right).