Pre-trained models are widely used in fine-tuning downstream tasks with linear classifiers optimized by the cross-entropy loss, which might face robustness and stability problems. These problems can be improved by learning representations that focus on similarities in the same class and contradictions in different classes when making predictions. In this paper, we utilize the K-Nearest Neighbors Classifier in pre-trained model fine-tuning. For this KNN classifier, we introduce a supervised momentum contrastive learning framework to learn the clustered representations of the supervised downstream tasks. Extensive experiments on text classification tasks and robustness tests show that by incorporating KNNs with the traditional fine-tuning process, we can obtain significant improvements on the clean accuracy in both rich-source and few-shot settings and can improve the robustness against adversarial attacks. \footnote{all codes is available at https://github.com/LinyangLee/KNN-BERT}


翻译:预先培训的模型被广泛用于微调下游任务,通过跨热带损失优化线性分类,可能会面临稳健性和稳定性问题,这些问题可以通过学习表现方式加以改善,在作出预测时侧重于同一类的相似性和不同类别中的矛盾之处。在本文中,我们使用K-Nearest Neearbors分类法进行预先培训的模型微调。对于这个 KNNN 分类法,我们引入了一种有监督的动力对比学习框架,以了解受监督的下游任务的分组表述。关于文本分类任务的广泛实验和稳健性测试表明,通过将KNNPs纳入传统的微调程序,我们可以在丰富来源和少发的环境下获得清洁准确性方面的重大改进,并能够改进对抗对抗性攻击的稳健性。 https://github.com/LinyangeLee/KNNNN-BERT}

0
下载
关闭预览

相关内容

“知识神经元网络”KNN(Knowledge neural network)是一种以“神经元网络”模型 为基础的知识组织方法。 在“知识神经元网络”KNN 中,所谓的“知识”,是描述一个“知识”的文本,如一个网页、Word、PDF 文档等。
预训练语言模型fine-tuning近期进展概述
专知会员服务
36+阅读 · 2021年4月9日
专知会员服务
44+阅读 · 2020年10月31日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
R文本分类之RTextTools
R语言中文社区
4+阅读 · 2018年1月17日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
5+阅读 · 2018年1月18日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
R文本分类之RTextTools
R语言中文社区
4+阅读 · 2018年1月17日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员