arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.01774cs.LGstat.ML

经过训练的Transformer分类器具备泛化能力且呈现上下文内良性过拟合现象

Trained Transformer Classifiers Generalize and Exhibit Benign Overfitting In-Context

UC Davis(加州大学戴维斯分校);Weizmann Institute of Science(魏茨曼科学研究院)

Spencer Frei, Gal Vardi

AI总结:

该研究针对随机线性分类任务下训练的线性Transformer,通过分析梯度下降隐式正则化明确其泛化的条件,并证实其存在上下文内良性过拟合现象,即记忆带噪样本仍能对干净样本近最优泛化。

摘要:

Transformer具备充当监督学习算法的能力:通过将一组带标签的训练(“上下文内”)样本与一个无标签测试样本恰当编码为相同维度向量构成的输入序列,Transformer的前向传播即可为该无标签测试样本生成预测。近期一系列研究表明,当线性Transformer在线性回归任务的随机实例上预训练时,这些经训练的Transformer会采用与普通最小二乘法类似的算法进行预测。本文研究了在随机线性分类任务上训练的线性Transformer的行为表现。通过分析梯度下降的隐式正则化特性,我们明确了经训练的Transformer在测试时实现良好泛化所需的预训练任务数量与上下文内样本数量。我们进一步证明,在部分设定下,这些经训练的Transformer会呈现“上下文内良性过拟合”:当上下文内样本因标签翻转噪声被破坏时,Transformer会记忆所有上下文内样本(包括带噪声标签的样本),但对干净测试样本仍能实现接近最优的泛化效果。

英文摘要:

Transformers have the capacity to act as supervised learning algorithms: by properly encoding a set of labeled training ("in-context") examples and an unlabeled test example into an input sequence of vectors of the same dimension, the forward pass of the transformer can produce predictions for that unlabeled test example. A line of recent work has shown that when linear transformers are pre-trained on random instances for linear regression tasks, these trained transformers make predictions using an algorithm similar to that of ordinary least squares. In this work, we investigate the behavior of linear transformers trained on random linear classification tasks. Via an analysis of the implicit regularization of gradient descent, we characterize how many pre-training tasks and in-context examples are needed for the trained transformer to generalize well at test-time. We further show that in some settings, these trained transformers can exhibit "benign overfitting in-context": when in-context examples are corrupted by label flipping noise, the transformer memorizes all of its in-context examples (including those with noisy labels) yet still generalizes near-optimally for clean test examples.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