语义搜索是一项重要的任务,目的是从数据库中找到相关索引以进行查询。它需要一个可以正确学习句子语义的检索模型。基于变压器的模型由于其出色的学习语义表示能力而被广泛用作检索模型。同时,还提出了许多适合它们的正则化方法。在本文中,我们提出了一种新的正则化方法:正则化对比度学习,可以帮助基于变压器的模型学习更好地表示句子。首先,它为每个句子增强了几个不同的语义表示,然后将它们作为监管机构的对比目标。这些对比调节器可以克服过度拟合的问题并减轻各向异性问题。我们首先使用优于预训练的模型Sroberta对7个语义搜索基准测试进行评估。结果表明,我们的方法更有效地学习了出色的句子表示。然后,我们评估具有长期查询和索引的2个具有挑战性的FAQ数据集,咳嗽和FAQIR。我们的实验结果表明,我们的方法表现优于基线方法。
translated by 谷歌翻译
This paper presents SimCSE, a simple contrastive learning framework that greatly advances state-of-the-art sentence embeddings. We first describe an unsupervised approach, which takes an input sentence and predicts itself in a contrastive objective, with only standard dropout used as noise. This simple method works surprisingly well, performing on par with previous supervised counterparts. We find that dropout acts as minimal data augmentation, and removing it leads to a representation collapse. Then, we propose a supervised approach, which incorporates annotated pairs from natural language inference datasets into our contrastive learning framework by using "entailment" pairs as positives and "contradiction" pairs as hard negatives. We evaluate SimCSE on standard semantic textual similarity (STS) tasks, and our unsupervised and supervised models using BERT base achieve an average of 76.3% and 81.6% Spearman's correlation respectively, a 4.2% and 2.2% improvement compared to the previous best results. We also show-both theoretically and empirically-that the contrastive learning objective regularizes pre-trained embeddings' anisotropic space to be more uniform, and it better aligns positive pairs when supervised signals are available. 1 2 We randomly sample 10 6 sentences from English Wikipedia and fine-tune BERTbase with learning rate = 3e-5, N = 64. In all our experiments, no STS training sets are used.
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 谷歌翻译
对比学习一直吸引着学习无监督的句子嵌入。当前的最新无监督方法是无监督的SIMCSE(UNSUP-SIMCSE)。 Unsup-Simcse将辍学作为最小数据增强方法,并将相同的输入句子传递给预训练的变压器编码器(带有掉落的掉落)两次,以获取两个相应的嵌入式以构建正对。由于句子的长度信息通常会由于使用嵌入变压器中的位置嵌入而编码到句子嵌入中,因此Unsup-Simcse中的每个正对实际上包含相同的长度信息。因此,接受这些正面对训练的Unsup-Simcse可能是有偏见的,这往往会考虑到语义上相同长度或相似长度的句子更相似。通过统计观察,我们发现Unsup-Simcse确实存在这样的问题。为了减轻它,我们应用了一个简单的重复操作来修改输入句子,然后分别将输入句子及其修改后的对应物传递给预训练的变压器编码器,以获取阳性对。此外,我们从计算机视觉社区中汲取灵感,并引入动量对比度,从而扩大了负面对的数量,而没有其他计算。提出的两种修改分别应用于正和负对,并构建一种新的句子嵌入方法,称为增强的Unsup-Simcse(ESIMCSE)。我们在几个基准数据集W.R.T上评估了所提出的ESIMCSE,语义文本相似性(STS)任务。实验结果表明,ESIMCSE的表现优于最先进的undup-Simcse,而Bert基碱的平均长矛相关性为2.02%。
translated by 谷歌翻译
对比度学习已逐渐应用于学习高质量的无监督句子嵌入。据我们所知,在以前的无监督方法中,最新的最新方法是无监督的SIMCSE(Unsup-Simcse)。 Unsup-Simcse在训练阶段使用Infonce1Loss功能,通过将语义上相似的句子拉在一起并分开不相似。从理论上讲,我们希望在Unsup-Simcse中使用较大的批次,以在样本中进行更充分的比较并避免过度拟合。但是,增加批量的大小并不总是会导致改进,而是在批处理大小超过阈值时会导致性能降解。通过统计观察,我们发现这可能是由于在批量生产大小后引入了低信心负对。为了减轻这个问题,我们在Infonce损失函数上引入了一种简单的平滑策略,称为Gaussian平滑infonce(GS-Infonce)。特别是,我们将随机的高斯噪声向量添加为负样品,它们的负面样品空间的平滑性。简单,提出的平滑策略为Unsup-Simcse带来了重大改进。我们评估GS-INFONCEON标准语义文本相似性(STS)任务。 GS-Infonce的平均长矛人相关性优于最先进的Unsup-Simcse,在Bert-Base,Bert-Large,Roberta-Base的基础上,长矛人的相关性为1.38%,0.72%,1.17%和0.28%和罗伯塔·洛尔格(Roberta-Large)。
translated by 谷歌翻译
已经研究了对比学习,以提高学习句嵌入的表现。当前的最先进的方法是SIMCSE,它将丢失作为数据增强方法,并馈送预训练的变压器编码器两次相同的输入句。相应的输出,两个句子嵌入来自不同丢弃掩码的相同句子,可用于构建正对。使用丢弃掩模应用的网络可以被视为ITSEF的子网,其预期比例由差动率决定。在本文中,我们推动具有不同预期尺度的子网,了解相同句子的类似嵌入。 SIMCSE未能这样做,因为它们将丢失率修复到调谐的超参数。我们通过从分布蚀刻前进过程中采样辍学率来实现这一目标。由于这种方法可能使优化更加困难,我们还提出了一种简单的句子掩模策略来采样更多子网。我们在几个流行的语义文本相似性数据集中评估了所提出的S-SIMCSE。实验结果表明,S-SIMCSE优于最先进的SIMCSE超过$ 1 \%$ ON BERT $ _ {base} $
translated by 谷歌翻译
We present Relational Sentence Embedding (RSE), a new paradigm to further discover the potential of sentence embeddings. Prior work mainly models the similarity between sentences based on their embedding distance. Because of the complex semantic meanings conveyed, sentence pairs can have various relation types, including but not limited to entailment, paraphrasing, and question-answer. It poses challenges to existing embedding methods to capture such relational information. We handle the problem by learning associated relational embeddings. Specifically, a relation-wise translation operation is applied to the source sentence to infer the corresponding target sentence with a pre-trained Siamese-based encoder. The fine-grained relational similarity scores can be computed from learned embeddings. We benchmark our method on 19 datasets covering a wide range of tasks, including semantic textual similarity, transfer, and domain-specific tasks. Experimental results show that our method is effective and flexible in modeling sentence relations and outperforms a series of state-of-the-art sentence embedding methods. https://github.com/BinWang28/RSE
translated by 谷歌翻译
在NLP中,句子的语义表示学习是一个重要且研究的问题。该任务的当前趋势涉及通过与文本的对比目标进行培训基于变压器的句子编码器,即具有语义上相似的含义并散布他人的聚类句子。在这项工作中,我们发现,通过使用另一种模式(例如,句子和不相关的图像/音频数据),使用多模式多任务损失的训练,可以通过多模式多任务损失进行训练来改进变压器模型的性能。特别是,除了通过文本的对比损失学习外,我们的模型簇还来自非语言域(例如,视觉/音频),同时具有相似的对比度损失。我们框架对未配对的非语言数据的依赖使IT语言不可思议,从而使其在英语NLP之外广泛适用。在7个语义文本相似性基准上进行的实验表明,经过其他非语言(图像/音频)对比目标训练的模型可导致更高质量的句子嵌入。这表明变压器模型能够通过执行类似的任务(即聚类),并以多任务方式的不同模式的示例来更好地概括。
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 谷歌翻译
最近的预训练的语言模型(PLM)通过学习语言特征和上下文化的句子表示,在许多自然语言处理任务上取得了巨大成功。由于未清楚地识别出在PLM的堆叠层中捕获的属性,因此通常首选嵌入最后一层的直接方法,而不是从PLM中得出句子表示。本文介绍了基于注意力的合并策略,该策略使该模型能够保留每一层中捕获的图层信号,并学习下游任务的消化语言特征。对比度学习目标可以使层面上的注意力汇集到无监督和监督的举止。它导致预先训练嵌入的各向异性空间并更均匀。我们评估我们的模型关于标准语义文本相似性(STS)和语义搜索任务。结果,我们的方法改善了基础对比度的BERT_BASE和变体的性能。
translated by 谷歌翻译
以前的无监督句子嵌入研究集中在数据增强方法上,例如辍学和基于规则的句子转换方法。但是,这些方法限制了控制句子增强观点的细粒语义。这导致监督信号不足以捕获类似句子的语义相似性。在这项工作中,我们发现使用邻居句子可以捕获相似句子之间更准确的语义相似性。基于这一发现,我们提出了RankEncoder,该发现使用了输入句子和语料库中的句子之间的关系来训练无监督的句子编码器。我们从三个角度评估rankencoder:1)语义文本相似性性能,2)相似句子对的功效,以及3)rankencoder的普遍性。实验结果表明,与先前的最新性能相比,Rankencoder达到80.07 \%Spearman的相关性,绝​​对提高了1.1%。在类似的句子对上,改进更加显着,改善了1.73%。另外,我们证明了RankEncoder普遍适用于现有的无监督句子编码器。
translated by 谷歌翻译
This paper presents E5, a family of state-of-the-art text embeddings that transfer well to a wide range of tasks. The model is trained in a contrastive manner with weak supervision signals from our curated large-scale text pair dataset (called CCPairs). E5 can be readily used as a general-purpose embedding model for any tasks requiring a single-vector representation of texts such as retrieval, clustering, and classification, achieving strong performance in both zero-shot and fine-tuned settings. We conduct extensive evaluations on 56 datasets from the BEIR and MTEB benchmarks. For zero-shot settings, E5 is the first model that outperforms the strong BM25 baseline on the BEIR retrieval benchmark without using any labeled data. When fine-tuned, E5 obtains the best results on the MTEB benchmark, beating existing embedding models with 40x more parameters.
translated by 谷歌翻译
最近,跨模式的预训练任务一直是一个热点,因为它在各种下文研究中广泛应用,包括检索,字幕,问题答案等。然而,退出的方法采用单媒体预训练模型来探索进行跨模式检索的联合视觉表示,这很容易遭受计算爆炸的影响。此外,尽管常规的双流结构非常有效,但它们仍然缺乏重要的跨模式相互作用,导致性能低。在这些挑战的激励下,我们提出了一个对比的跨模式知识共享预训练(Cookie),以掌握联合文本图像表示。从结构上讲,Cookie由于可接受的时间消耗而采用了传统的双流结构。为了克服上述双流结构的固有缺陷,我们精心设计了两个有效的模块。具体而言,第一个模块是一个体重共享的变压器,它构建在视觉和文本编码器的头上,旨在将语义对齐文本和图像对齐。该设计使视觉和文本路径集中在相同的语义上。另一个是三个专门设计的对比学习,旨在分享不同模型之间的知识。共享的跨模式知识大大发展了单峰表示的研究,从而促进了单模式检索任务。对多模式匹配研究的广泛实验结果,包括跨模式检索,文本匹配和图像检索揭示了我们的计算效率和我们预训练模型的统计指标的上级。
translated by 谷歌翻译
虽然对比学习大大提升了句子嵌入的表示,但它仍然受到现有句子数据集的大小的限制。在本文中,我们向Transaug(转换为增强),它提供了利用翻译句子对作为文本的数据增强的第一次探索,并介绍了两级范例,以提高最先进的句子嵌入。我们不是采用以其他语言设置培训的编码器,我们首先从SIMCSE编码器(以英语预先预先预订)蒸发蒸馏出一个汉语编码器,以便它们的嵌入在语义空间中靠近,这可以被后悔作为隐式数据增强。然后,我们只通过交叉语言对比学习更新英语编码器并将蒸馏的中文编码器冷冻。我们的方法在标准语义文本相似度(STS)上实现了一种新的最先进的,表现出SIMCSE和句子T5,以及由Senteval评估的传输任务的相应轨道中的最佳性能。
translated by 谷歌翻译
Universal cross-lingual sentence embeddings map semantically similar cross-lingual sentences into a shared embedding space. Aligning cross-lingual sentence embeddings usually requires supervised cross-lingual parallel sentences. In this work, we propose mSimCSE, which extends SimCSE to multilingual settings and reveal that contrastive learning on English data can surprisingly learn high-quality universal cross-lingual sentence embeddings without any parallel data. In unsupervised and weakly supervised settings, mSimCSE significantly improves previous sentence embedding methods on cross-lingual retrieval and multilingual STS tasks. The performance of unsupervised mSimCSE is comparable to fully supervised methods in retrieving low-resource languages and multilingual STS. The performance can be further enhanced when cross-lingual NLI data is available. Our code is publicly available at https://github.com/yaushian/mSimCSE.
translated by 谷歌翻译
The effective application of contrastive learning technology in natural language processing tasks shows the superiority of contrastive learning in text analysis tasks. How to construct positive and negative samples correctly and reasonably is the core challenge of contrastive learning. Since it is difficult to construct contrastive objects in multi-label multi-classification tasks, there are few contrastive losses for multi-label multi-classification text classification. In this paper, we propose five contrastive losses for multi-label multi-classification tasks. They are Strict Contrastive Loss (SCL), Intra-label Contrastive Loss (ICL), Jaccard Similarity Contrastive Loss (JSCL), and Jaccard Similarity Probability Contrastive Loss (JSPCL) and Stepwise Label Contrastive Loss (SLCL). We explore the effectiveness of contrastive learning for multi-label multi-classification tasks under different strategies, and provide a set of baseline methods for contrastive learning techniques on multi-label classification tasks. We also perform an interpretability analysis of our approach to show how different contrastive learning methods play their roles. The experimental results in this paper demonstrate that our proposed contrastive losses can bring some improvement for multi-label multi-classification tasks. Our work reveal how to "appropriately" change the contrastive way of contrastive learning is the key idea to improve the adaptability of contrastive learning in multi-label multi-classification tasks.
translated by 谷歌翻译
Incorporating contrastive learning objectives in sentence representation learning (SRL) has yielded significant improvements on many sentence-level NLP tasks. However, It is not well understood why contrastive learning works for learning sentence-level semantics. In this paper, we take a closer look at contrastive sentence representation learning through the lens of isotropy and learning dynamics. We interpret its success stories through the geometry of the representation shifts. We show that contrastive learning brings isotropy, and surprisingly learns to converge tokens to similar positions in the semantic space if given the signal that they are in the same sentence. Also, what we formalize as "spurious contextualization" is mitigated for semantically meaningful tokens, while augmented for functional ones. The embedding space is pushed toward the origin during training, with more areas now better defined. We ablate these findings by observing the learning dynamic with different training temperatures, batch sizes and pooling methods. With these findings, we aim to shed light on future designs of sentence representation learning methods.
translated by 谷歌翻译
构建一个通用视频语言模型,用于解决各种视频理解任务(例如,文本视频检索,视频问答)是对机器学习领域的开放挑战。为了实现这一目标,最近的尝试训练模型,通常由单峰和跨模式的特征编码器组成,并具有受监督或成对的对比度的预文本任务。尽管提供了有吸引力的通用性,但最终的模型必须在效率和性能之间妥协。我们认为这些缺陷是由它们的预训练策略\ Textemdash引起的,它们不能很好地对齐和融合不同方式的特征。然后,我们将三叶草(一种相关的视频预培训方法)介绍给一个通用的视频语言模型,该模型用于解决既不效率也不妥协的多个视频理解任务。它通过新的三模式比对预训练任务来改善跨模式特征对齐和融合。此外,我们建议通过合并蒙面样品的学习和新颖的成对排名损失来增强三模式对齐。三叶草表现出了出色的一般性。它在多个下游任务上建立了新的最新技术,包括零射击和微调设置的三个检索任务,以及八个视频问答任务。代码和预培训模型将在https://github.com/leeyn-43/clover上发布。
translated by 谷歌翻译
存在预训练模型在各种文本分类任务上取得了最先进的性能。这些模型已被证明可用于学习普遍语言表示。然而,通过先进的预训练模型无法有效地区分类似文本之间的语义差异,这对难以区分类的性能产生了很大的影响。为了解决这个问题,我们在这项工作中提出了一种与标签距离(CLLD)的新型对比学习。灵感来自最近对比学习的进步,我们专门设计了一种具有标签距离的分类方法,用于学习对比类。 CLLD可确保在导致不同标签分配的细微差别中的灵活性,并为同时具有相似性的每个类生成不同的表示。关于公共基准和内部数据集的广泛实验表明,我们的方法提高了预先训练模型在分类任务上的性能。重要的是,我们的实验表明,学习的标签距离减轻了细胞的对抗性质。
translated by 谷歌翻译