论文笔记--Knowledgeable Prompt-tuning: Incorporating Knowledge into Prompt Verbalizer for Text Classification
Incorporating Knowledge into Prompt Verbalizer for Text Classification)
1. 文章简介
- 标题:Knowledgeable Prompt-tuning:
Incorporating Knowledge into Prompt Verbalizer for Text Classification - 作者:Shengding Hu, Ning Ding, Huadong Wang, Zhiyuan Liu, Jingang Wang, Juanzi Li, Wei Wu, Maosong Sun
- 日期:arxiv preprint
- 期刊:2021
2. 文章概括
文章提出了Knowledgeable Prompt Tuning(KPT)方法,将外部知识融入Verbalizer,并设计了4种处理方法可以从外部知识中筛选出合适的label words。
3 文章重点技术
3.1 Prompt Tuning(KPT)
首先定义 M \mathcal{M} M为语言模型。文章以文本分类任务出发,探讨了如何通过KPT提高prompt tuning的表现。给定输入 x = ( x 0 , … , x n ) x = (x_0, \dots, x_n) x=(x0,…,xn),我们要将它分类到标签集合 y ∈ Y y\in \mathcal{Y} y∈Y。Prompt Tuning(PT)的任务是通过一个template(一段自然文本)将原输入封装。比如任务是将文本"What’s the relation between speed and acceleration?“分类为"SCIENCE"或"SPORTS”,分别对应label 0和1,PT会将它包装为 x p = [ C L S ] A [ M A S K ] q u e s t i o n : x x_p = [CLS]\ A\ [MASK]\ question: x xp=[CLS] A [MASK] question:x,然后模型 M \mathcal{M} M会预测 [ M A S K ] [MASK] [MASK]被填充为词表单词 v v v的概率 P M ( [ M A S K ] = v ∣ x p ) P_{\mathcal{M}}([MASK]=v|x_p) PM([MASK]=v∣xp)。为了把该概率映射到标签集合 Y \mathcal{Y} Y,我们定义verbalizer为函数 f : V → Y f: \mathcal{V} \to \mathcal{Y} f:V→Y,其中 V \mathcal{V} V表示标签单词集合,我们用 V y \mathcal{V}_y Vy表示标签 y ∈ Y y\in\mathcal{Y} y∈Y对应的单词集合,则有 V = ∪ y ∈ Y V y \mathcal{V}=\cup_{y\in\mathcal{Y}} \mathcal{V}_y V=∪y∈YVy。则可以预测标签 y y y的概率为 P ( y ∣ x p ) = g ( P M ( [ M A S K ] = v ∣ x p ) ∣ v ∈ V y ) P(y|x_p) = g(P_{\mathcal{M}} ([MASK]=v|x_p)|v\in\mathcal{V}_y) P(y∣xp)=g(PM([MASK]=v∣xp)∣v∈Vy),其中 g g g表示标签单词到标签的概率转化函数。上例中,我们可以设计 V 1 = { "science" } \mathcal{V}_1 = \{\text{"science"}\}