betaFeedback

WorksComputer Science

Optimal Explicit and Implicit Regularization Strengths in High-Dimensional Continual Linear Regression

Abstract

We study continual linear regression in a high-dimensional regime, where a learner observes a sequence of tasks and updates its parameters sequentially. In this setting, we derive an explicit closed-form expression for the generalization loss of a model trained with gradient descent for a fixed number of steps per task, which holds for arbitrary teachers. We prove that the optimal fixed step size decays nearly inversely with the number of tasks, specifically as ln⁡T/T\ln T / T, for a single teacher and, more generally, i.i.d. teachers. Under this scaling, we show that the resulting generalization loss is asymptotically equivalent to that achieved by optimally tuned L2 (isotropic) regularization. Furthermore, we extend our analysis to generalized ridge regression with diagonal regularization matrices, obtaining a closed-form characterization of the generalization loss and identifying necessary and sufficient conditions under which the optimal regularizer is isotropic. Finally, we identify a regime where the optimal step size remains finite even as the number of tasks tends to infinity, thus revealing a non-trivial tradeoff between task variability and implicit regularization, in contrast to the i.i.d. teacher scaling. Our theoretical predictions are corroborated by experiments on both linear models and neural networks, providing practical guidance for the design of continual learning systems.

Introduction

In continual learning, the learner is expected to learn sequentially from data, without ‘forgetting’ previous tasks. In recent years, driven by the remarkable success of artificial intelligence (AI) systems [32, 26, 25], continual learning has attracted significant attention, as most modern models are static in nature and do not adapt to newly arriving data. Unlike conventional machine learning models, continual learning involves learning from dynamic data distributions and faces a challenge known as catastrophic forgetting [23, 12], where adaptation to new distributions often leads to a substantial loss of performance on previously learned ones.

Many continual learning works aimed to reduce forgetting by explicitly penalizing changes in parameter space using per-parameter regularization terms [e.g. 17, 33, 2, 5]. Others [22, 29] showed empirically that isotropic L2L2 regularization results in similar performance. Practically, it is also common to minimize the current task’s unregularized loss with a gradient algorithm for a finite number of steps (in contrast to theoretically learning to convergence). This cheaper alternative implicitly regularizes the model, even in stationary settings [1]. To better understand catastrophic forgetting and how to mitigate it, most theoretical papers focus on a simplified setting, such as continual linear regression. This simplified yet analytically tractable setting captures essential features of sequential learning and has proven useful for analyzing diverse continual learning systems ([19, 18, 11] (Hiratani 2024)).

Existing optimization-focused work ([9, 11, 18, 31]) had to make a limiting assumption of joint realizability—i.e., that training data can be perfectly fitted by a single noiseless ‘teacher’ model. In contrast, we adopt a statistical framework, focusing on the generalization loss. Such analysis allows adopting a closed-form characterization of the generalization loss that naturally accommodates multiple teachers and label noise, thereby better capturing real-world scenarios. Moreover, our framework yields exact generalization expressions, whereas optimization-focused works only allow worst-case upper and lower bounds. Such expressions better align with empirical experiments, highlighting the explanatory role of this framework ([20, 16]). Building on this framework, in this paper we investigate several remaining mysteries in continual learning regression. Our contributions are the following:

  • We derive an exact closed-form generalization expression for early-stopped gradient descent that accommodates arbitrary teachers and label noise, and show that the optimal step decays as ln⁡T/T\ln T/T, for a single teacher and, more generally, i.i.d. teachers.

  • We identify a teacher regime under which the optimal step size need not scale with TT.

  • We derive the exact generalization loss under task-dependent diagonal regularization in the single-teacher setting, and characterize when isotropic regularization remains optimal.

  • We empirically validate our theoretical findings on continual linear models and neural networks, using both synthetic and MNIST-based data.

Setting: Regularized Continual Learning with Implicit or Explicit Regularization

Learning scheme. We study the continual linear regression setting, which has been widely studied in recent years ([9, 11, 34, 36, 18]).

In our setting the learner is exposed to TT sequential tasks, that is, (X1,y1),(X2,y2),…,(XT,yT)(X_1,y_1),(X_2,y_2),\ldots,(X_T,y_T), where each Xt∈Rn×dX_t \in\mathbb{R}^{n \times d}, yt∈Rny_t \in\mathbb{R}^n. During task tt, the learner observes only the data (Xt,yt)(X_t,y_t) associated with that task and updates its predictor accordingly, without having access to data from any other task. To be capable of learning sequentially, many continual learning algorithms incorporate a regularization towards the last iterate. A prominent line of work proposes using the Fisher information to weight this regularization ([17, 4]). However, subsequent studies have observed that a much simpler isotropic regularization performs comparably well in practice ([14, 22]). Following recent theoretical works ([18, 35]) we focus on L2 (isotropic) regularization.

