[论文解读] A Tensorized Transformer for Language Modeling
本论文提出了多线性注意力,这是基于块项张量分解的 Transformer 多头注意力压缩方法,在参数显著减少的同时,在语言建模和翻译任务上保持了具有竞争力的性能。
Latest development of neural models has connected the encoder and decoder through a self-attention mechanism. In particular, Transformer, which is solely based on self-attention, has led to breakthroughs in Natural Language Processing (NLP) tasks. However, the multi-head attention mechanism, as a key component of Transformer, limits the effective deployment of the model to a resource-limited setting. In this paper, based on the ideas of tensor decomposition and parameters sharing, we propose a novel self-attention model (namely Multi-linear attention) with Block-Term Tensor Decomposition (BTD). We test and verify the proposed attention method on three language modeling tasks (i.e., PTB, WikiText-103 and One-billion) and a neural machine translation task (i.e., WMT-2016 English-German). Multi-linear attention can not only largely compress the model parameters but also obtain performance improvements, compared with a number of language modeling approaches, such as Transformer, Transformer-XL, and Transformer with tensor train decomposition.
研究动机与目标
- 为资源受限的 NLP 场景动机化对大型 Transformer 模型进行压缩。
- 提出使用 Block-Term Tensor Decomposition 的多线性注意力来共享参数并采用低秩结构。
- 将压缩后的注意力集成到 Transformer 中并展示端到端训练。
- 分析压缩及所提出方法的计算复杂度影响。
- 在语言模型基准和 WMT 英德翻译上进行经验验证。
提出的方法
- 通过 Tucker 分解将自注意力输出表示为正交基向量的线性组合(单块注意力)。
- 使用 Block-Term Tensor Decomposition 构建多线性注意力,以在各头之间共享 Q、K、V 因子矩阵。
- 分割-拼接过程以形成与 Transformer 的编码器/解码器兼容的多头输出。\n证明从基于 Tucker 的表示中可以重构缩放点积注意力。
- 分析压缩比和时间/空间复杂度,展示在参数显著减少的同时保持相近的性能。
实验结果
研究问题
- RQ1Transformer 的多头注意力能否通过 Block-Term Tensor Decomposition 在不牺牲性能的前提下实现有效压缩?
- RQ2在降低参数预算的情况下,跨注意力头共享因子矩阵是否能够实现具有竞争力的语言建模与翻译结果?
- RQ3与 Transformer 变体(如 Transformer-XL、Sparse Transformer)相比,所提出的多线性注意力在参数量和困惑度/ BLEU 方面表现如何?
- RQ4核心张量大小对语言建模中的性能及潜在过拟合有何影响?
主要发现
| 模型 | PTB 参数 | PTB 验证 PPL | PTB 测试 PPL | WikiText-103 参数 | WikiText-103 验证 PPL | WikiText-103 测试 PPL |
|---|---|---|---|---|---|---|
| Tensorized Transformer core-1 | 12M | 60.5 | 57.9 | 85.3M | 22.7 | 20.9 |
| Tensorized Transformer core-2 | 12M | 54.25 | 49.8 | 85.3M | 19.7 | 18.9 |
- 多线性注意力在显著减少参数量(例如 core-1 和 core-2 配置)同时保持具有竞争力或更优的语言建模性能。
- 在 PTB 与 WikiText-103 上,Tensorized Transformer core-1 与 core-2 达到的困惑度可与若干强基线相当,且参数显著更少。
- 在 One-Billion Word 上,Tensorized Transformer 实现了较强的困惑度,同时具备显著的参数效率,优于 vanilla Transformer 基线。
- 在 NMT(WMT-2016 英-德)中,Tensorized Transformer cores 的 BLEU 分数高于基本 Transformer 基线且参数更少。
- 该方法能够重构缩放点积注意力,并在 Transformer 框架内实现端到端训练,超出原始 Transformer 机制的应用范围。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。