线性Transformer在少量任务预训练后,能对噪声数据保持良好泛化能力。
Trained Transformer Classifiers Generalize and Exhibit Benign Overfitting In-Context
- 通过梯度下降隐式正则化,分析预训练任务与上下文样本数量对泛化的影响。
- 在特定条件下,即使记忆错误标签也能实现接近最优的测试性能。
- 适用于研究模型泛化机制或设计鲁棒的少样本学习系统。
Transformer具备作为监督学习算法的能力:将带标签的训练样本(上下文)和未标记的测试样本编码为相同维度的向量序列,其前向传播即可生成测试样本的预测结果。近期研究发现,当线性Transformer在随机实例上预训练用于线性回归任务时,其预测行为类似于普通最小二乘法。本文研究了线性Transformer在随机线性分类任务上的表现。通过分析梯度下降的隐式正则化,我们刻画了达到良好测试泛化所需的预训练任务数和上下文样本数。进一步表明,在某些设置下,这些训练好的Transformer可表现出“上下文中的良性过拟合”:当上下文样本存在标签翻转噪声时,模型会完全记忆所有上下文样本(包括含噪标签),但仍能对干净测试样本实现近乎最优的泛化性能。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。