Algorithm 1 Continual linear regression with L2 regularization

Input: {(Xi,yi)}i=1T\{(X_i,y_i)\}_{i=1}^{T}, regularization strength λ\lambda

Initialize w0∈Rdw_0 \in\mathbb{R}^d

For each iteration t=1,…,Tt = 1,\ldots,T:

wt←arg⁡min⁡w{12n∥Xtw−yt∥2+λ2∥w−wt−1∥2}w_t \leftarrow\arg\min_w \left\{ \frac{1}{2n}\lVert X_t w-y_t\rVert^2 + \frac{\lambda}{2}\lVert w-w_{t-1}\rVert^2 \right\}

Output: wTw_T

Employing explicit regularization may become impractical in high-dimensional settings or over long task horizons, as it incurs a high computational cost (as we have to fully minimize the objective in 1). For this reason, we also study a gradient algorithm run for a finite number of steps, which naturally induces a form of implicit regularization ([1, 30]), while maintaining a relative small cost. In line with recent theoretical works ([8, 18]), we will mainly focus on this scheme and its relation to the optimal regularized L2 (isotropic) solution.

Algorithm 2 Continual linear regression with finite step budgets (Early-stopped GD)

Input: {(Xi,yi)}i=1T\{(\mathbf{X}_i,y_i)\}_{i=1}^{T}, inner step count NN, and step size γ\gamma

Initialize w0∈Rd\mathbf{w}_0 \in\mathbb{R}^d

For each task t=1,…,Tt = 1,\ldots,T:

    Initialize w(0)←wt−1\mathbf{w}^{(0)} \leftarrow\mathbf{w}_{t-1}

    For s=1,…,Ns = 1,\ldots,N:

        w(s)←w(s−1)−γ∇12n∥Xtw(s−1)−yt∥2\mathbf{w}^{(s)} \leftarrow\mathbf{w}^{(s-1)}-\gamma\nabla\frac{1}{2n}\lVert\mathbf{X}_t\mathbf{w}^{(s-1)}-\mathbf{y}_t\rVert^2

    wt←w(N)\mathbf{w}_t \leftarrow\mathbf{w}^{(N)}

Output wT\mathbf{w}_T

A widely used alternative that has been popular in recent empirical and theoretical works [17, 27, 34] considers continual learning through a quadratic regularization that penalizes deviations from the previous iterate as ∥w−wt−1∥Mt2=(w−wt−1)TMt(w−wt−1)\lVert\mathbf{w}-\mathbf{w}_{t-1}\rVert_{\mathbf{M}_t}^2=(\mathbf{w}-\mathbf{w}_{t-1})^{\mathsf{T}}\mathbf{M}_t(\mathbf{w}-\mathbf{w}_{t-1}), where Mt⪰0\mathbf{M}_t\succeq0 is a regularization matrix. This formulation generalizes the L2 regularization in Algorithm 1, which is recovered by setting Mt=λI\mathbf{M}_t=\lambda\mathbf{I}, it also encompasses regularization schemes such as Fisher-information methods.

Algorithm 3 Generalized L2 continual learning scheme

Input: {(Xi,yi)}i=1T\{(\mathbf{X}_i,y_i)\}_{i=1}^{T}, regularization matrices {Mt}t=1T\{\mathbf{M}_t\}_{t=1}^{T}

Initialize w0∈Rd\mathbf{w}_0 \in\mathbb{R}^d

For each iteration t=1,…,Tt = 1,\ldots,T:

    wt←arg⁡min⁡w{12n∥Xtw−yt∥2+12∥w−wt−1∥Mt2}\mathbf{w}_t \leftarrow\mathop{\arg\min}_{\mathbf{w}}\left\{\frac{1}{2n}\lVert\mathbf{X}_t\mathbf{w}-\mathbf{y}_t\rVert^2+\frac{1}{2}\lVert\mathbf{w}-\mathbf{w}_{t-1}\rVert_{\mathbf{M}_t}^2\right\}

Output: wT\mathbf{w}_T

