stat.MLAug 31, 2025

When is Fine-Tuning Scalable? Certified Recovery from Noisy Data and Linear-Cost Fine-Tuning on Structured Task Shifts

Authors: Anastasis Kratsios, Tin Sum Cheng, Bum Jun Kim, Daniel Roy

Organizations: Department of Mathematics, McMaster University, Canada · Department of Mathematics and Computer Science, University of Basel, Switzerland · Department of Statistical Sciences, University of Toronto, Canada · Vector Institute, Canada

Abstract

Transformers often transfer across related tasks with little fine-tuning; we study this question in noisy nonparametric regression for continuous maps f,g:[0,1]d→RDf,g:[0,1]^d\to\mathbb{R}^D, representing the source and shifted tasks, using a single-query, single-head transformer T(⋅)=VSoftmax⁡(−α(⋅,K))\mathcal{T}(\cdot)=V\operatorname{Softmax}(-α(\cdot,K)) with ℓ∞\ell^{\infty}-based alignment scores αα. Rather than assume that gradient-based training reaches an empirical risk minimizer, we give a model-specific two-stage procedure certifying source-task recovery and out-of-distribution (OOD) adaptation. With high probability, the resulting attention head recovers ff to arbitrary accuracy ε>0\varepsilon>0 in every fixed Lp([0,1]d)L^p([0,1]^d) norm, 1≤p<∞1\le p<\infty, from noisy observations. For Lipschitz targets, its rate is minimax-optimal up to logarithmic factors without assuming oracle access to an asymptotic ERM. If D=1D=1 and ff is Pfaffian than the values matrix factors into ACAC with AA scaling at-most linearly O(ε−1)\mathcal{O}(\varepsilon^{-1}) in the reciprocal approximation error ε>0\varepsilon>0. Importantly, our training procedure encodes all our identified (potentially) shared geometric structure from ff only into the values matrix factor CC and the keys matrix KK allowing for rapid access, and all ff-specific structure only into AA. Our main result concerns the OOD phase; where we identify geometric structures, which if shared by the source ff and OOD gg task; then only only the values matrix factor AA needs to be fine-tuned to guarantee an LpL^p-recovery of gg. Critically, fine-tuning only AA is a convex problem which involving an at-most linear number of parameters O(ε−1)\mathcal{O}(\varepsilon^{-1}); dramatically cutting down on the worst-case scaling of O(ε−d)\mathcal{O}(\varepsilon^{-\mathbf{d}}) unavoidable in the source-training phase.

Figures & tables

Explore similar work

Sep 29, 2026

Theory on Attention Dynamics for Out-of-Distribution In-Context Learning

Transformers have demonstrated remarkable in-context learning (ICL) capabilities, enabling them to perform new tasks without additional fine-tuning. However, their performance often deteriorates when encountering out-of-distribution (OOD) inputs that deviate from the training distribution, and the underlying theory remains poorly understood. To fill this gap, we characterize the OOD error under the input distribution shift through the interplay between the dynamics of the so-called αα-type and ββ-type attention weights, which represent the transformer's confidence in identifying the correct and incorrect features, respectively. Our results indicate that the OOD error for each feature depends on all pairwise interactions between the training features and OOD features, and under certain cases the transformer performs no better than random guessing. To improve the OOD generalization performance, we next investigate the impact of model finetuning with the OOD data, and particularly, characterize the model forgetting performance on the source domain. Interestingly, the performance on the source domain may not always degrade after finetuning, which highly depends on the nature of the feature shift: finetuning on OOD domain keeps enhancing the confidence of identifying correct features from the original distribution, while the interference from other incorrect features may either increase or decrease. Extensive experiments on both synthetic and real data are conducted to corroborate the theoretical insights.
Jul 18, 2026

First-Order Predictable but Pairwise Fragile: Local Task Adaptation in Trained Transformers

Task arithmetic, sequential fine-tuning, activation steering, and first-order random search all operate through relatively small perturbations around an already trained checkpoint, and they rely on different local approximations: individual perturbations should be first-order predictable, task updates should compose with controlled interference, useful tangent structure should be stable and possible to estimate, and weight edits should have counterparts in representation space. We measure 8 such properties with the same harness around a multitask LoRA operating point, on 9 transformers (82M-7B), with a prospectively registered property list, thresholds, and test split. We find a shared one-direction validity window up to the tested scale 10−210^{-2}, but no universal radius for pairwise composition or update ordering. Along individual directions, changes of the probe loss remain first-order predictable throughout the grid: a perturbation's effect on the loss is essentially its projection onto the gradient, which is also what makes local random search work. Pairwise structure, however, proves to be far more fragile: on over a third of the measured (model, task pair) combinations, two-update order sensitivity sets in strictly inside that window; task-gradient subspaces rotate within tens of steps; additivity under our fixed activation probe fails at full task-vector scale on several models, including both held-out 7B models; and no model median passes the registered global mean-vector weight-to-steering correspondence bar. For two sequential task-gradient steps, the leading order-dependent term is the Lie bracket HBgA−HAgBH_B\textbf{g}_A-H_A\textbf{g}_B; its normalized prediction c(η)=ηκ+O(η2)c(η)=ηκ+O(η^2) tracks the measured defect at median ratio 1.002, while the onset scale η†≈0.10/κη^\dagger\approx0.10/κ spans three orders of magnitude across models and task pairs.
Sep 13, 2026

Retrieval-Guided Fine-Tuning as Noisy Estimation: Risk bounds and Architectural Analysis

Retrieval-Guided Fine-Tuning (RAG-FT) incorporates retrieved data directly into the training objective, but the statistical consequences of noisy retrieval during training remain theoretically undercharacterized. We study this question by modeling RAG-FT as an estimation problem in a multi-task linear regression framework, using an OLS proxy for single-layer linear self-attention to obtain finite-sample risk bounds. Under homoscedastic retrieval noise, we show that retrieval failure decays exponentially with task separation relative to noise, and derive explicit finite-sample conditions under which RAG-FT achieves lower risk than both target-only and full-corpus training. We then introduce a Distance-Proportional Noise (DPN) model, in which retrieval quality degrades with rank, and compare two estimators under the same retrieval process: the OLS proxy and the literal, uniform-weight forward pass of linear self-attention. We prove that the attention estimator's bias diverges as Θ(n2q)Θ(n^{2q}) even under exact retrieval, while OLS risk remains Θ(d/n)Θ(d/n) for every noise exponent q>0q>0. These results locate the instability not in noisy retrieval itself, but in the fixed, unweighted aggregation of the literal LSA forward pass, which reweighting by reliability empirically removes. We validate the predicted rate separation through direct simulation of the DPN model.