Knowledge distillation (KD) has been widely used for model compression and knowledge transfer. Typically, a big teacher model trained on sufficient data transfers knowledge to a small student model. However, despite the success of KD, little effort has been made to study whether KD leaks the training data of the teacher model. In this paper, we experimentally reveal that KD suffers from the risk of privacy leakage. To alleviate this issue, we propose a novel knowledge distillation method, swing distillation, which can effectively protect the private information of the teacher model from flowing to the student model. In our framework, the temperature coefficient is dynamically and adaptively adjusted according to the degree of private information contained in the data, rather than a predefined constant hyperparameter. It assigns different temperatures to tokens according to the likelihood that a token in a position contains private information. In addition, we inject noise into soft targets provided to the student model, in order to avoid unshielded knowledge transfer. Experiments on multiple datasets and tasks demonstrate that the proposed swing distillation can significantly reduce (by over 80% in terms of canary exposure) the risk of privacy leakage in comparison to KD with competitive or better performance. Furthermore, swing distillation is robust against the increasing privacy budget.
translated by 谷歌翻译
机器学习中的知识蒸馏是将知识从名为教师的大型模型转移到一个名为“学生”的较小模型的过程。知识蒸馏是将大型网络(教师)压缩到较小网络(学生)的技术之一,该网络可以部署在手机等小型设备中。当教师和学生之间的网络规模差距增加时,学生网络的表现就会下降。为了解决这个问题,在教师模型和名为助教模型的学生模型之间采用了中间模型,这反过来弥补了教师与学生之间的差距。在这项研究中,我们已经表明,使用多个助教模型,可以进一步改进学生模型(较小的模型)。我们使用加权集合学习将这些多个助教模型组合在一起,我们使用了差异评估优化算法来生成权重值。
translated by 谷歌翻译
Language model pre-training, such as BERT, has significantly improved the performances of many natural language processing tasks. However, pre-trained language models are usually computationally expensive, so it is difficult to efficiently execute them on resourcerestricted devices. To accelerate inference and reduce model size while maintaining accuracy, we first propose a novel Transformer distillation method that is specially designed for knowledge distillation (KD) of the Transformer-based models. By leveraging this new KD method, the plenty of knowledge encoded in a large "teacher" BERT can be effectively transferred to a small "student" Tiny-BERT. Then, we introduce a new two-stage learning framework for TinyBERT, which performs Transformer distillation at both the pretraining and task-specific learning stages. This framework ensures that TinyBERT can capture the general-domain as well as the task-specific knowledge in BERT. TinyBERT 41 with 4 layers is empirically effective and achieves more than 96.8% the performance of its teacher BERT BASE on GLUE benchmark, while being 7.5x smaller and 9.4x faster on inference. TinyBERT 4 is also significantly better than 4-layer state-of-the-art baselines on BERT distillation, with only ∼28% parameters and ∼31% inference time of them. Moreover, TinyBERT 6 with 6 layers performs on-par with its teacher BERT BASE .
translated by 谷歌翻译
Although continually extending an existing NMT model to new domains or languages has attracted intensive interest in recent years, the equally valuable problem of continually improving a given NMT model in its domain by leveraging knowledge from an unlimited number of existing NMT models is not explored yet. To facilitate the study, we propose a formal definition for the problem named knowledge accumulation for NMT (KA-NMT) with corresponding datasets and evaluation metrics and develop a novel method for KA-NMT. We investigate a novel knowledge detection algorithm to identify beneficial knowledge from existing models at token level, and propose to learn from beneficial knowledge and learn against other knowledge simultaneously to improve learning efficiency. To alleviate catastrophic forgetting, we further propose to transfer knowledge from previous to current version of the given model. Extensive experiments show that our proposed method significantly and consistently outperforms representative baselines under homogeneous, heterogeneous, and malicious model settings for different language pairs.
translated by 谷歌翻译
最近,非自动增加(NAT)模型并行地预测输出,与自回归(AT)模型相比,实现了产生速度的大量改进。在对原始数据上表现更差的同时,大多数NAT模型都被培训为在教师模型生成的蒸馏数据上的学生模型,称为序列级知识蒸馏。提高模型性能的有效培训策略是自蒸馏混合(SDM)培训,预先训练原始数据模型,通过预先训练的模型本身产生蒸馏数据,最后重新列举模型原始数据和蒸馏数据的组合。在这项工作中,我们的目标是查看NAT模型的SDM,但发现直接采用SDM到NAT模型在翻译质量方面没有改进。通过仔细分析,我们观察失效与教师模型与NAT学生模型的建模和确认偏差相关。基于这些发现,我们提出了一种增强的策略,通过向经典SDM添加两个阶段来提高名为SDMRT的策略:一个是在自蒸馏数据上进行预重磅,另一个是对滤波后的教师蒸馏数据进行微调。我们的结果在多个NAT模型上以0.6至1.2 bleu表示基础。作为另一个奖励,对于迭代细化NAT模型,我们的方法可以在半迭代号内倾斜基线,这意味着2x加速度。
translated by 谷歌翻译
将最新的变压器模型蒸馏成轻量级的学生模型是降低推理时计算成本的有效方法。学生模型通常是紧凑的变压器,参数较少,而昂贵的操作(例如自我发项)持续存在。因此,对于实时或大量用例,提高的推理速度仍然不令人满意。在本文中,我们旨在通过将教师模型提炼成更大,更稀疏的学生模型来进一步推动推理速度的极限 - 更大的是它们扩展到数十亿个参数;稀疏,大多数模型参数是N-gram嵌入。我们对六个单词文本分类任务的实验表明,这些学生模型平均保留了罗伯塔大师教师表现的97%,同时推理时GPU和CPU的加速速度最高为600倍。进一步的调查表明,我们的管道也有助于句子对分类任务和域泛化设置。
translated by 谷歌翻译
已经证明了对比学习适合学习句子嵌入,可以显着提高语义文本相似性(STS)任务。最近,大型对比学习模型,例如句子T5倾向于学到更强大的句子嵌入。虽然有效,但由于计算资源或时间成本限制,这种大型型号很难在线服务。为了解决这个问题,通常采用知识蒸馏(KD),这可以将大型“教师”模型压缩成一个小的“学生”模型,但通常会遭受一些性能损失。在这里,我们提出了一个增强的KD框架,称为蒸馏 - 对比度(迪斯科)。所提出的迪斯科框架首先利用KD将大句子嵌入模型的能力转移到大型未标记数据的小学生模型,然后在标记的训练数据上具有对比学习的学生模型。对于迪斯科舞厅的KD进程,我们进一步提出了对比的知识蒸馏(CKD),以增强教师模型培训,KD和学生模型的一致性,这可能会提高迅速学习的表现。 7 STS基准测试的广泛实验表明,使用所提出的迪斯科和CKD培训的学生模型很少或甚至没有性能损失,并且始终如一地优于相同参数大小的相应对应物。令人惊讶的是,我们的110米学生模型甚至可以优于最新的最新(SOTA)模型,即句子T5(11B),只有1%的参数。
translated by 谷歌翻译
由于许多微调预先训练的语言模型〜(PLMS)具有有希望的性能,因此慷慨地释放,研究了重用这些模型的更好方法至关重要,因为它可以大大降低再培训计算成本和潜在的环境副作用。在本文中,我们探索了一种小型模型重用范式,知识合并〜(ka)。如果没有人为注释,KA旨在将来自不同教师的知识合并到一个专门从事不同的分类问题中的知识,进入多功能的学生模型。实现这一目标,我们设计了模型不确定感知知识合并〜(Muka)框架,其使用Monte-Carlo辍学来识别潜在的足够教师,以估计金色监督指导学生。实验结果表明,Muka在基准数据集上实现了对基准的基本改进。进一步的分析表明,Muka可以通过多个教师模型,异构教师,甚至交叉数据集教师概括很好的复杂设置。
translated by 谷歌翻译
我们从任务特定的BERT基教师模型执行知识蒸馏(KD)基准到各种学生模型:Bilstm,CNN,Bert-Tiny,Bert-Mini和Bert-small。我们的实验涉及在两个任务中分组的12个数据集:印度尼西亚语言中的文本分类和序列标记。我们还比较蒸馏的各个方面,包括使用Word Embeddings和未标记的数据增强的使用。我们的实验表明,尽管基于变压器的模型的普及程度不断上升,但是使用Bilstm和CNN学生模型,与修剪的BERT模型相比,使用Bilstm和CNN学生模型提供了性能和计算资源(CPU,RAM和存储)之间的最佳权衡。我们进一步提出了一些快速胜利,通过涉及涉及丢失功能,Word Embeddings和未标记的数据准备的简单选择的高效KD培训机制来生产小型NLP模型。
translated by 谷歌翻译
在多种方式知识蒸馏研究的背景下,现有方法主要集中在唯一的学习教师最终产出问题。因此,教师网络与学生网络之间存在深处。有必要强制学生网络来学习教师网络的模态关系信息。为了有效利用从教师转移到学生的知识,采用了一种新的模型关系蒸馏范式,通过建模不同的模态之间的关系信息,即学习教师模级克矩阵。
translated by 谷歌翻译
Knowledge Distillation (KD) has been extensively used for natural language understanding (NLU) tasks to improve a small model's (a student) generalization by transferring the knowledge from a larger model (a teacher). Although KD methods achieve state-of-the-art performance in numerous settings, they suffer from several problems limiting their performance. It is shown in the literature that the capacity gap between the teacher and the student networks can make KD ineffective. Additionally, existing KD techniques do not mitigate the noise in the teacher's output: modeling the noisy behaviour of the teacher can distract the student from learning more useful features. We propose a new KD method that addresses these problems and facilitates the training compared to previous techniques. Inspired by continuation optimization, we design a training procedure that optimizes the highly non-convex KD objective by starting with the smoothed version of this objective and making it more complex as the training proceeds. Our method (Continuation-KD) achieves state-of-the-art performance across various compact architectures on NLU (GLUE benchmark) and computer vision tasks (CIFAR-10 and CIFAR-100).
translated by 谷歌翻译
在本文中,我们探讨了一个新的知识障碍问题,称为联合选择性聚合(FEDSA)。 FEDSA的目的是在几位分散的教师的帮助下培训学生模型,以完成一项新任务,他们的预培训任务和数据是不同且不可知的。我们调查此类问题设置的动机源于最近的模型共享困境。许多研究人员或机构已经在培训大型且称职的网络上花费了巨大的资源。由于隐私,安全或知识产权问题,他们也无法分享自己的预培训模型,即使他们希望为社区做出贡献。拟议的FEDSA提供了解决这一困境的解决方案,并使其更进一步,因为学识渊博的学生可以专门从事与所有老师不同的新任务。为此,我们提出了一种处理FEDSA的专门战略。具体而言,我们的学生培训过程是由一种新型的基于显着性的方法驱动的,该方法可以适应教师作为参与者,并将其代表性能力融入到学生中。为了评估FEDSA的有效性,我们在单任务和多任务设置上进行实验。实验结果表明,FEDSA有效地将分散模型的知识融合在一起,并将竞争性能达到集中式基准。
translated by 谷歌翻译
立场检测旨在确定文本的作者是否赞成,反对或中立。这项任务的主要挑战是两个方面的:由于不同目标以及缺乏目标的上下文信息而产生的几乎没有学习。现有作品主要通过设计基于注意力的模型或引入嘈杂的外部知识来解决第二期,而第一个问题仍未探索。在本文中,受到预训练的语言模型(PLM)的潜在能力(PLM)的启发,我们建议介绍基于立场检测的及时基于迅速的微调。 PLM可以为目标提供基本的上下文信息,并通过提示启用几次学习。考虑到目标在立场检测任务中的关键作用,我们设计了目标感知的提示并提出了一种新颖的语言。我们的语言器不会将每个标签映射到具体单词,而是将每个标签映射到矢量,并选择最能捕获姿势与目标之间相关性的标签。此外,为了减轻通过单人工提示来处理不同目标的可能缺陷,我们建议将信息从多个提示中学到的信息提炼。实验结果表明,我们提出的模型在全数据和少数场景中的表现出色。
translated by 谷歌翻译
基于可穿戴传感器的人类动作识别(HAR)最近取得了杰出的成功。但是,基于可穿戴传感器的HAR的准确性仍然远远落后于基于视觉模式的系统(即RGB视频,骨架和深度)。多样化的输入方式可以提供互补的提示,从而提高HAR的准确性,但是如何利用基于可穿戴传感器的HAR的多模式数据的优势很少探索。当前,可穿戴设备(即智能手表)只能捕获有限的非视态模式数据。这阻碍了多模式HAR关联,因为它无法同时使用视觉和非视态模态数据。另一个主要挑战在于如何在有限的计算资源上有效地利用可穿戴设备上的多模式数据。在这项工作中,我们提出了一种新型的渐进骨骼到传感器知识蒸馏(PSKD)模型,该模型仅利用时间序列数据,即加速度计数据,从智能手表来解决基于可穿戴传感器的HAR问题。具体而言,我们使用来自教师(人类骨架序列)和学生(时间序列加速度计数据)模式的数据构建多个教师模型。此外,我们提出了一种有效的渐进学习计划,以消除教师和学生模型之间的绩效差距。我们还设计了一种称为自适应信心语义(ACS)的新型损失功能,以使学生模型可以自适应地选择其中一种教师模型或所需模拟的地面真实标签。为了证明我们提出的PSKD方法的有效性,我们对伯克利-MHAD,UTD-MHAD和MMACT数据集进行了广泛的实验。结果证实,与以前的基于单传感器的HAR方法相比,提出的PSKD方法具有竞争性能。
translated by 谷歌翻译
Real-world tasks are largely composed of multiple models, each performing a sub-task in a larger chain of tasks, i.e., using the output from a model as input for another model in a multi-model pipeline. A model like MATRa performs the task of Crosslingual Transliteration in two stages, using English as an intermediate transliteration target when transliterating between two indic languages. We propose a novel distillation technique, EPIK, that condenses two-stage pipelines for hierarchical tasks into a single end-to-end model without compromising performance. This method can create end-to-end models for tasks without needing a dedicated end-to-end dataset, solving the data scarcity problem. The EPIK model has been distilled from the MATra model using this technique of knowledge distillation. The MATra model can perform crosslingual transliteration between 5 languages - English, Hindi, Tamil, Kannada and Bengali. The EPIK model executes the task of transliteration without any intermediate English output while retaining the performance and accuracy of the MATra model. The EPIK model can perform transliteration with an average CER score of 0.015 and average phonetic accuracy of 92.1%. In addition, the average time for execution has reduced by 54.3% as compared to the teacher model and has a similarity score of 97.5% with the teacher encoder. In a few cases, the EPIK model (student model) can outperform the MATra model (teacher model) even though it has been distilled from the MATra model.
translated by 谷歌翻译
知识蒸馏(KD)最近被出现为将学生预先接受教师模型转移到轻量级学生的知识的强大战略,并在广泛的应用方面表现出了前所未有的成功。尽管结果令人鼓舞的结果,但KD流程本身对网络所有权保护构成了潜在的威胁,因为网络中包含的知识可以毫不费力地蒸馏,因此暴露于恶意用户。在本文中,我们提出了一种新颖的框架,称为安全蒸馏盒(SDB),允许我们将预先训练的模型包装在虚拟盒中用于知识产权保护。具体地,SDB将包装模型的推理能力保留给所有用户,但从未经授权的用户中排除KD。另一方面,对于授权用户,SDB执行知识增强方案,以加强KD性能和学生模型的结果。换句话说,所有用户都可以在SDB中使用模型进行推断,但只有授权用户只能从模型中访问KD。所提出的SDB对模型架构不对限制,并且可以易于作为即插即用解决方案,以保护预先训练的网络的所有权。各个数据集和架构的实验表明,对于SDB,未经授权的KD的性能显着下降,而授权的销量会增强,展示SDB的有效性。
translated by 谷歌翻译
Zero-shot cross-lingual named entity recognition (NER) aims at transferring knowledge from annotated and rich-resource data in source languages to unlabeled and lean-resource data in target languages. Existing mainstream methods based on the teacher-student distillation framework ignore the rich and complementary information lying in the intermediate layers of pre-trained language models, and domain-invariant information is easily lost during transfer. In this study, a mixture of short-channel distillers (MSD) method is proposed to fully interact the rich hierarchical information in the teacher model and to transfer knowledge to the student model sufficiently and efficiently. Concretely, a multi-channel distillation framework is designed for sufficient information transfer by aggregating multiple distillers as a mixture. Besides, an unsupervised method adopting parallel domain adaptation is proposed to shorten the channels between the teacher and student models to preserve domain-invariant features. Experiments on four datasets across nine languages demonstrate that the proposed method achieves new state-of-the-art performance on zero-shot cross-lingual NER and shows great generalization and compatibility across languages and fields.
translated by 谷歌翻译
In this paper, we propose Stochastic Knowledge Distillation (SKD) to obtain compact BERT-style language model dubbed SKDBERT. In each iteration, SKD samples a teacher model from a pre-defined teacher ensemble, which consists of multiple teacher models with multi-level capacities, to transfer knowledge into student model in an one-to-one manner. Sampling distribution plays an important role in SKD. We heuristically present three types of sampling distributions to assign appropriate probabilities for multi-level teacher models. SKD has two advantages: 1) it can preserve the diversities of multi-level teacher models via stochastically sampling single teacher model in each iteration, and 2) it can also improve the efficacy of knowledge distillation via multi-level teacher models when large capacity gap exists between the teacher model and the student model. Experimental results on GLUE benchmark show that SKDBERT reduces the size of a BERT$_{\rm BASE}$ model by 40% while retaining 99.5% performances of language understanding and being 100% faster.
translated by 谷歌翻译
缺乏标记数据是关系提取的主要障碍。通过将未标记的样本作为额外培训数据注释,已经证明,半监督联系提取(SSRE)已被证明是一个有希望的方法。沿着这条线几乎所有先前的研究采用多种模型来使注释通过从这些模型中获取交叉路口集的预测结果来更加可靠。然而,差异集包含有关未标记数据的丰富信息,并通过事先研究忽略了忽视。在本文中,我们建议不仅从共识中学习,而且还要学习SSRE中不同模型之间的分歧。为此,我们开发了一种简单且一般的多教师蒸馏(MTD)框架,可以轻松集成到任何现有的SSRE方法中。具体来说,我们首先让教师对应多个模型,并在SSRE方法中选择最后一次迭代的交叉点集中的样本,以便像往常一样增加标记的数据。然后,我们将类分布转移为差异设置为软标签以指导学生。我们最后使用训练有素的学生模型进行预测。两个公共数据集上的实验结果表明,我们的框架显着促进了基础SSRE方法的性能,具有相当低的计算成本。
translated by 谷歌翻译
近年来,知识蒸馏有显着改善,可以为更好的效率产生紧凑的学生模型,同时保留教师模型的模型效果。以前的研究发现:由于能力不匹配,更准确的教师对更好的教师无需。在本文中,我们旨在通过模型校准的角度分析现象。我们发现较大的教师模型可能过于过度自信,因此学生模型无法有效地模仿。虽然,在教师模型的简单模型校准之后,教师模型的大小与学生模型的性能具有正相关。
translated by 谷歌翻译