In practice, due to memory and computational constraints, continual learning systems typically employ diagonal regularization matrices to selectively penalize deviations from previously learned predictors [17, 27, 2, 5], rather than maintaining a full d×dd\times d regularization matrix. Indeed, a full matrix can, in principle, eliminate forgetting entirely; see Evron et al. (2023, Proposition 5.5).

Setup: high dimensional data

Data model. In this paper, we consider a high-dimensional random design with independent feature matrices X1,…,XT\mathbf{X}_1,\ldots,\mathbf{X}_T, where each Xt∈Rn×d\mathbf{X}_t\in\mathbb{R}^{n\times d} has i.i.d. entries with zero mean, and variance vx>0v_x>0 with finite 4+ϵ4+\epsilon moment for some ϵ>0\epsilon>0, and an arbitrary initialization w0≜w0⋆\mathbf{w}_0\triangleq\mathbf{w}_0^\star. Moreover, the problem dimensions grow to infinity at a proportional rate α:=nd∈(0,∞)\alpha:=\frac{n}{d}\in(0,\infty).

For each task t∈[1,T]≜{1,…,T}t\in[1,T]\triangleq\{1,\ldots,T\}, labels are generated from a corresponding teacher vector wt⋆∈Rd\mathbf{w}_t^\star\in\mathbb{R}^d using a noisy linear model. That is,

yt=Xtwt⋆+zt,\mathbf{y}_t=\mathbf{X}_t\mathbf{w}_t^\star+\mathbf{z}_t,

where zt\mathbf{z}_t is a label noise vector, with E[zt]=0\mathbb{E}[\mathbf{z}_t]=0 and Cov⁡(zt)=vzI\operatorname{Cov}(\mathbf{z}_t)=v_z\mathbf{I} for some noise variance vz≥0v_z\geq0, sampled independently of all tasks. To ensure a well-behaved high-dimensional limit, we assume that the teacher correlations converge to finite deterministic limits and are uniformly integrable, i.e.

(wi⋆−wj⋆)T(wk⋆−wl⋆)→d→∞ri,j,k,l,∀i,j,k,l∈[0,T].(\mathbf{w}_i^\star-\mathbf{w}_j^\star)^{\mathsf{T}}(\mathbf{w}_k^\star-\mathbf{w}_l^\star)\xrightarrow[d\to\infty]{}r_{i,j,k,l},\qquad\forall i,j,k,l\in[0,T].

Evaluation metrics. Following recent theoretical work in continual learning [9, 18, 11], we evaluate the model error using the mean-squared-error (MSE) loss, that is, 1n∥Xiw−yi∥2\frac{1}{n}\lVert\mathbf{X}_i\mathbf{w}-\mathbf{y}_i\rVert^2, however, under our data model, averaging over independent test data and label noise, gives,

1nE∥Xiw−yi∥2=1nE∥Xi(w−wi⋆)−zi∥2=vx∥w−wi⋆∥2+vz.(1)\frac{1}{n}\mathbb{E}\lVert\mathbf{X}_i\mathbf{w}-\mathbf{y}_i\rVert^2=\frac{1}{n}\mathbb{E}\lVert\mathbf{X}_i(\mathbf{w}-\mathbf{w}_i^\star)-\mathbf{z}_i\rVert^2=v_x\lVert\mathbf{w}-\mathbf{w}_i^\star\rVert^2+v_z. \tag*{(1)}

Thus, the dependence of the expected loss on the predictor w\mathbf{w} is entirely captured by the distance ∥w−wi⋆∥\lVert\mathbf{w}-\mathbf{w}_i^\star\rVert. Consequently, following recent works [20, 34 Karpel et al.,] 2026), we measure performance through the distance between the predictor w\mathbf{w} and the corresponding teacher wi⋆\mathbf{w}^{\star}_{i}. This reduction allows us to formally define our metrics of interest.

Definition 1 (Task loss). For any predictor w∈Rd\mathbf{w} \in\mathbb{R}^{d}, the loss of the predictor in task i∈[1,T]i \in[1,T] is defined as the distance between the predictor and the teacher of the associated task, that is,

Li(w)=∥w−wi⋆∥2.\mathcal{L}_{i}(\mathbf{w}) = \lVert\mathbf{w} - \mathbf{w}^{\star}_{i} \rVert^{2}.

Definition 2 (Generalization error). At iteration tt, the generalization error is defined as the average task loss of the predictor wt∈Rd\mathbf{w}_{t} \in\mathbb{R}^{d} over all tasks observed up to time tt, that is,

