对抗训练-smart 论文阅读笔记

本文介绍SMART框架,通过引入对抗训练的smoothness-inducing adversarial regularization和Bregman proximal point optimization,提升BERT等模型在NLP任务中的表现。关键在于通过扰动保持模型输出一致性,减少过拟合,同时利用动量加速优化过程。

对抗训练-smart 论文阅读笔记

SMART: Robust and Efficient Fine-Tuning for Pre-trained NaturalLanguage Models through Principled Regularized Optimization


  • 论文地址 :https://arxiv.org/abs/1911.03437
  • code地址 : Fine-tuning code and models
  • 时间 : 2020-10
  • 机构 : microsoft,gatech
  • 关键词: 对抗训练 NLP BERT
  • 效果评估:(2020-10) pro-posed framework achieves new state-of-the-artperformance on a number of NLP tasks includ-ing GLUE, SNLI, SciTail and ANLI. More-over, it also outperforms the state-of-the-art T5model, which is the largest pre-trained modelcontaining 11 billion parameters, on GLUE

简介

文中作者提出了一个新的框架SMART,用于对预先训练好的语言模型进行微调时 增加其鲁棒性,关键点有两处:

  1. Smoothness-Inducing Adversarial Regularization
  2. Bregman Proximal Point Optimization

Smoothness-Inducing Adversarial Regularization

模型: f ( ⋅ ; θ ) f(\cdot;\theta) f(;θ)
数据个数: n n n
数据: { ( x i , y i ) } i = 1 n \{(x_i,y_i)\}_{i=1}^n { (xi,yi)}i=1n
\qquad x i x_i xi表示输入语句的embedding,可以从模型的第一个embedding层获取到。
\qquad y i y_i yi表示对应的label
文中主要是在fine-tuning时优化的下面的函数:
m i n θ F ( θ ) = L ( θ ) + λ s R ( θ ) (1) min_\theta\mathcal{F}(\theta)=\mathcal{L}(\theta) + \lambda_s\mathcal{R}(\theta) \tag1 minθF(θ)=L(θ)+λsR(θ)(1)
这里:
\qquad L ( θ ) \mathcal{L}(\theta) L(θ) 是整体的loss: L = 1 n ∑ i = 1 n l ( f ( x i ; θ ) , y i ) \mathcal{L} = \frac{1}{n}\sum_{i=1}^{n} \mathcal{l}(f(x_i;\theta),y_i) L=n1i=1nl(f(xi;θ),yi), 其 中 l ( ⋅ , ⋅ ) 其中\mathcal{l}(\cdot,\cdot) l(,) 是损失函数由具体的任务决定;
\qquad λ s > 0 \lambda_s > 0 λs>0是一个可调的参数;
R s ( θ ) \qquad\mathcal{R}_s(\theta) Rs(θ)就是 smoothness-inducing adversarial regularizer,具体如下:
R ( θ ) = 1 n ∑ i = 1 n m a x ∥ x i ~ − x i ∥ p ≤ ϵ l s ( f ( x i ~ ; θ ) , f ( x i ; θ ) ) \mathcal{R}(\theta)=\frac{1}{n}\sum_{i=1}^{n}max_{\rVert{\tilde{x_i}-x_i}\rVert_{\mathcal{p}}\le\epsilon}\mathcal{l_s}(f(\tilde{x_i};\theta),f(x_i;\theta)) R(θ)=n1i=1nmaxxi~xipϵls(f(xi~;θ),f(xi;θ))
\qquad\qquad 其中 ϵ > 0 \epsilon>0 ϵ>0是一个可调的参数,比如在一个分类任务中模型 f ( ⋅ ; θ ) f(\cdot;\theta) f(;θ)输出概率分布, l s \mathcal{l_s} ls可以选择为对称KL-散度如:
l s ( P , Q ) = D K L ( P ∥ Q ) + D K L ( Q ∥ P ) \mathcal{l_s}(P,Q) = \mathcal{D}_{KL}(P\rVert Q) + \mathcal{D}_{KL}(Q\rVert P) ls(P,Q)=DKL(PQ)+DKL(QP)
\qquad\qquad 在一个回归任务中,模型 f ( ⋅ ; θ ) f(\cdot;\theta) f(;θ)输出一个值, l s \mathcal{l_s} ls可以选择为方差损失如: l s ( p , q ) = ( p − q ) 2 \mathcal{l_s}(p,q)=(p-q)^2 ls

评论 11
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值