我们介绍了一种新的损失函数TriplePropy,提高微调普通知识的分类性能,基于交叉熵和软损失。这种损失功能可以通过跨熵损失改善强大的罗伯拉基线模型,大约(0.02% - 2.29%)。对流行数据集的彻底测试表示稳定增益。训练数据集中的样品越小,增益越高,对于小型数据集而言,其为0.78%,用于中等大小 - 0.86%,大约0.20%,超大0.04%。
translated by 谷歌翻译
This paper presents an analysis regarding an influence of the Distance Metric Learning (DML) loss functions on the supervised fine-tuning of the language models for classification tasks. We experimented with known datasets from SentEval Transfer Tasks. Our experiments show that applying the DML loss function can increase performance on downstream classification tasks of RoBERTa-large models in few-shot scenarios. Models fine-tuned with the use of SoftTriple loss can achieve better results than models with a standard categorical cross-entropy loss function by about 2.89 percentage points from 0.04 to 13.48 percentage points depending on the training dataset. Additionally, we accomplished a comprehensive analysis with explainability techniques to assess the models' reliability and explain their results.
translated by 谷歌翻译
Distance Metric Learning (DML) has attracted much attention in image processing in recent years. This paper analyzes its impact on supervised fine-tuning language models for Natural Language Processing (NLP) classification tasks under few-shot learning settings. We investigated several DML loss functions in training RoBERTa language models on known SentEval Transfer Tasks datasets. We also analyzed the possibility of using proxy-based DML losses during model inference. Our systematic experiments have shown that under few-shot learning settings, particularly proxy-based DML losses can positively affect the fine-tuning and inference of a supervised language model. Models tuned with a combination of CCE (categorical cross-entropy loss) and ProxyAnchor Loss have, on average, the best performance and outperform models with only CCE by about 3.27 percentage points -- up to 10.38 percentage points depending on the training dataset.
translated by 谷歌翻译
对比的学习技术已广泛用于计算机视野中作为增强数据集的手段。在本文中,我们将这些对比学习嵌入的使用扩展到情绪分析任务,并证明了对这些嵌入的微调在基于BERT的嵌入物上的微调方面提供了改进,以在评估时实现更高的基准。在Dynasent DataSet上。我们还探讨了我们的微调模型在跨域基准数据集上执行的。此外,我们探索了ups采样技术,以实现更平衡的班级分发,以进一步改进我们的基准任务。
translated by 谷歌翻译
最近,已证明有监督的对比度学习(SCL)在大多数分类任务中都能取得出色的表现。在SCL中,对神经网络进行了训练,可以优化两个目标:在嵌入空间中将锚定和阳性样品一起拉在一起,并将锚点推开。但是,这两个不同的目标可能需要冲突,需要在优化期间之间进行权衡。在这项工作中,我们将SCL问题作为Roberta语言模型的微调阶段的多目标优化问题。使用两种方法来解决优化问题:(i)线性标量(LS)方法,该方法可最大程度地减少持久性损失的加权线性组合; (ii)确切的帕累托最佳(EPO)方法,该方法找到了帕累托正面与给定优先矢量的相交。我们在不使用数据增强,内存库或生成对抗性示例的情况下评估了几个胶合基准任务的方法。经验结果表明,提出的学习策略大大优于强大的竞争性学习基线
translated by 谷歌翻译
BERT (Devlin et al., 2018) and RoBERTa has set a new state-of-the-art performance on sentence-pair regression tasks like semantic textual similarity (STS). However, it requires that both sentences are fed into the network, which causes a massive computational overhead: Finding the most similar pair in a collection of 10,000 sentences requires about 50 million inference computations (~65 hours) with BERT. The construction of BERT makes it unsuitable for semantic similarity search as well as for unsupervised tasks like clustering.In this publication, we present Sentence-BERT (SBERT), a modification of the pretrained BERT network that use siamese and triplet network structures to derive semantically meaningful sentence embeddings that can be compared using cosine-similarity. This reduces the effort for finding the most similar pair from 65 hours with BERT / RoBERTa to about 5 seconds with SBERT, while maintaining the accuracy from BERT.We evaluate SBERT and SRoBERTa on common STS tasks and transfer learning tasks, where it outperforms other state-of-the-art sentence embeddings methods. 1
translated by 谷歌翻译
句子嵌入通常用于文本聚类和语义检索任务中。最先进的句子表示方法基于大量手动标记句子对集合的人工神经网络。高资源语言(例如英语或中文)可以使用足够数量的注释数据。在不太受欢迎的语言中,必须使用多语言模型,从而提供较低的性能。在本出版物中,我们通过提出一种培训有效的语言特定句子编码的方法来解决此问题,而无需手动标记数据。我们的方法是从句子对准双语文本语料库中自动构建释义对数据集。然后,我们使用收集的数据来微调具有附加复发池层的变压器语言模型。我们的句子编码器可以在不到一天的时间内在一张图形卡上进行培训,从而在各种句子级的任务上实现高性能。我们在波兰语中评估了八个语言任务的方法,并将其与最佳可用多语言句子编码器进行比较。
translated by 谷歌翻译
存在预训练模型在各种文本分类任务上取得了最先进的性能。这些模型已被证明可用于学习普遍语言表示。然而,通过先进的预训练模型无法有效地区分类似文本之间的语义差异,这对难以区分类的性能产生了很大的影响。为了解决这个问题,我们在这项工作中提出了一种与标签距离(CLLD)的新型对比学习。灵感来自最近对比学习的进步,我们专门设计了一种具有标签距离的分类方法,用于学习对比类。 CLLD可确保在导致不同标签分配的细微差别中的灵活性,并为同时具有相似性的每个类生成不同的表示。关于公共基准和内部数据集的广泛实验表明,我们的方法提高了预先训练模型在分类任务上的性能。重要的是,我们的实验表明,学习的标签距离减轻了细胞的对抗性质。
translated by 谷歌翻译
自然语言处理的进步(NLP)正在通过实际应用和学术利益的形式传播各个域。本质上,法律域包含大量数据以文本格式。因此,它需要将NLP应用于迎合对域的分析要求苛刻的需求。识别法律案例中的重要句子,事实和论点是法律专业人员这么繁琐的任务。在本研究中,我们探讨了句子嵌入的使用,以确定法律案件中的重要句子,在案件中的主要缔约方的角度。此外,定义了特定于任务的丢失功能,以提高通过分类交叉熵损失的直接使用限制的准确性。
translated by 谷歌翻译
句子嵌入方法有许多成功的应用。但是,根据监督信号,在结果句子嵌入中捕获了哪些属性。在本文中,我们专注于具有相似体系结构和任务的两种类型的嵌入方法:一种关于自然语言推理任务的微型预训练的语言模型,以及其他微型训练的训练语言模型在单词预测任务上根据其定义句子,并研究其属性。具体而言,我们使用两个角度分区的STS数据集比较他们在语义文本相似性(STS)任务上的性能:1)句子源和2)句子对的表面相似性,并在下游和探测任务上比较其表现。此外,我们尝试结合两种方法,并证明将两种方法组合起来比无监督的STS任务和下游任务的各自方法的性能要好得多。
translated by 谷歌翻译
我们提供了从文本到文本变换器(T5)的第一次探索句子嵌入式。句子嵌入式广泛适用于语言处理任务。虽然T5在作为序列到序列映射问题的语言任务上实现令人印象深刻的性能,但目前尚不清楚如何从编码器解码器模型生成陈列嵌入的句子。我们调查三种方法提取T5句子嵌入方法:两个仅利用T5编码器,一个使用全T5编码器解码器模型。为了支持我们的调查,我们建立了一个新的句子代表转移基准,SentGlue,它将Senteval Toolkit扩展到粘合基准的九个任务。我们的编码器的型号优于Senteval和SentGlue传输任务的句子 - BERT和SIMCSE句子嵌入,包括语义文本相似性(STS)。发现从数百万到数十亿参数的缩放T5产生一致的进一步改进。最后,我们的编码器 - 解码器方法在使用句子嵌入时在STS上实现了新的最先进的。我们的模型在https://tfhub.dev/google/collections/sentence-t5/1发布。
translated by 谷歌翻译
Contrastive learning has become a new paradigm for unsupervised sentence embeddings. Previous studies focus on instance-wise contrastive learning, attempting to construct positive pairs with textual data augmentation. In this paper, we propose a novel Contrastive learning method with Prompt-derived Virtual semantic Prototypes (ConPVP). Specifically, with the help of prompts, we construct virtual semantic prototypes to each instance, and derive negative prototypes by using the negative form of the prompts. Using a prototypical contrastive loss, we enforce the anchor sentence embedding to be close to its corresponding semantic prototypes, and far apart from the negative prototypes as well as the prototypes of other sentences. Extensive experimental results on semantic textual similarity, transfer, and clustering tasks demonstrate the effectiveness of our proposed model compared to strong baselines. Code is available at https://github.com/lemon0830/promptCSE.
translated by 谷歌翻译
对比学习被出现为强大的代表学习方法,促进各种下游任务,特别是当监督数据有限时。如何通过数据增强构建有效的对比样本是其成功的关键。与视觉任务不同,语言任务中尚未对对比学习进行对比学习的数据增强方法。在本文中,我们提出了一种使用文本摘要构建语言任务的对比样本的新方法。我们使用这些样本进行监督的对比学习,以获得更好的文本表示,这极大地利用了具有有限注释的文本分类任务。为了进一步改进该方法,除了交叉熵损失之外,我们将从不同类中的样本混合并添加一个名为MIXSUM的额外正则化。真实世界文本分类数据集(Amazon-5,Yelp-5,AG新闻和IMDB)的实验展示了基于摘要的数据增强和MIXSUM正规化的提议对比学习框架的有效性。
translated by 谷歌翻译
文本分类的对比预制技术已经在一个无人监督的环境中进行了很大程度上。但是,通常可以使用与当前任务共享标签语义的相关任务的数据。我们假设使用此标记数据有效地导致当前任务的更好的概括。在本文中,我们提出了一种新的方法来利用基于曲线图的监督对比学习方法有效地利用相关任务的标记数据。我们通过将监督信息从示例推断到令牌来制定令牌图。我们的配方导致嵌入空间的嵌入空间,其中具有相同类的高/低概率的令牌彼此接近/进一步。我们还开发了详细的理论见解,该洞察力作为我们方法的动机。在我们的实验中,我们将展示我们的方法以2.5美元的价格优于预先预订计划,以及基于1,8 \%$ 1.8 \%$ 1.8 \%$ 1.8 \%$ 1.8 \%$ 1.8 \%。此外,我们在零击设置中显示了我们的方法的跨域效果,平均每次3.91 \%$ 3.91 \%。最后,我们还展示了我们的方法可以用作知识蒸馏设定中的嘈杂教师,以显着提高基于变压器的模型在低标记的数据制度中的性能,平均为4.57 \%$ 4.57 \%。
translated by 谷歌翻译
数据增强是通过转换为机器学习的人工创建数据的人工创建,是一个跨机器学习学科的研究领域。尽管它对于增加模型的概括功能很有用,但它还可以解决许多其他挑战和问题,从克服有限的培训数据到正规化目标到限制用于保护隐私的数据的数量。基于对数据扩展的目标和应用的精确描述以及现有作品的分类法,该调查涉及用于文本分类的数据增强方法,并旨在为研究人员和从业者提供简洁而全面的概述。我们将100多种方法划分为12种不同的分组,并提供最先进的参考文献来阐述哪种方法可以通过将它们相互关联,从而阐述了哪种方法。最后,提供可能构成未来工作的基础的研究观点。
translated by 谷歌翻译
自我监督的学习方法,如对比学习,在自然语言处理中非常重视。它使用对培训数据增强对具有良好表示能力的编码器构建分类任务。然而,在对比学习的学习成对的构建在NLP任务中更难。以前的作品生成单词级更改以形成对,但小变换可能会导致句子含义的显着变化作为自然语言的离散和稀疏性质。在本文中,对对抗的训练在NLP的嵌入空间中产生了挑战性和更难的学习对抗性示例作为学习对。使用对比学学习提高了对抗性培训的泛化能力,因为对比损失可以使样品分布均匀。同时,对抗性培训也提高了对比学习的稳健性。提出了两种小说框架,监督对比对抗学习(SCAS)和无监督的SCAS(USCAL),通过利用对比学习的对抗性培训来产生学习成对。利用基于标签的监督任务丢失,以产生对抗性示例,而无监督的任务会带来对比损失。为了验证所提出的框架的有效性,我们将其雇用到基于变换器的模型,用于自然语言理解,句子语义文本相似性和对抗学习任务。胶水基准任务的实验结果表明,我们的微调监督方法优于BERT $ _ {基础} $超过1.75 \%。我们还评估我们对语义文本相似性(STS)任务的无监督方法,并且我们的方法获得77.29 \%with bert $ _ {base} $。我们方法的稳健性在NLI任务的多个对抗性数据集下进行最先进的结果。
translated by 谷歌翻译
学习高质量的对话表示对于解决各种面向对话的任务至关重要,尤其是考虑到对话系统通常会遇到数据稀缺。在本文中,我们介绍了对话句子嵌入(DSE),这是一种自我监督的对比学习方法,它学习有效的对话表示,适合各种对话任务。 DSE通过连续进行与对比度学习的正面对话的连续对话来从对话中学习。尽管它很简单,但DSE的表现能力比其他对话表示和普遍的句子表示模型要好得多。我们评估DSE的五个下游对话任务,这些任务检查了不同语义粒度的对话表示。几次射击和零射击设置的实验表明,DSE的表现要优于基线。例如,它在6个数据集中的1-Shot意图分类中比最强的无监督基线实现了13%的平均绩效提高。我们还提供了有关模型的好处和局限性的分析。
translated by 谷歌翻译
The recent GPT-3 model (Brown et al., 2020) achieves remarkable few-shot performance solely by leveraging a natural-language prompt and a few task demonstrations as input context. Inspired by their findings, we study few-shot learning in a more practical scenario, where we use smaller language models for which fine-tuning is computationally efficient. We present LM-BFF-better few-shot fine-tuning of language models 1 -a suite of simple and complementary techniques for finetuning language models on a small number of annotated examples. Our approach includes (1) prompt-based fine-tuning together with a novel pipeline for automating prompt generation; and (2) a refined strategy for dynamically and selectively incorporating demonstrations into each context. Finally, we present a systematic evaluation for analyzing few-shot performance on a range of NLP tasks, including classification and regression. Our experiments demonstrate that our methods combine to dramatically outperform standard fine-tuning procedures in this low resource setting, achieving up to 30% absolute improvement, and 11% on average across all tasks. Our approach makes minimal assumptions on task resources and domain expertise, and hence constitutes a strong task-agnostic method for few-shot learning. 2 * The first two authors contributed equally. 1 Alternatively, language models' best friends forever. 2 Our implementation is publicly available at https:// github.com/princeton-nlp/LM-BFF.
translated by 谷歌翻译
最近,与“预训练,及时和预测”的新范式相比,与“预训练,微调”范式相比,新的范式“预训练,及时和预测”取得了显着的成就。在基于及时的GPT-3成功之后,一系列基于蒙版的语言模型(MLM)(例如Bert,Roberta)及时学习方法变得流行并广泛使用。但是,另一个有效的预训练的判别模型Electra可能被忽略了。在本文中,我们尝试使用拟议的替换代替令牌检测(RTD)基于基于的及时学习方法来完成零摄像的几个NLP任务。实验结果表明,基于RTD-Prompt学习的Electra模型可达到令人惊讶的最先进的零拍性能。在数字上,与MLM-Roberta-Large和MLM-Bert-Large相比,我们的RTD-Electra-Large在所有15个任务上平均提高了约8.4%和13.7%。特别是在SST-2任务上,我们的RTD-Electra-Large在没有任何培训数据的情况下达到了令人惊讶的90.1%精度。总体而言,与预先训练的蒙版语言模型相比,预先训练的代替令牌检测模型在零拍学习中的性能更好。因此,Electra是一位出色的零球学习者。源代码可在以下网址获得:https://github.com/nishiwen1214/rtd-electra。
translated by 谷歌翻译
We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations from Transformers. Unlike recent language representation models (Peters et al., 2018a;Radford et al., 2018), BERT is designed to pretrain deep bidirectional representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result, the pre-trained BERT model can be finetuned with just one additional output layer to create state-of-the-art models for a wide range of tasks, such as question answering and language inference, without substantial taskspecific architecture modifications.BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).
translated by 谷歌翻译