Gt≜1t∑i=1tLi(wt)=1t∑i=1t∥wt−wi⋆∥2.G_{t} \triangleq\frac{1}{t}\sum_{i=1}^{t}\mathcal{L}_{i}(\mathbf{w}_{t}) = \frac{1}{t}\sum_{i=1}^{t}\lVert\mathbf{w}_{t} - \mathbf{w}^{\star}_{i} \rVert^{2}.

Notations. Throughout the paper, we use →P\xrightarrow{P} for convergence in probability. We let GTridgeG_{T}^{\mathrm{ridge}}, GTesgdG_{T}^{\mathrm{esgd}}, and GTgenG_{T}^{\mathrm{gen}} denote the generalization loss after TT iterations by Algorithms 1, 2, and 3, respectively.

Early-stopped GD generalization loss and the optimal step-size

In this section, we derive an exact closed-form expression for the generalization loss attained by the early-stopped GD algorithm (Algorithm 2). Through this section, we consider only the step sizes that ensure the convergence of the early-stopped GD algorithm, that is, γ<2λmax⁡(1nXTX)\gamma< \frac{2}{\lambda_{\max}(\frac{1}{n}\mathbf{X}^{\mathsf{T}}\mathbf{X})}, for generic X\mathbf{X} following the statistical setting described in § 3. Our key technical result is the following.

