Deep Learning Through A Telescoping Lens: A Simple Model Provides Empirical Insights On Grokking, Gradient Boosting & Beyond
Alan Jeffares, Alicia Curth *, Mihaela van der Schaar · 2024
Read Deep Learning Through A Telescoping Lens: A Simple Model Provides Empirical Insights On Grokking, Gradient Boosting & Beyond by Alan Jeffares, Alicia Curth *, Mihaela van der Schaar (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2411-00247.txt.
Description
Abstract Deep learning sometimes appears to work in unexpected ways. In pursuit of a deeper understanding of its surprising behaviors, we investigate the utility of a simple yet accurate model of a trained neural network consisting of a sequence of first-order approximations telescoping out into a single empirically operational tool for practical analysis.
Catalog record
| CREATOR | Alan Jeffares, Alicia Curth *, Mihaela van der Schaar |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 107 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2411-00247
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Deep Learning Through A Telescoping Lens: A Simple Model Provides Empirical Insights On Grokking, Gradient Boosting & Beyond Alan Jeffares, Alicia Curth *, Mihaela van der Schaar Abstract Deep learning sometimes appears to work in unexpected ways. In pursuit of a deeper understanding of its surprising behaviors, we investigate the utility of a simple yet accurate model of a trained neural network consisting of a sequence of first-order approximations telescoping out into a single empirically operational tool for practical analysis. Across three case studies, we illustrate how it can be applied to derive new empirical insights on a diverse range of prominent phenomena in the literature – including double descent, grokking, linear mode connectivity, and the challenges of applying deep learning on tabular data – highlighting that this model allows us to construct and extract metrics that help predict and understand the a priori unexpected performance of neural networks. We also demonstrate that this model presents a pedagogical formalism allowing us to isolate components of the training process even in complex contemporary settings, providing a lens to reason about the effects of design choices such as architecture & optimization strategy, and reveals surprising parallels between neural network learning and gradient boosting. 1 Introduction Deep learning works , but it sometimes works in mysterious ways. Despite the remarkable recent success of deep learning in applications ranging from image recognition [ KSH12 ] to text generation [ BMR+20 ] , there remain many contexts in which it performs in apparently unpredictable ways: neural networks sometimes exhibit surprisingly non-monotonic generalization performance [ BHMM19 , PBE+22 ] , continue to be outperformed by gradient boosted trees on tabular tasks despite successes elsewhere [ GOV22 ] , and sometimes behave surprisingly similarly to linear models [ FDRC20 ] . The pursuit of a deeper understanding of deep learning and its phenomena has since motivated many subfields, and progress on fundamental questions has been distributed across many distinct yet complementary perspectives that range from purely theoretical to predominantly empirical research. Outlook. In this work, we take a hybrid approach and investigate how we can apply ideas primarily used in theoretical research to investigate the behavior of a simple yet accurate model of a neural network empirically . Building upon previous work that studies linear approximations to learning in neural networks through tangent kernels (e.g. [ JGH18 , COB19 ] , see Sec. 2 ), we consider a model that uses first-order approximations for the functional updates made during training. However, unlike most previous work, we define this model incrementally by simply telescoping out approximations to individual updates made during training ( Sec. 3 ) such that it more closely approximates the true behavior of a fully trained neural network in practical settings. This provides us with a pedagogical lens through which we can view modern optimization strategies and other design choices ( Sec. 5 ), and a mechanism with which we can conduct empirical investigations into several prominent deep learning phenomena that showcase how neural networks sometimes generalize seemingly unpredictably. Across three case studies in Sec. 4 , we then show that this model allows us to construct and extract metrics that help predict and understand the a priori unexpected performance of neural networks. First, in Sec. 4.1 , we demonstrate that it allows us to extend [ CJvdS23 ] ’s recent model complexity metric to neural networks, and use this to investigate surprising generalization curves – discovering that the non-monotonic behaviors observed in both deep double descent [ BHMM19 ] and grokking [ PBE+22 ] are associated with quantifiable divergence of train- and test-time model complexity. Second, in Sec. 4.2 , we show that it reveals perhaps surprising parallels between gradient boosting [ Fri01 ] and neural network learning, which we then use to investigate the known performance differences between neural networks and gradient boosted trees on tabular data in the presence of dataset irregularities [ MKV+23 ] . Third, in Sec. 4.3 , we use it to investigate the connections between gradient stabilization and the success of weight averaging (i.e. linear mode connectivity [ FDRC20 ] ). 2 Background Notation and preliminaries. Let f_{\bm{\theta}}:\mathcal{X}\subseteq\mathbb{R}^{d}\rightarrow\mathcal{Y}\subseteq\mathbb{R}^{k} denote a neural network parameterized by (stacked) model weights \bm{\bm{\theta}}\in\mathbb{R}^{p} . Assume we observe a training sample of n input-output pairs \{\mathbf{x}_{i},y_{i}\}^{n}_{i=1} , i.i.d. realizations of the tuple (X,Y) sampled from some distribution P , and wish to learn good model parameters \bm{\theta} for predicting outputs from this data by minimizing an empirical prediction loss \frac{1}{n}\sum^{n}_{i=1}\ell(f_{\bm{\theta}}(\mathbf{x}_{i}),y_{i}) , where \ell:\mathbb{R}^{k}\times\mathbb{R}^{k}\to\mathbb{R} denotes some differentiable loss function. Throughout, we let k=1 for ease of exposition, but unless otherwise indicated our discussion generally extends to k>1 . We focus on the case where \bm{\theta} is optimized by initializing the model with some \bm{\theta}_{0} and then iteratively updating the parameters through stochastic gradient descent (SGD) with learning rates \gamma_{t} for T steps, where at each t\in[T]=\{1,\ldots,T\} we subsample batches B_{t}\subseteq[n]=\{1,\ldots,n\} of the training indices, leading to parameter updates \Delta\bm{\theta}_{t}\coloneq\bm{\theta}_{t}-\bm{\theta}_{t-1} as: \textstyle\bm{\theta}_{t}=\bm{\theta}_{t-1}+\Delta\bm{\theta}_{t}=\bm{\theta}_{t-1}-\frac{\gamma_{t}}{|B_{t}|}\sum_{i\in B_{t}}\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x}_{i})g^{\ell}_{it}=\bm{\theta}_{t-1}-\gamma_{t}\mathbf{T}_{t}\mathbf{g}^{\ell}_{t}\vskip-1.42271pt (1) where g^{\ell}_{it}=\frac{\partial\ell(f_{\bm{\theta}_{t-1}}(\mathbf{x}_{i}),y_{i})}{\partial f_{\bm{\theta}_{t-1}}(\mathbf{x}_{i})} is the gradient of the loss w.r.t. the model prediction for the i^{th} training example, which we will sometimes collect in the vector \mathbf{g}^{\ell}_{t}=[g^{\ell}_{1t},\ldots,g^{\ell}_{nt}]^{\top} , and the p\times n matrix \mathbf{T}_{t}=[\frac{\mathbf{1}\{1\in B_{t}\}}{|B_{t}|}\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x}_{1}),\ldots,\frac{\mathbf{1}\{n\in B_{t}\}}{|B_{t}|}\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x}_{n})] has as columns the gradients of the model prediction with respect to its parameters for examples in the training batch (and \mathbf{0} otherwise). Beyond vanilla SGD, modern deep learning practice usually relies on a number of modifications to the update described above, such as momentum and weight decay; we discuss these in Sec. 5 . Related work: Linearized neural networks and tangent kernels. A growing body of recent work has explored the use of linearized neural networks (linear in their parameters) as a tool for theoretical [ JGH18 , COB19 , LXS+19 ] and empirical [ FDP+20 , LZB20 , OJMDF21 ] study. In this paper, we similarly make extensive use of the following observation (as in e.g. [ FDP+20 ] ): we can linearize the difference \Delta f_{t}(\mathbf{x})\coloneq f_{\bm{\theta}_{t}}(\mathbf{x})-f_{\bm{\theta}_{t-1}}(\mathbf{x}) between two parameter updates as \Delta f_{t}(\mathbf{x})=\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x})^{\top}\Delta\bm{\theta}_{t}+\mathcal{O}(||\Delta\bm{\theta}_{t}||^{2})\approx{\color[rgb]{0,0,0}\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x})^{\top}\Delta\bm{\theta}_{t}\coloneq\Delta\tilde{f}_{t}(\mathbf{x})}\vskip-1.9919pt (2) where the quality of the approximation \Delta\tilde{f}_{t}(\mathbf{x}) is good whenever the parameter updates \Delta\bm{\theta}_{t} from a single batch are sufficiently small (or when the Hessian product ||\Delta\bm{\theta}_{t}^{\top}\nabla^{2}_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x})\Delta\bm{\theta}_{t}|| vanishes). If Eq. 2 holds exactly (e.g. for infinitesimal \gamma_{t} ), then running SGD in the network’s parameter space to obtain \Delta\bm{\theta}_{t} corresponds to executing steepest descent on the function output f_{\bm{\theta}}(\mathbf{x}) itself using the neural tangent kernel K^{\bm{\theta}}_{t}(\mathbf{x},\mathbf{x}_{i}) at time-step t [ JGH18 ] , i.e. results in functional updates \textstyle{\color[rgb]{0,0,0}\Delta\tilde{f}_{t}(\mathbf{x})\approx-\gamma_{t}\sum_{i\in[n]}K^{\bm{\theta}}_{t}(\mathbf{x},\mathbf{x}_{i})g^{\ell}_{it}}\text{ where }K^{\bm{\theta}}_{t}(\mathbf{x},\mathbf{x}_{i})\coloneq\frac{\mathbf{1}\{i\in B_{t}\}}{|B_{t}|}\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x})^{\top}\nabla_{\bm{\theta}}f_{\bm{\theta}_{t-1}}(\mathbf{x}_{i}).\vskip-2.84544pt (3) Lazy learning [ COB19 ] occurs as the model gradients remain approximately constant during training, i.e. \nabla_{\bm{\theta}}f_{\bm{\theta}_{t}}(\mathbf{x})\approx\nabla_{\bm{\theta}}f_{\bm{\theta}_{0}}(\mathbf{x}) , \forall t\in[T] . For learned parameters \bm{\theta}_{T} , this implies that the approximation \textstyle f^{lin}_{\bm{\theta}_{T}}(\mathbf{x})=f_{\bm{\theta}_{0}}(\mathbf{x})+\nabla_{\bm{\theta}}f_{\bm{\theta}_{0}}(\mathbf{x})^{\top}(\bm{\theta}_{T}-\bm{\theta}_{0}) holds – which is a linear function of the model parameters , and thus corresponds to a linear regression in which features are given by the model gradients \nabla_{\bm{\theta}}f_{\bm{\theta}_{0}}(\mathbf{x}) instead of the inputs \mathbf{x} directly – whose training dynamics can be more easily understood theoretically. For sufficiently wide neural networks the \nabla_{\bm{\theta}}f_{\bm{\theta}_{t}}(\mathbf{x}) , and thus the tangent kernel, have been theoretically shown to be constant throughout training in some settings [ JGH18 , LXS+19 ] , but in practice they generally vary