How Neural Networks Extrapolate: From Feedforward to Graph Neural Networks โ part 6/11
Cleaned-text code points [77792, 91985). Bibliography omitted here; source.md includes it.
Recall that we assume our training data { ( ๐ i , y i ) } i = 1 n \{(\bm{x}_{i},y_{i})\}_{i=1}^{n} satisfies for any ๐ โ โ d \bm{w}\in\mathbb{R}^{d} , there exist d d linearly independent { ๐ i ๐ } i = 1 d โ ๐ฟ \{\bm{x}_{i}^{\bm{w}}\}_{i=1}^{d}\subset\bm{X} , where ๐ฟ = { ๐ i } i = 1 n \bm{X}=\{\bm{x}_{i}\}_{i=1}^{n} , so that ๐ โค โ ๐ i ๐ โฅ 0 \bm{w}^{\top}\bm{x}_{i}^{\bm{w}}\geq 0 and โ ๐ i ๐ โ ๐ฟ -\bm{x}_{i}^{\bm{w}}\in\bm{X} for i = 1 . . d i=1..d , e.g., an orthogonal basis of โ d \mathbb{R}^{d} and their opposite vectors. We will show that under this data regime, we have
(a) for any particular ๐ \bm{w} , there indeed exist a set of ฮป i \lambda_{i} that can satisfy the constraints Eqn. 59 and Eqn. 61 for this particular ๐ \bm{w} .
(b) For any ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} that activate the exact same set of { ๐ i } \{\bm{x}_{i}\} , the same set of ฮป i \lambda_{i} can satisfy the constraints Eqn. 59 and Eqn. 61 of both ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} .
(c) Whenever we rotate a ๐ 1 \bm{w}_{1} to a ๐ 2 \bm{w}_{2} so that the set of ๐ i \bm{x}_{i} being activated changed, we can still find ฮป i \lambda_{i} that satisfy constraint of both ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} .
Combining (a), (b) and (c) implies there exists a set of ฮป \lambda that satisfy the constraints for all w w . Hence, it remains to show these three claims.
We first prove Claim (a). For each ๐ \bm{w} , we must find a set of ฮป i \lambda_{i} so that the following hold. ๐ท ๐ ( k ) = c โ
โ i = 1 n ฮป i โ
๐ i ( k ) โ
๐ โก ( ๐ โค โ ๐ i โฅ 0 ) , \displaystyle\bm{\beta}_{\bm{w}}^{(k)}=c\cdot\sum\limits_{i=1}^{n}\lambda_{i}\cdot\bm{x}_{i}^{(k)}\cdot\mathbb{I}\left(\bm{w}^{\top}\bm{x}_{i}\geq 0\right), ๐ท ๐ โฒ = ๐ โค โ ๐ท ๐ \displaystyle\bm{\beta}_{\bm{w}}^{\prime}=\bm{w}^{\top}\bm{\beta}_{\bm{w}} ๐ท ๐ + ๐ท ๐ โฒ โ
๐ = 2 โ ๐ท g \displaystyle\bm{\beta}_{\bm{w}}+\bm{\beta}_{\bm{w}}^{\prime}\cdot\bm{w}=2\bm{\beta}_{g} Here, ๐ท g \bm{\beta}_{g} and ๐ \bm{w} are fixed, and ๐ \bm{w} is a vector on the unit sphere. It is easy to see that ๐ท ๐ \bm{\beta}_{\bm{w}} is then determined by ๐ท g \bm{\beta}_{g} and ๐ \bm{w} , and there indeed exists a solution (solving a consistent linear system). Hence we are left with a linear system with d d linear equations ๐ท ๐ ( k ) = c โ
โ i = 1 n ฮป i โ
๐ i ( k ) โ
๐ ( ๐ โค ๐ i โฅ 0 ) โ k โ [ d ] \bm{\beta}_{\bm{w}}^{(k)}=c\cdot\sum\limits_{i=1}^{n}\lambda_{i}\cdot\bm{x}_{i}^{(k)}\cdot\mathbb{I}\left(\bm{w}^{\top}\bm{x}_{i}\geq 0\right)\;\;\;\forall k\in[d] to solve with free variables being ฮป i \lambda_{i} so that ๐ \bm{w} activates ๐ i \bm{x}_{i} , i.e., ๐ โค โ ๐ i โฅ 0 \bm{w}^{\top}\bm{x}_{i}\geq 0 . Because the training data { ( ๐ i , y i ) } i = 1 n \{(\bm{x}_{i},y_{i})\}_{i=1}^{n} satisfies for any ๐ \bm{w} , there exist at least d d linearly independent ๐ i \bm{x}_{i} that activate ๐ \bm{w} . This guarantees for any ๐ \bm{w} we must have at least d d free variables. It follows that there must exist solutions ฮป i \lambda_{i} to the linear system. This proves Claim (a).
Next, we show that (b) for any ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} that activate the exact same set of { ๐ i } \{\bm{x}_{i}\} , the same set of ฮป i \lambda_{i} can satisfy the constraints Eqn. 59 and Eqn. 61 of both ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} . Because ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} are activated by the same set of ๐ i \bm{x}_{i} , this implies ๐ท ๐ 1 = c โ
โ i = 1 n ฮป i โ
๐ i โ
๐ โก ( ๐ 1 โค โ ๐ i โฅ 0 ) = c โ
โ i = 1 n ฮป i โ
๐ i โ
๐ โก ( ๐ 2 โค โ ๐ i โฅ 0 ) = ๐ท ๐ 2 \displaystyle\bm{\beta}_{\bm{w}_{1}}=c\cdot\sum\limits_{i=1}^{n}\lambda_{i}\cdot\bm{x}_{i}\cdot\mathbb{I}\left(\bm{w}_{1}^{\top}\bm{x}_{i}\geq 0\right)=c\cdot\sum\limits_{i=1}^{n}\lambda_{i}\cdot\bm{x}_{i}\cdot\mathbb{I}\left(\bm{w}_{2}^{\top}\bm{x}_{i}\geq 0\right)=\bm{\beta}_{\bm{w}_{2}} Since ฮป i \lambda_{i} already satisfy constraint Eqn. 59 for ๐ 1 \bm{w}_{1} , they also satisfy that for ๐ 2 \bm{w}_{2} . Thus, it remains to show that ๐ท ๐ 1 + ๐ท ๐ 1 โฒ โ
๐ 1 = ๐ท ๐ 2 + ๐ท ๐ 2 โฒ โ
๐ 1 \bm{\beta}_{\bm{w}_{1}}+\bm{\beta}_{\bm{w}_{1}}^{\prime}\cdot\bm{w}_{1}=\bm{\beta}_{\bm{w}_{2}}+\bm{\beta}_{\bm{w}_{2}}^{\prime}\cdot\bm{w}_{1} assuming ๐ท ๐ 1 = ๐ท ๐ 2 \bm{\beta}_{\bm{w}_{1}}=\bm{\beta}_{\bm{w}_{2}} , ๐ท ๐ 1 โฒ = ๐ 1 โค โ ๐ท ๐ 1 \bm{\beta}_{\bm{w}_{1}}^{\prime}=\bm{w}_{1}^{\top}\bm{\beta}_{\bm{w}_{1}} , and ๐ท ๐ 2 โฒ = ๐ 2 โค โ ๐ท ๐ 2 \bm{\beta}_{\bm{w}_{2}}^{\prime}=\bm{w}_{2}^{\top}\bm{\beta}_{\bm{w}_{2}} . This indeed holds because ๐ท ๐ 1 + ๐ท ๐ 1 โฒ โ
๐ 1 = ๐ท ๐ 2 + ๐ท ๐ 2 โฒ โ
๐ 2 \displaystyle\bm{\beta}_{\bm{w}_{1}}+\bm{\beta}_{\bm{w}_{1}}^{\prime}\cdot\bm{w}_{1}=\bm{\beta}_{\bm{w}_{2}}+\bm{\beta}_{\bm{w}_{2}}^{\prime}\cdot\bm{w}_{2} โบ \displaystyle\Longleftrightarrow\;\;\; ๐ท ๐ 1 โฒ โ
๐ 1 โค = ๐ท ๐ 2 โฒ โ
๐ 2 โค \displaystyle\bm{\beta}_{\bm{w}_{1}}^{\prime}\cdot\bm{w}_{1}^{\top}=\bm{\beta}_{\bm{w}_{2}}^{\prime}\cdot\bm{w}_{2}^{\top} โบ \displaystyle\Longleftrightarrow\;\;\; ๐ 1 โค โ ๐ท ๐ 1 โ ๐ 1 โค = ๐ 2 โค โ ๐ท ๐ 2 โ ๐ 2 โค \displaystyle\bm{w}_{1}^{\top}\bm{\beta}_{\bm{w}_{1}}\bm{w}_{1}^{\top}=\bm{w}_{2}^{\top}\bm{\beta}_{\bm{w}_{2}}\bm{w}_{2}^{\top} โบ \displaystyle\Longleftrightarrow\;\;\; ๐ 1 โค โ ๐ 1 โ ๐ท ๐ 1 โค = ๐ 2 โค โ ๐ 2 โ ๐ท ๐ 2 โค \displaystyle\bm{w}_{1}^{\top}\bm{w}_{1}\bm{\beta}_{\bm{w}_{1}}^{\top}=\bm{w}_{2}^{\top}\bm{w}_{2}\bm{\beta}_{\bm{w}_{2}}^{\top} โบ \displaystyle\Longleftrightarrow\;\;\; 1 โ
๐ท ๐ 1 โค = 1 โ
๐ท ๐ 2 โค \displaystyle 1\cdot\bm{\beta}_{\bm{w}_{1}}^{\top}=1\cdot\bm{\beta}_{\bm{w}_{2}}^{\top} โบ \displaystyle\Longleftrightarrow\;\;\; ๐ท ๐ 1 = ๐ท ๐ 1 \displaystyle\bm{\beta}_{\bm{w}_{1}}=\bm{\beta}_{\bm{w}_{1}} Here, we used the fact that ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} are vectors on the unit sphere. This proves Claim (b).
Finally, we show (c) that Whenever we rotate a ๐ 1 \bm{w}_{1} to a ๐ 2 \bm{w}_{2} so that the set of ๐ i \bm{x}_{i} being activated changed, we can still find ฮป i \lambda_{i} that satisfy constraint of both ๐ 1 \bm{w}_{1} and ๐ 2 \bm{w}_{2} . Suppose we rotate ๐ 1 \bm{w}_{1} to ๐ 2 \bm{w}_{2} so that ๐ 2 \bm{w}_{2} lost activation with ๐ 1 , ๐ 2 , โฆ , ๐ p \bm{x}_{1},\bm{x}_{2},...,\bm{x}_{p} which in the set of linearly independent ๐ i \bm{x}_{i} โs being activated by ๐ 1 \bm{w}_{1} and their opposite vectors โ ๐ i -\bm{x}_{i} are also in the training set (without loss of generality). Then ๐ 2 \bm{w}_{2} must now also get activated by โ ๐ 1 , โ ๐ 2 , โฆ , โ ๐ p -\bm{x}_{1},-\bm{x}_{2},...,-\bm{x}_{p} . This is because if ๐ 2 โค โ ๐ i < 0 \bm{w}_{2}^{\top}\bm{x}_{i}<0 , we must have ๐ 2 โค โ ( โ ๐ i ) > 0 \bm{w}_{2}^{\top}(-\bm{x}_{i})>0 .
Recall that in the proof of Claim (a), we only needed the ฮป i \lambda_{i} from linearly independent ๐ i \bm{x}_{i} that we used to solve the linear systems, and their opposite as the free variables to solve the linear system of d d equations. Hence, we can set ฮป \lambda to 0 0 for the other ๐ i \bm{x}_{i} while still satisfying the linear system. Then, suppose there exists ฮป i \lambda_{i} that satisfy ๐ท ๐ 1 ( k ) = c โ
โ i = 1 d ฮป i โ
๐ i ( k ) \displaystyle\bm{\beta}_{\bm{w}_{1}}^{(k)}=c\cdot\sum\limits_{i=1}^{d}\lambda_{i}\cdot\bm{x}_{i}^{(k)} where the ๐ i \bm{x}_{i} are the linearly independent vectors that activate ๐ 1 \bm{w}_{1} with opposite vectors in the training set, which we have proved in (a). Then we can satisfy the constraint for ๐ท ๐ 2 \bm{\beta}_{\bm{w}_{2}} below ๐ท ๐ 2 ( k ) = c โ
โ i = 1 p ฮป ^ i โ
( โ ๐ i ) ( k ) + โ i = p + 1 d ฮป i โ
๐ i ( k ) \displaystyle\bm{\beta}_{\bm{w}_{2}}^{(k)}=c\cdot\sum\limits_{i=1}^{p}\hat{\lambda}_{i}\cdot(-\bm{x}_{i})^{(k)}+\sum\limits_{i=p+1}^{d}\lambda_{i}\cdot\bm{x}_{i}^{(k)} by setting ฮป ^ i = โ ฮป i \hat{\lambda}_{i}=-\lambda_{i} for i = 1 โ โฆ โ p i=1...p . Indeed, this gives ๐ท ๐ 2 ( k ) \displaystyle\bm{\beta}_{\bm{w}_{2}}^{(k)} = c โ
โ i = 1 p ( โ ฮป i ) โ
( โ ๐ i ) ( k ) + โ i = p + 1 d ฮป i โ
๐ i ( k ) \displaystyle=c\cdot\sum\limits_{i=1}^{p}(-\lambda_{i})\cdot(-\bm{x}_{i})^{(k)}+\sum\limits_{i=p+1}^{d}\lambda_{i}\cdot\bm{x}_{i}^{(k)} = c โ
โ i = 1 d ฮป i โ
๐ i ( k ) \displaystyle=c\cdot\sum\limits_{i=1}^{d}\lambda_{i}\cdot\bm{x}_{i}^{(k)} Thus, we can also find ฮป i \lambda_{i} that satisfy the constraint for ๐ท ๐ 2 \bm{\beta}_{\bm{w}_{2}} . Here, we do not consider the case where ๐ 2 \bm{w}_{2} is parallel with an ๐ i \bm{x}_{i} because such ๐ 2 \bm{w}_{2} has measure zero. Note that we can apply this argument iteratively because the flipping the sign always works and will not create any inconsistency.
Moreover, we can show that the constraint for ๐ท ๐ โ 2 โฒ \bm{\beta}_{\bm{w}2}^{\prime} is satisfied by a similar argument as in proof of Claim (b). This follows from the fact that our construction makes ๐ท ๐ 1 = ๐ท ๐ 2 \bm{\beta}_{\bm{w}_{1}}=\bm{\beta}_{\bm{w}_{2}} . Then we can follow the same argument as in (b) to show that ๐ท ๐ 1 + ๐ท ๐ 1 โฒ โ
๐ 1 = ๐ท ๐ 2 + ๐ท ๐ 2 โฒ โ
๐ 1 \bm{\beta}_{\bm{w}_{1}}+\bm{\beta}_{\bm{w}_{1}}^{\prime}\cdot\bm{w}_{1}=\bm{\beta}_{\bm{w}_{2}}+\bm{\beta}_{\bm{w}_{2}}^{\prime}\cdot\bm{w}_{1} . This completes the proof of Claim (c).
In summary, combining Claim (a), (b) and (c) gives that Claim 1 holds. That is, given our training data, the global optimum to the constrained optimization problem of finding the min-norm solution among functions that fit the training data satisfies ๐ท ๐ + ๐ท ๐ โฒ โ
๐ = 2 โ ๐ท g \bm{\beta}_{\bm{w}}+\bm{\beta}_{\bm{w}}^{\prime}\cdot\bm{w}=2\bm{\beta}_{g} . We also showed that this claim implies exact extrapolation, i.e., the networkโs learned function f โก ( ๐ ) f(\bm{x}) is equal to the true underlying function g โก ( ๐ ) g(\bm{x}) for all ๐ โ โ d \bm{x}\in\mathbb{R}^{d} . This completes the proof.
### B.3 Proof of Theorem 2
Proof of the asymptotic convergence to extrapolation builds upon our proof of exact extrapolation, i.e., Lemma 1 . The proof idea is that if the training data distribution has support at all directions, when the number of samples n โ โ n\rightarrow\infty , asymptotically the training set will converge to some imaginary training set that satisfies the condition for exact extrapolation. Since if training data are close the neural tangent kernels are also close, the predictions or learned function will converge to a function that achieves perfect extrapolation, that is, the true underlying function.
##### Asymptotic convergence of data sets.
We first show the training data converge to a data set that satisfies the exact extrapolation condition in Lemma 1 . Suppose training data { ๐ i } i = 1 n \{\bm{x}_{i}\}_{i=1}^{n} are sampled from a distribution whose support contains a connected set ๐ฎ \mathcal{S} that intersects all directions, i.e., for any non-zero ๐ โ โ d \bm{w}\in\mathbb{R}^{d} , there exists k > 0 k>0 so that k โ ๐ โ ๐ฎ k\bm{w}\in\mathcal{S} .
Let us denote by ๐ฎ \mathcal{S} the set of datasets that satisfy the condition in Lemma 1 . In fact, we will use a relaxed condition in the proof of Lemma 1 (Lemma 1 in the main text uses a stricter condition for simplicity of exposition). Given a general dataset ๐ฟ \bm{X} and a dataset ๐บ โ ๐ฎ \bm{S}\in\mathcal{S} of the same size n n , let ฯ โก ( ๐ฟ , ๐บ ) \sigma(\bm{X},\bm{S}) denote a matching of their data points, i.e., ฯ \sigma outputs a sequence of pairs ฯ โ ( ๐ฟ , ๐บ ) i = ( ๐ i , ๐ i ) โ for โ i โ [ n ] \displaystyle\sigma(\bm{X},\bm{S})_{i}=\left(\bm{x}_{i},\bm{s}_{i}\right)\;\;\;\text{for }i\in[n] s . t . ๐ฟ = { ๐ i } i = 1 n \displaystyle s.t.\;\;\;\bm{X}=\{\bm{x}_{i}\}_{i=1}^{n} ๐บ = { ๐ i } i = 1 n \displaystyle\;\;\;\;\;\;\;\;\;\bm{S}=\{\bm{s}_{i}\}_{i=1}^{n}
Let โ : โ d ร โ d โ โ \ell:\mathbb{R}^{d}\times\mathbb{R}^{d}\rightarrow\mathbb{R} be the l โ 2 l2 distance that takes in a pair of points. We then define the distance between the datasets d โก ( ๐ฟ , ๐บ ) d(\bm{X},\bm{S}) as the minimum sum of l โ 2 l2 distances of their data points over all possible matching. d โก ( ๐ฟ , ๐บ ) = { min โก โ i = 1 n ฯ โก โ โก ( ฯ โ ( ๐ฟ , ๐บ ) i ) | ๐ฟ | = | ๐บ | = n โ | ๐ฟ | โ | ๐บ | \displaystyle d(\bm{X},\bm{S})=\begin{cases}\quad\min\limits_{\sigma}\sum\limits_{i=1}^{n}\ell\left(\sigma\left(\bm{X},\bm{S}\right)_{i}\right)\quad\quad\quad&|\bm{X}|=|\bm{S}|=n\\ \quad\infty\quad\quad\quad&|\bm{X}|\neq|\bm{S}|\end{cases}
We can then define a โclosest distance to perfect datasetโ function ๐ โ : ๐ณ โ โ \mathcal{D}^{\ast}:\mathcal{X}\rightarrow\mathbb{R} which maps a dataset ๐ฟ \bm{X} to the minimum distance of ๐ฟ \bm{X} to any dataset in ๐ฎ \mathcal{S} ๐ โ โ ( ๐ฟ ) = min ๐บ โ ๐ฎ โก d โก ( ๐ฟ , ๐บ ) \displaystyle\mathcal{D}^{\ast}\left(\bm{X}\right)=\min\limits_{\bm{S}\in\mathcal{S}}d\left(\bm{X},\bm{S}\right)
It is easy to see that for any dataset ๐ฟ = { ๐ i } i = 1 n \bm{X}=\{\bm{x}_{i}\}_{i=1}^{n} , ๐ โ โ ( ๐ฟ ) \mathcal{D}^{\ast}\left(\bm{X}\right) can be bounded by the minimum of the closest distance to perfect dataset ๐ โ \mathcal{D}^{\ast} of sub-datasets of ๐ฟ \bm{X} of size 2 โ d 2d . ๐ โ โ ( { ๐ i } i = 1 n ) โค min k = 1 โ n / 2 โ d โ โ ๐ โ โ ( { ๐ j } j = ( k โ 1 ) โ 2 โ d + 1 k โ 2 โ d ) \displaystyle\mathcal{D}^{\ast}\left(\{\bm{x}_{i}\}_{i=1}^{n}\right)\leq\min\limits_{k=1}^{\lfloor n/2d\rfloor}\mathcal{D}^{\ast}\left(\{\bm{x}_{j}\}_{j=(k-1)*2d+1}^{k*2d}\right) (62) This is because for any ๐บ โ ๐ฎ \bm{S}\in\mathcal{S} , and any ๐บ โ ๐บ โฒ \bm{S}\subseteq\bm{S}^{\prime} , we must have ๐บ โฒ โ ๐ฎ \bm{S}^{\prime}\in\mathcal{S} because a dataset satisfies exact extrapolation condition as long as it contains some key points. Thus, adding more data will not hurt, i.e., for any ๐ฟ 1 โ ๐ฟ 2 \bm{X}_{1}\subseteq\bm{X}_{2} , we always have ๐ โ โ ( ๐ฟ ๐ ) โค ๐ โ โ ( ๐ฟ 2 ) \displaystyle\mathcal{D}^{\ast}\left(\bm{X_{1}}\right)\leq\mathcal{D}^{\ast}\left(\bm{X}_{2}\right)
Now let us denote by ๐ฟ n \bm{X}_{n} a random dataset of size n n where each ๐ i โ ๐ฟ n \bm{x}_{i}\in\bm{X}_{n} is sampled from the training distribution. Recall that our training data { ๐ i } i = 1 n \{\bm{x}_{i}\}_{i=1}^{n} are sampled from a distribution whose support contains a connected set ๐ฎ โ \mathcal{S}^{\ast} that intersects all directions, i.e., for any non-zero ๐ โ โ d \bm{w}\in\mathbb{R}^{d} , there exists k > 0 k>0 so that k โ ๐ โ ๐ฎ โ k\bm{w}\in\mathcal{S}^{\ast} . It follows that for a random dataset ๐ฟ 2 โ d \bm{X}_{2d} of size 2 โ d 2d , the probability that ๐ โ โ ( ๐ฟ 2 โ d ) > ฯต \mathcal{D}^{\ast}(\bm{X}_{2d})>\epsilon happens is less than 1 1 for any ฯต > 0 \epsilon>0 .