References

  1. [1]Alnur Ali, J Zico Kolter, and Ryan J Tibshirani. A continuous-time view of early stopping for least squares regression. In The 22nd international conference on artificial intelligence and statistics, pp. 1370–1378. PMLR, 2019.arxiv.org/abs/1810.10082
  2. [2]Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 139–154, 2018.arxiv.org/abs/1711.09601
  3. [3]Karl Johan Astrom and Richard M. Murray. Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press, 2008.
  4. [4]Frederik Benzing. Unifying importance based regularisation methods for continual learning. In International Conference on Artificial Intelligence and Statistics, pp. 2372–2396. PMLR, 2022.DOI
  5. [5]Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In Proceedings of the European conference on computer vision (ECCV), pp. 532–547, 2018.DOI
  6. [6]James W Cooley and John W Tukey. An algorithm for the machine calculation of complex fourier series. Mathematics of computation, 19(90):297–301, 1965.DOI
  7. [7]Romain Couillet and Zhenyu Liao. Random matrix methods for machine learning. Cambridge University Press, 2022.DOI
  8. [8]Meng Ding, Kaiyi Ji, Di Wang, and Jinhui Xu. Understanding forgetting in continual learning with linear regression. In Forty-first International Conference on Machine Learning, 2024.arxiv.org/abs/2405.17583
  9. [9]Itay Evron, Edward Moroshko, Rachel Ward, Nathan Srebro, and Daniel Soudry. How catastrophic can catastrophic forgetting be in linear regression? In Conference on Learning Theory (COLT), pp. 4028–4079. PMLR, 2022.arxiv.org/abs/2205.09588
  10. [10]Itay Evron, Edward Moroshko, Gon Buzaglo, Maroun Khriesh, Badea Marijeh, Nathan Srebro, and Daniel Soudry. Continual learning in linear classification on separable data. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pp. 9440–9484. PMLR, 23–29 Jul 2023.arxiv.org/abs/2306.03534
  11. [11]Itay Evron, Ran Levinstein, Matan Schliser­man, Uri Sherman, Tomer Koren, Daniel Soudry, and Nathan Srebro. From continual learning to SGD and back: Better rates for continual linear models. In 37th International Conference on Algorithmic Learning Theory, 2026.arxiv.org/abs/2504.04579
  12. [12]Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3 (4):128–135, 1999.
  13. [14]Yen-Chang Hsu, Yen-Cheng Liu, Anita Ramasamy, and Zsolt Kira. Re-evaluating continual learning scenarios: A categorization and case for strong baselines. arXiv preprint arXiv:1810.12488, 2018.arxiv.org/abs/1810.12488
  14. [15]Hyunji Jung, Hanseul Cho, and Chulhee Yun. Convergence and implicit bias of gradient descent on continual linear classification. In The Thirteenth International Conference on Learning Representations, 2025.arxiv.org/abs/2504.12712
  15. [16]Gilad Karpel, Edward Moroshko, Ran Levinstein, Ron Meir, Daniel Soudry, and Itay Evron. Optimal l2 regularization in high-dimensional continual linear regression. In Proceedings of The 37th International Conference on Algorithmic Learning Theory, 2026.arxiv.org/abs/2601.13844
  16. [17]James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114 (13):3521–3526, 2017.DOI
  17. [18]Ran Levinstein, Amit Attia, Matan Schliserman, Uri Sherman, Daniel Soudry, Tomer Koren, and Itay Evron. Optimal rates in continual linear regression via increasing regularization. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
  18. [19]Haoran Li, Jingfeng Wu, and Vladimir Braverman. Fixed design analysis of regularization-based continual learning. In Sarath Chandar, Razvan Pascanu, Hanie Sedghi, and Doina Precup (eds.), Proceedings of The 2nd Conference on Lifelong Learning Agents, volume 232 of Proceedings of Machine Learning Research, pp. 513–533. PMLR, 22–25 Aug 2023.arxiv.org/abs/2303.10263
  19. [20]Sen Lin, Peizhong Ju, Yingbin Liang, and Ness Shroff. Theory on forgetting and generalization of continual learning. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pp. 21078–21100. PMLR, 23–29 Jul 2023.arxiv.org/abs/2302.05836
  20. [21]Qipeng Liu, Luojun Lin, Zhifeng Shen, and Zhifeng Yang. Periodically Exchange Teacher-Student for Source-Free Object Detection . In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 6391–6401. IEEE Computer Society, 2023.arxiv.org/abs/2311.13930
  21. [22]Ekdeep Singh Lubana, Puja Trivedi, Danai Koutra, and Robert Dick. How do quadratic regularizers prevent catastrophic forgetting: The role of interpolation. In Conference on Lifelong Learning Agents, pp. 819–837. PMLR, 2022.arxiv.org/abs/2102.02805
  22. [23]Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989.DOI
  23. [24]Pratik Patil, Arun Kumar Kuchibhotla, Yuting Wei, and Alessandro Rinaldo. Mitigating multiple descents: A model-agnostic framework for risk monotonization. arXiv preprint arXiv:2205.12937, 2022.arxiv.org/abs/2205.12937
  24. [25]Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684–10695, 2022.arxiv.org/abs/2112.10752
  25. [26]Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghwasemipur, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in neural information processing systems, 35:36479–36494, 2022.arxiv.org/abs/2205.11487
  26. [27]Jonathan Schwarz, Wojciech Czarnecki, Jelena Luketina, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In Proceedings of the 35th International Conference on Machine Learning, pp. 4528–4537, 2018.arxiv.org/abs/1805.06370
  27. [28]Jack W Silverstein and Zhi Dong Bai. On the empirical distribution of eigenvalues of a class of large dimensional random matrices. Journal of Multivariate analysis, 54(2):175–192, 1995.DOI
  28. [29]James Seale Smith, Junjiao Tian, Shaunak Halbe, Yen-Chang Hsu, and Zsolt Kira. A closer look at rehearsal-free continual learning. In 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 2410–2420. IEEE, 2023.arxiv.org/abs/2203.17269
  29. [30]Rishi Sonthalia, Jackie Lok, and Elizaveta Rebrova. On regularization via early stopping for least squares regression. arXiv preprint arXiv:2406.04425, 2024.arxiv.org/abs/2406.04425
  30. [31]Matan Tsipory, Ran Levinstein, Itay Evron, Mark Kong, Deanna Needell, and Daniel Soudry. Are greedy task orderings better than random in continual linear regression? In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.arxiv.org/abs/2510.19941
  31. [32]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1706.03762
  32. [33]Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning, pp. 3987–3995. PMLR, 2017.arxiv.org/abs/1703.04200
  33. [34]Xuyang Zhao, Huiyuan Wang, Weiran Huang, and Wei Lin. A statistical theory of regularization-based continual learning. In Forty-first International Conference on Machine Learning, 2024.arxiv.org/abs/2406.06213
  34. [35]Yihan Zhao, Wenqing Su, and Ying Yang. High-dimensional asymptotics of generalization performance in continual ridge regression. arXiv preprint arXiv:2508.15494, 2025.arxiv.org/abs/2508.15494
  35. [36]Fei Zhu, Yujing Liu, Wenzhuo Liu, and Zhaoxiang Zhang. Global convergence of continual learning on non-iid data. arXiv preprint arXiv:2503.18511, 2025.arxiv.org/abs/2503.18511

Paper details

vlnc:W_m4px28vv
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents