论文解读(XR-Transformer)Fast Multi-Resolution Transformer Fine-tuning for Extreme Multi-label Text Classification
Paper Information
Title:Fast Multi-Resolution Transformer Fine-tuning for Extreme Multi-label Text Classification
Authors:Jiong Zhang, Wei-Cheng Chang, Hsiang-Fu Yu, I. Dhillon
Sources:2021, ArXiv
Other:3 Citations, 61 References
Paper:download
Code:download
1 背景知识
训练集 $\left\{\mathbf{x}_{i}, \mathbf{y}_{i}\right\}_{i=1}^{N} $,$\mathbf{x}_{i} \in \mathcal{D}$ 代表着第 $i$ 个文档,$\mathbf{y}_{i} \in\{0,1\}^{L}$ 是第$i$个样本的第 $\ell$ 个标签。
eXtreme Multi-label Text Classification (XMC) 目标是寻找一个这样的函数 $f: \mathcal{D} \times[L] \mapsto \mathbb{R}$,$f(x,\ell)$ 表示输入 $x$ 与标签 $\ell$ 之间的相关性。
实际上,得到 $top-k$ 个最大值的索引作为给定输入 $x$ 的预测相关标签。最直接的模型是一对全(OVA)模型:
$f(\mathbf{x}, \ell)=\mathbf{w}_{\ell}^{\top} \Phi(\mathbf{x}) ; \ell \in[L]\quad\quad\quad(1)$
其中
- $\mathbf{W}=\left[\mathbf{w}_{1}, \ldots, \mathbf{w}_{L}\right] \in \mathbb{R}^{d \times L}$ 是权重向量
- $\Phi(\cdot)$ 是一个文本向量转换器,$\Phi: \mathcal{D} \mapsto \mathbb{R}^{d}$用于将 $\mathbf{x}$转换为 $d$ 维特征向量
为了处理非常大的输出空间,最近的方法对标签空间进行了划分,以筛选在训练和推理过程中考虑的标签。特别是 [7, 12, 13, 34, 35, 39] 遵循三个阶段的框架:partitioning、shortlisting 和 ranking。
首先 partitioning 过程,将标签分成 $K$ 个簇 $\mathbf{C} \in\{0,1\}^{L \times K}$ ,$C_{\ell, k}=1$ 代表这标签 $\ell $ 在第 $k$ 个簇中。
然后 shortlisting 过程,将输入 $x$ 映射到相关的簇当中:
$g(\mathbf{x}, k)=\hat{\mathbf{w}}_{k}^{\top} \Phi_{g}(\mathbf{x}) ; k \in[K]\quad\quad\quad(2)$
最后 ranking 过程,在 shortlisted 上训练一个输出大小为 $L $ 的分类模型:
$f(\mathbf{x}, \ell)=\mathbf{w}_{\ell}^{\top} \Phi(\mathbf{x}) ; \ell \in S_{g}(\mathbf{x})\quad\quad\quad(3)$
其中 $S_{q}(\mathbf{x}) \subset[L]$ 是标签集的一个子集。
对于基于 transformer 的方法,主要花费的时间是 $\Phi(\mathbf{x})$ 的评价。但是 $K$ 值太大或太小仍然可能会有问题。实证结果表明,当 cluster 的大小 $B$ 太大时,模型的性能会下降。典型的 X-Transformer 和 LightXML ,他们的簇大小$B$ 通常 $B(\leq 100)$ ,聚类数 $K$ 通常为 $K \approx L / B$。
2 XR-Transformer 方法
在 XR-Transformer 中,我们递归地对 shortlisting 问题应用相同的三阶段框架,直到达到一个相当小的输出大小 $\frac{L}{B^{D}}$。
2.1 Hierarchical Label Tree (HLT)
递归生成标签簇 $D$ 次,相当于构建一个深度为 $D$ 的 HLT。我们首先构建标签特征 $\mathbf{Z} \in \mathbb{R}^{L \times \hat{d}}$。这可以通过在标签文本上应用文本向量量化器,或者从 Positive Instance Feature Aggregation(PIFA) 中实现:
$\mathbf{Z}_{\ell}=\frac{\mathbf{v}_{\ell}}{\left\|\mathbf{v}_{\ell}\right\|} ; \text { where } \mathbf{v}_{\ell}=\sum\limits _{i: y_{i, \ell}=1} \Phi\left(\mathbf{x}_{i}\right), \forall \ell \in[L]\quad\quad\quad(4)$
其中:$\Phi: \mathcal{D} \mapsto \mathbb{R}^{d}$是文本向量化转换器。
使用平衡的 k-means($k=B$) 递归地划分标签集,并以自上而下的方式生成 HLT。
$\left\{\mathbf{C}^{(t)}\right\}_{t=1}^{D}$
其中 $\mathbf{C}^{(t)} \in\{0,1\}^{K_{t} \times K_{t-1}}$ with $K_{0}=1$、$K_{D}=L$
2.2 Multi-resolution Output Space
粗粒度的标签向量可以通过对原始标签进行max-pooling得到(在标签空间中)。第 $t$ 层的真实标签(伪标签)为:
$\mathbf{Y}^{(t)}=\operatorname{binarize}\left(\mathbf{Y}^{(t+1)} \mathbf{C}^{(t+1)}\right)\quad\quad\quad(5)$
然而,直接用以上训练方式会造成信息损失。直接做max-pooling的方法无法区分:一个cluster中有多个真实标签和一个cluster中有一个真实标签。直观上,前者应该有更高的权重。
因而,通过一个非负的重要性权重指示每个样本对每个标签的重要程度:
$\mathbf{R}^{(t)} \in \mathbb{R}_{+}^{N \times K_{t}}$
该重要性权重矩阵通过递归方式构建,最底层的重要性权重为原始 标签归一化。之后递归地将上一层的结果传递到下一层。
$\mathbf{R}^{(t)}=\mathbf{R}^{(t+1)} \mathbf{C}^{(t+1)} \quad \quad (6)$
$\mathbf{R}^{(D)}=\mathbf{Y}^{(D)}$
其中:
$\hat{R}_{i, j}^{(t)}=\left\{\begin{array}{ll}\frac{R_{i, j}^{(t)}}{\left\|\mathbf{R}_{i}^{(t)}\right\|_{1}} & \text { if } Y_{i, j}^{(t)}=1 \\ \alpha & \text { otherwise } \end{array}\right.$
2.3 Label Shortlisting
在每一层,不能只关注于少量真实的标签,还需要关注于一些高置信度的非真实标签。(因为分类不是100%准确,要给算法一些容错度,之后用 beam search 矫正)
在每一层,将模型预测出的 top-k relevant clusters 作为父节点。因而,在第 $t$ 层我们需要考虑 $t-1$ 层的标签列表。
$\begin{aligned}&\mathbf{P}^{(t-1)} =\operatorname{Top}\left(\mathbf{W}^{(t-1) \top} \Phi\left(\mathbf{X}, \Theta^{(t-1)}\right), k\right)\quad\quad\quad(7)\\&\mathbf{M}^{(t)} =\operatorname{binarize}\left(\mathbf{P}^{(t-1)} \mathbf{C}^{(t) \top}\right)+\operatorname{binarize}\left(\mathbf{Y}^{(t-1)} \mathbf{C}^{(t) \top}\right)\quad\quad\quad(8)\end{aligned}$
2.4 Training with bootstrapping
我们利用递归学习结构,通过模型自举来解决这个问题。
$\mathbf{W}_{i n i t}^{(t)}:=\underset{\mathbf{W}^{(t)}}{\operatorname{argmin}} \sum\limits _{i=1}^{N} \sum\limits_{\ell: \mathbf{M}_{i, \ell}^{(t)} \neq 0} \hat{R}_{i, \ell}^{(t)} \mathcal{L}\left(Y_{i, \ell}^{(t)}, \mathbf{W}_{\ell}^{(t) \top} \Phi_{d n n}\left(\mathbf{x}_{i}, \boldsymbol{\theta}^{(t-1) *}\right)\right)+\lambda\left\|\mathbf{W}^{(t)}\right\|^{2}\quad\quad\quad(11)$
3 Algorithm

论文解读(XR-Transformer)Fast Multi-Resolution Transformer Fine-tuning for Extreme Multi-label Text Classification的更多相关文章
- Fauce:Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation 论文解读(VLDB 2021)
Fauce:Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation 论文解读(VLDB 2021) 本 ...
- 目标检测论文解读3——Fast R-CNN
背景 deep ConvNet兴起,VGG16应用在图像分类任务上表现良好,本文用VGG16来解决检测任务.SPP NET存在CNN层不能fine tuning的缺点,且之前的方法训练都是分为多个阶段 ...
- [论文解读] 阿里DIEN整体代码结构
[论文解读] 阿里DIEN整体代码结构 目录 [论文解读] 阿里DIEN整体代码结构 0x00 摘要 0x01 文件简介 0x02 总体架构 0x03 总体代码 0x04 模型基类 4.1 基本逻辑 ...
- 论文解读丨表格识别模型TableMaster
摘要:在此解决方案中把表格识别分成了四个部分:表格结构序列识别.文字检测.文字识别.单元格和文字框对齐.其中表格结构序列识别用到的模型是基于Master修改的,文字检测模型用到的是PSENet,文字识 ...
- NLP论文解读:无需模板且高效的语言微调模型(上)
原创作者 | 苏菲 论文题目: Prompt-free and Efficient Language Model Fine-Tuning 论文作者: Rabeeh Karimi Mahabadi 论文 ...
- AAAI2019 | 基于区域分解集成的目标检测 论文解读
Object Detection based on Region Decomposition and Assembly AAAI2019 | 基于区域分解集成的目标检测 论文解读 作者 | 文永亮 学 ...
- Gaussian field consensus论文解读及MATLAB实现
Gaussian field consensus论文解读及MATLAB实现 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 一.Introduction ...
- 论文解读第三代GCN《 Deep Embedding for CUnsupervisedlustering Analysis》
Paper Information Titlel:<Semi-Supervised Classification with Graph Convolutional Networks>Aut ...
- VLDB'22 HiEngine极致RTO论文解读
摘要:<Index Checkpoints for Instant Recovery in In-Memory Database Systems>是由华为云数据库创新Lab一作发表在数据库 ...
随机推荐
- JS报错:Uncaught TypeError: Cannot set property ‘nTf‘ of undefined
在使用DataTable时,遇到以下报错: Uncaught TypeError: Cannot set property 'nTf' of undefined ... ... 初步排查后发现是< ...
- LeetCode-092-反转链表 II
反转链表 II 题目描述:给你单链表的头指针 head 和两个整数 left 和 right ,其中 left <= right .请你反转从位置 left 到位置 right 的链表节点,返回 ...
- VS Code远程链接报错Could not establish connection to “hz.matpool.com”
VS Code远程链接报错Could not establish connection to "hz-t2.matpool.com" 输出的部分内容 安装Git git for w ...
- 写给开发人员的实用密码学(三)—— MAC 与密钥派生函数 KDF
目录 一.MAC 消息认证码 MAC 与哈希函数.数字签名的区别 MAC 的应用 1. 验证消息的真实性.完整性 2. AE 认证加密 - Authenticated encryption 3. 基于 ...
- tp5 ajax批量删除(自写)
html代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...
- Windows原理深入学习系列-Windows内核提权
这是[信安成长计划]的第 22 篇文章 0x00 目录 0x01 介绍 0x02 替换 Token 0x03 编辑 ACL 0x04 修改 Privileges 0x05 参考文章 继续纠正网上文章中 ...
- Map 集合
<零基础学Java > Map 集合 在程序中需要存储具有映射关系就需要使用Map集合了. Map集合由Map接口.Map接口的实现类组成. Map 接口 Map接口没有Collectio ...
- Python列表生成
# For More :http://www.codebelief.com/article/2017/02/python-advanced-programming-list-comprehension ...
- VuePress 博客优化之增加 Vssue 评论功能
前言 在 <一篇带你用 VuePress + Github Pages 搭建博客>中,我们使用 VuePress 搭建了一个博客,最终的效果查看:TypeScript 中文文档. 本篇讲讲 ...
- NET经典书籍必读
C#与.NET框架,入门 + 进阶 + 精通,外加并发编程实例,10本C#图书,一本都不能少. 1.<Learning hard C#学习笔记> 作者:李志 书号:978-7-115-3 ...