Finite Sample Analysis and Bounds of Generalization Error of Gradient Descent in In-Context Linear Regression
Karthik Duraisamy
TL;DR
The paper investigates finite-sample generalization bounds for a single gradient-descent step in in-context linear regression under a random-design setting, deriving non-asymptotic bounds on the generalization error $E_{gen}$ that avoid arbitrary constants. It contrasts these bounds with classical least squares results, decomposing error into systematic and noise components and identifying an optimal step size $\u03b7^*$, with scaling relations in terms of $n$ and $d$. The analysis yields explicit, robust expressions and highlights the practical implications for in-context learning and gradient-based updates in linear models. A byproduct of the work is a set of identities involving high-order products of Gaussian random matrices, enriching the toolbox for random-matrix calculations in statistical learning.
Abstract
Recent studies show that transformer-based architectures emulate gradient descent during a forward pass, contributing to in-context learning capabilities - an ability where the model adapts to new tasks based on a sequence of prompt examples without being explicitly trained or fine tuned to do so. This work investigates the generalization properties of a single step of gradient descent in the context of linear regression with well-specified models. A random design setting is considered and analytical expressions are derived for the statistical properties and bounds of generalization error in a non-asymptotic (finite sample) setting. These expressions are notable for avoiding arbitrary constants, and thus offer robust quantitative information and scaling relationships. These results are contrasted with those from classical least squares regression (for which analogous finite sample bounds are also derived), shedding light on systematic and noise components, as well as optimal step sizes. Additionally, identities involving high-order products of Gaussian random matrices are presented as a byproduct of the analysis.
