中文学习是指模型在及时序列中条件条件的能力,该序列由内部下文示例(输入输出对,与某些任务相对应)以及新的查询输入,并生成相应的输出。至关重要的是,内在学习仅在推理时间发生,而没有任何参数更新模型。尽管大型语言模型(例如GPT-3)具有某种能力来执行中文学习的能力,但尚不清楚任务成功的任务之间的关系以及培训数据中存在的内容。为了取得进步朝着理解文本学习的进步,我们考虑了训练模型的明确定义的问题,以学习函数类(例如,线性函数):也就是说,给定的数据从类中的某些功能衍生而成,可以我们训练一个模型以在此课程中学习“大多数”功能?我们从经验上表明,可以从头开始训练标准变压器,以执行线性函数的文本学习 - 也就是说,训练有素的模型能够从具有与最佳最小二乘估计器相当的性能的示例中学习看不见的线性函数。实际上,即使在两种形式的分配变化下,也可能进行中文学习:(i)模型的训练数据和推理时间提示之间,以及(ii)在推理过程中的内在示例和查询输入之间。我们还表明,我们可以训练变形金刚在文本中学习更多复杂的功能类,即稀疏线性功能,两层神经网络和决策树 - 具有匹配或超过特定于任务特定的学习算法的性能。我们的代码和模型可在https://github.com/dtsip/in-context-learning上找到。
translated by 谷歌翻译
Neural sequence models, especially transformers, exhibit a remarkable capacity for in-context learning. They can construct new predictors from sequences of labeled examples $(x, f(x))$ presented in the input without further parameter updates. We investigate the hypothesis that transformer-based in-context learners implement standard learning algorithms implicitly, by encoding smaller models in their activations, and updating these implicit models as new examples appear in the context. Using linear regression as a prototypical problem, we offer three sources of evidence for this hypothesis. First, we prove by construction that transformers can implement learning algorithms for linear models based on gradient descent and closed-form ridge regression. Second, we show that trained in-context learners closely match the predictors computed by gradient descent, ridge regression, and exact least-squares regression, transitioning between different predictors as transformer depth and dataset noise vary, and converging to Bayesian estimators for large widths and depths. Third, we present preliminary evidence that in-context learners share algorithmic features with these predictors: learners' late layers non-linearly encode weight vectors and moment matrices. These results suggest that in-context learning is understandable in algorithmic terms, and that (at least in the linear case) learners may rediscover standard estimation algorithms. Code and reference implementations are released at https://github.com/ekinakyurek/google-research/blob/master/incontext.
translated by 谷歌翻译
Modern machine learning requires system designers to specify aspects of the learning pipeline, such as losses, architectures, and optimizers. Meta-learning, or learning-to-learn, instead aims to learn those aspects, and promises to unlock greater capabilities with less manual effort. One particularly ambitious goal of meta-learning is to train general-purpose in-context learning algorithms from scratch, using only black-box models with minimal inductive bias. Such a model takes in training data, and produces test-set predictions across a wide range of problems, without any explicit definition of an inference model, training loss, or optimization algorithm. In this paper we show that Transformers and other black-box models can be meta-trained to act as general-purpose in-context learners. We characterize phase transitions between algorithms that generalize, algorithms that memorize, and algorithms that fail to meta-train at all, induced by changes in model size, number of tasks, and meta-optimization. We further show that the capabilities of meta-trained algorithms are bottlenecked by the accessible state size (memory) determining the next prediction, unlike standard models which are thought to be bottlenecked by parameter count. Finally, we propose practical interventions such as biasing the training distribution that improve the meta-training and meta-generalization of general-purpose learning algorithms.
translated by 谷歌翻译
In this work, we explore "prompt tuning," a simple yet effective mechanism for learning "soft prompts" to condition frozen language models to perform specific downstream tasks. Unlike the discrete text prompts used by GPT-3, soft prompts are learned through backpropagation and can be tuned to incorporate signals from any number of labeled examples. Our end-to-end learned approach outperforms GPT-3's few-shot learning by a large margin. More remarkably, through ablations on model size using T5, we show that prompt tuning becomes more competitive with scale: as models exceed billions of parameters, our method "closes the gap" and matches the strong performance of model tuning (where all model weights are tuned). This finding is especially relevant because large models are costly to share and serve and the ability to reuse one frozen model for multiple downstream tasks can ease this burden. Our method can be seen as a simplification of the recently proposed "prefix tuning" of Li and Liang (2021) and we provide a comparison to this and other similar approaches. Finally, we show that conditioning a frozen model with soft prompts confers benefits in robustness to domain transfer and enables efficient "prompt ensembling." * Work done as a Google AI Resident.
translated by 谷歌翻译
Transformers have become the state-of-the-art neural network architecture across numerous domains of machine learning. This is partly due to their celebrated ability to transfer and to learn in-context based on few examples. Nevertheless, the mechanisms by which Transformers become in-context learners are not well understood and remain mostly an intuition. Here, we argue that training Transformers on auto-regressive tasks can be closely related to well-known gradient-based meta-learning formulations. We start by providing a simple weight construction that shows the equivalence of data transformations induced by 1) a single linear self-attention layer and by 2) gradient-descent (GD) on a regression loss. Motivated by that construction, we show empirically that when training self-attention-only Transformers on simple regression tasks either the models learned by GD and Transformers show great similarity or, remarkably, the weights found by optimization match the construction. Thus we show how trained Transformers implement gradient descent in their forward pass. This allows us, at least in the domain of regression problems, to mechanistically understand the inner workings of optimized Transformers that learn in-context. Furthermore, we identify how Transformers surpass plain gradient descent by an iterative curvature correction and learn linear models on deep data representations to solve non-linear regression tasks. Finally, we discuss intriguing parallels to a mechanism identified to be crucial for in-context learning termed induction-head (Olsson et al., 2022) and show how it could be understood as a specific case of in-context learning by gradient descent learning within Transformers.
translated by 谷歌翻译
“感应头”是注意力头,它实现了一种简单的算法来完成令牌序列,例如[a] [b] ... [a] - > [b]。在这项工作中,我们提供了一个假设的初步和间接证据,即诱导头可能构成大型大型变压器模型中所有“文本学习”中大多数的机制(即减少在增加代币指数时损失的损失)。我们发现,诱导头在与秘密学习能力突然急剧上的急剧上升的位置完全相同,这是训练损失的颠簸。我们提出了六种互补的证据,认为诱导头可能是任何大小的变压器模型中一般性内部学习的机理来源。对于仅关注的小型模型,我们提供了有力的因果证据。对于具有MLP的较大模型,我们提供相关证据。
translated by 谷歌翻译
当我们扩大数据集,模型尺寸和培训时间时,深入学习方法的能力中存在越来越多的经验证据。尽管有一些关于这些资源如何调节统计能力的说法,但对它们对模型培训的计算问题的影响知之甚少。这项工作通过学习$ k $ -sparse $ n $ bits的镜头进行了探索,这是一个构成理论计算障碍的规范性问题。在这种情况下,我们发现神经网络在扩大数据集大小和运行时间时会表现出令人惊讶的相变。特别是,我们从经验上证明,通过标准培训,各种体系结构以$ n^{o(k)} $示例学习稀疏的平等,而损失(和错误)曲线在$ n^{o(k)}后突然下降。 $迭代。这些积极的结果几乎匹配已知的SQ下限,即使没有明确的稀疏性先验。我们通过理论分析阐明了这些现象的机制:我们发现性能的相变不到SGD“在黑暗中绊倒”,直到它找到了隐藏的特征集(自然算法也以$ n^中的方式运行{o(k)} $ time);取而代之的是,我们表明SGD逐渐扩大了人口梯度的傅立叶差距。
translated by 谷歌翻译
目前,难以获得贝叶斯方法深入学习的好处,这允许明确的知识规范,准确地捕获模型不确定性。我们呈现先前数据拟合网络(PFN)。 PFN利用大规模机器学习技术来近似一组一组后索。 PFN唯一要求工作的要求是能够从先前分配通过监督的学习任务(或函数)来采样。我们的方法将后近似的目标重新定为具有带有值的输入的监督分类问题:它反复从先前绘制任务(或功能),从中绘制一组数据点及其标签,掩盖其中一个标签并学习基于其余数据点的设定值输入对其进行概率预测。呈现来自新的监督学习任务的一组样本作为输入,PFNS在单个前向传播中对任意其他数据点进行概率预测,从而学习到近似贝叶斯推断。我们展示了PFN可以接近完全模仿高斯过程,并且还可以实现高效的贝叶斯推理对难以处理的问题,与当前方法相比,多个设置中有超过200倍的加速。我们在非常多样化的地区获得强烈的结果,如高斯过程回归,贝叶斯神经网络,小型表格数据集的分类,以及少量图像分类,展示了PFN的一般性。代码和培训的PFN在https://github.com/automl/transformerscandobayesianinference发布。
translated by 谷歌翻译
我们探索一种以数据为基础的学习方法来优化神经网络。我们构建神经网络检查点的数据集,并培训有关参数的生成模型。特别是,我们的模型是一个条件扩散变压器,鉴于初始输入参数向量以及提示的丢失,误差或返回,可以预测实现所需度量的参数更新的分布。在测试时,它可以在一个更新中优化具有看不见的参数的神经网络。我们发现我们的方法成功地生成了各种损失提示的参数。此外,它可以采样多模式参数解决方案,并具有有利的缩放属性。我们将方法应用于监督和强化学习中的不同神经网络体系结构和任务。
translated by 谷歌翻译
Diffusion models have quickly become the go-to paradigm for generative modelling of perceptual signals (such as images and sound) through iterative refinement. Their success hinges on the fact that the underlying physical phenomena are continuous. For inherently discrete and categorical data such as language, various diffusion-inspired alternatives have been proposed. However, the continuous nature of diffusion models conveys many benefits, and in this work we endeavour to preserve it. We propose CDCD, a framework for modelling categorical data with diffusion models that are continuous both in time and input space. We demonstrate its efficacy on several language modelling tasks.
translated by 谷歌翻译
我们查看模型可解释性的特定方面:模型通常需要限制在大小上才能被认为是可解释的,例如,深度5的决策树比深度50中的一个更容易解释。但是,较小的模型也倾向于高偏见。这表明可解释性和准确性之间的权衡。我们提出了一种模型不可知论技术,以最大程度地减少这种权衡。我们的策略是首先学习甲骨文,这是培训数据上高度准确的概率模型。 Oracle预测的不确定性用于学习培训数据的抽样分布。然后,对使用此分布获得的数据样本进行了可解释的模型,通常会导致精确度明显更高。我们将抽样策略作为优化问题。我们的解决方案1具有以下关键的有利属性:(1)它使用固定数量的七个优化变量,而与数据的维度(2)无关,它是模型不可知的 - 因为可解释的模型和甲骨文都可能属于任意性模型家族(3)它具有模型大小的灵活概念,并且可以容纳向量大小(4)它是一个框架,使其能够从优化领域的进度中受益。我们还提出了以下有趣的观察结果:(a)通常,小型模型大小的最佳训练分布与测试分布不同; (b)即使可解释的模型和甲骨文来自高度截然不同的模型家族,也存在这种效果:我们通过使用封闭的复发单位网络作为甲骨文来提高决策树的序列分类精度,从而在文本分类任务上显示此效果。使用字符n-grams; (c)对于模型,我们的技术可用于确定给定样本量的最佳训练样本。
translated by 谷歌翻译
无需进行任何架构更改的微调审计语言模型(LMS)已成为学习下游任务各种语言的规范。但是,对于非语言下游任务,一种常见的做法是使用特定于任务的设计来进行输入,输出层和损失功能。例如,可以通过用图像补丁嵌入层替换单词嵌入层,带有10向输出层的单词图表输出层以及单词预测丢失,将LM微调为MNIST分类器。 - 分别分类损失。出现一个自然的问题:LM微调可以在不更改模型架构或损失功能的情况下解决非语言的下游任务吗?为了回答这一点,我们提出了语言交织的微调(LIFT),并通过对非语言分类和回归任务的套件进行广泛的经验研究来研究其功效和局限性。 Lift不会对模型体系结构或损失功能进行任何更改,它仅依赖于自然语言界面,从而使“使用LMS进行无代码机”学习。我们发现,在各种低维分类和回归任务中,LIFT的性能相对较好,在许多情况下匹配了最佳基线的性能,尤其是对于分类任务。我们报告了有关升力的基本特性的实验结果,包括其电感偏差,样品效率,推断出外推能力,对异常值的鲁棒性和标签噪声以及概括。我们还分析了一些特定于提升的属性/技术,例如,通过适当提示,预测不确定性量化和两阶段微调,上下文感知学习。我们的代码可从https://github.com/uw-madison-lee-lab/languageinterfacefacefacefinetuning获得。
translated by 谷歌翻译
非常大的预培训的语言模型(PTM)(如GPT-3)通常被释放为服务,允许用户设计特定于任务的提示以通过一些黑盒API查询PTMS。在这样的场景中,我们调用语言模型 - AS-Service(LMAAS),PTM的梯度通常不可用。我们可以通过仅访问模型推断API来优化任务提示吗?基于最近的观察结果,大型PTMS具有非常低的内在维度,这项工作提出了黑匣子调谐,通过无衍生算法优化PTM。特别是,我们通过迭代调用PTM推断API来调用CMA-es以优化预先提示的连续提示。我们的实验结果表明,黑匣子调整罗伯塔在少数标签样本上不仅显着优于手动提示和GPT-3的上下文学习,而且还超越了基于梯度的对应物,即提示调整和完整的模型调整。
translated by 谷歌翻译
大多数机器学习算法由一个或多个超参数配置,必须仔细选择并且通常会影响性能。为避免耗时和不可递销的手动试验和错误过程来查找性能良好的超参数配置,可以采用各种自动超参数优化(HPO)方法,例如,基于监督机器学习的重新采样误差估计。本文介绍了HPO后,本文审查了重要的HPO方法,如网格或随机搜索,进化算法,贝叶斯优化,超带和赛车。它给出了关于进行HPO的重要选择的实用建议,包括HPO算法本身,性能评估,如何将HPO与ML管道,运行时改进和并行化结合起来。这项工作伴随着附录,其中包含关于R和Python的特定软件包的信息,以及用于特定学习算法的信息和推荐的超参数搜索空间。我们还提供笔记本电脑,这些笔记本展示了这项工作的概念作为补充文件。
translated by 谷歌翻译
State-of-the-art computer vision systems are trained to predict a fixed set of predetermined object categories. This restricted form of supervision limits their generality and usability since additional labeled data is needed to specify any other visual concept. Learning directly from raw text about images is a promising alternative which leverages a much broader source of supervision. We demonstrate that the simple pre-training task of predicting which caption goes with which image is an efficient and scalable way to learn SOTA image representations from scratch on a dataset of 400 million (image, text) pairs collected from the internet. After pre-training, natural language is used to reference learned visual concepts (or describe new ones) enabling zero-shot transfer of the model to downstream tasks. We study the performance of this approach by benchmarking on over 30 different existing computer vision datasets, spanning tasks such as OCR, action recognition in videos, geo-localization, and many types of fine-grained object classification. The model transfers non-trivially to most tasks and is often competitive with a fully supervised baseline without the need for any dataset specific training. For instance, we match the accuracy of the original ResNet-50 on ImageNet zero-shot without needing to use any of the 1.28 million training examples it was trained on. We release our code and pre-trained model weights at https://github.com/OpenAI/CLIP.
translated by 谷歌翻译
Learning curves provide insight into the dependence of a learner's generalization performance on the training set size. This important tool can be used for model selection, to predict the effect of more training data, and to reduce the computational complexity of model training and hyperparameter tuning. This review recounts the origins of the term, provides a formal definition of the learning curve, and briefly covers basics such as its estimation. Our main contribution is a comprehensive overview of the literature regarding the shape of learning curves. We discuss empirical and theoretical evidence that supports well-behaved curves that often have the shape of a power law or an exponential. We consider the learning curves of Gaussian processes, the complex shapes they can display, and the factors influencing them. We draw specific attention to examples of learning curves that are ill-behaved, showing worse learning performance with more training data. To wrap up, we point out various open problems that warrant deeper empirical and theoretical investigation. All in all, our review underscores that learning curves are surprisingly diverse and no universal model can be identified.
translated by 谷歌翻译
当前部署的公钥密码系统将容易受到全面量子计算机的攻击。因此,“抗量子”密码系统的需求量很高,基于晶格的密码系统基于一个被称为学习错误的学习(LWE)的严重问题,已成为标准化的强有力的竞争者。在这项工作中,我们训练变压器执行模块化算术,并将半训练的模型与统计密码分析技术相结合,以提出莎莎:对基于LWE的密码学方案的机器学习攻击。Salsa可以完全恢复具有稀疏二进制秘密的小型至中型LWE实例的秘密,并可能扩展以攻击现实世界中基于LWE的密码系统。
translated by 谷歌翻译
大多数设置深度学习的预测模型,使用Set-Scifariant操作,但它们实际上在MultiSet上运行。我们表明设置的函数不能代表多种功能上的某些功能,因此我们介绍了更适当的多种式概念概念。我们确定现有的深度设置预测网络(DSPN)可以是多机构的,而不会被设定的标准规模阻碍,并通过近似隐式差分改进它,允许更好地优化,同时更快和节省存储器。在一系列玩具实验中,我们表明,多机构的角度是有益的,在大多数情况下,我们对DSPN的变化达到了更好的结果。关于CLEVR对象性质预测,由于通过隐含分化所取得的益处,我们在最先进的评估指标中从8%到77%的最先进的槽注意力从8%提高到77%。
translated by 谷歌翻译
通常通过将许多输入张量汇总为单个表示形式来处理神经网络中神经网络中的处理集或其他无序的,潜在的变化大小的输入。尽管从简单的汇总到多头关注已经存在许多聚合方法,但从理论和经验的角度来看,它们的代表力都受到限制。在搜索主要功能更强大的聚合策略时,我们提出了一种基于优化的方法,称为平衡聚​​集。我们表明,许多现有的聚合方法可以作为平衡聚集的特殊情况恢复,并且在某些重要情况下,它效率更高。在许多现有的架构和应用中,平衡聚集可以用作置换式替换。我们在三个不同的任务上验证其效率:中值估计,班级计数和分子性质预测。在所有实验中,平衡聚集的性能都比我们测试的其他聚合技术更高。
translated by 谷歌翻译
我们介绍了SubGD,这是一种新颖的几声学习方法,基于最近的发现,即随机梯度下降更新往往生活在低维参数子空间中。在实验和理论分析中,我们表明模型局限于合适的预定义子空间,可以很好地推广用于几次学习。合适的子空间符合给定任务的三个标准:IT(a)允许通过梯度流量减少训练误差,(b)导致模型良好的模型,并且(c)可以通过随机梯度下降来识别。 SUBGD从不同任务的更新说明的自动相关矩阵的特征组合中标识了这些子空间。明确的是,我们可以识别出低维合适的子空间,用于对动态系统的几次学习,而动态系统具有不同的属性,这些属性由分析系统描述的一个或几个参数描述。这种系统在科学和工程领域的现实应用程序中无处不在。我们在实验中证实了SubGD在三个不同的动态系统问题设置上的优势,在样本效率和性能方面,均超过了流行的几次学习方法。
translated by 谷歌翻译