Skip to main content
QUICK REVIEW

[论文解读] Funnel-Transformer: Filtering out Sequential Redundancy for Efficient Language Processing

Zihang Dai, Guokun Lai|arXiv (Cornell University)|Jun 5, 2020
Topic Modeling参考文献 30被引用 104
一句话总结

Funnel-Transformer 将令牌序列逐步压缩以减少计算,同时在需要时使用解码器恢复令牌级表示,在序列级任务上实现与性能相当或更好的效率。

ABSTRACT

With the success of language pretraining, it is highly desirable to develop more efficient architectures of good scalability that can exploit the abundant unlabeled data at a lower cost. To improve the efficiency, we examine the much-overlooked redundancy in maintaining a full-length token-level presentation, especially for tasks that only require a single-vector presentation of the sequence. With this intuition, we propose Funnel-Transformer which gradually compresses the sequence of hidden states to a shorter one and hence reduces the computation cost. More importantly, by re-investing the saved FLOPs from length reduction in constructing a deeper or wider model, we further improve the model capacity. In addition, to perform token-level predictions as required by common pretraining objectives, Funnel-Transformer is able to recover a deep representation for each token from the reduced hidden sequence via a decoder. Empirically, with comparable or fewer FLOPs, Funnel-Transformer outperforms the standard Transformer on a wide variety of sequence-level prediction tasks, including text classification, language understanding, and reading comprehension. The code and pretrained checkpoints are available at https://github.com/laiguokun/Funnel-Transformer.

研究动机与目标

  • 动机:减少 Transformer 基础语言模型中完整长度令牌表示的冗余。
  • 提出一个分层编码器,在块之间压缩序列长度以节省 FLOPs 和内存。
  • 证明节省的计算可以再投入以加深或扩大模型以提高容量。
  • 通过从压缩编码解码完整长度表示来实现令牌级预测,而不改变预训练目标。

提出的方法

  • 保留 Transformer 主干,但增加一个编码器,利用池化在块之间逐步将序列长度减半。
  • 使用 pool-query-only 注意力设计,其中在查询上进行池化,而键/值来自未池化的序列。
  • 应用简单的跨步均值池化(窗口大小 2,步长 2)在块边界将序列长度减半。
  • 实现一个解码器,将压缩的编码器输出上采样并与第一块的隐藏状态融合,以恢复用于预训练目标的令牌级表示。
  • 用 MLM 或 ELECTRA 目标进行训练,以展示跨预训练范式的通用性。
  • 讨论复杂度收益:每次减半步带来超线性 FLOP 减少,在相似计算下实现更深或更宽的模型。

实验结果

研究问题

  • RQ1在隐藏状态序列逐步压缩的情况下,是否能在较少 FLOPs 的前提下获得与标准 Transformer 相似或更好的性能?
  • RQ2当编码器在较短长度序列上工作时,如何恢复令牌级表示?
  • RQ3将节省的 FLOPs 投入深度或宽度是否能提升模型在序列级任务的容量?
  • RQ4Funnel-Transformer 在序列级任务(分类、GLUE、RACE)和令牌级任务(SQuAD)上的表现,与标准 Transformer 相比如何?

主要发现

  • F-TFM 在 GLUE 和文本分类任务上在类似或更低的 FLOPs 下通常优于标准 Transformer,尤其是对于较小的模型。
  • 在减少序列长度的同时增加深度(更多块)因利用节省的计算带来的额外容量而带来性能提升。
  • 部分参数共享可能会降低性能;在实践中,采用常规布局并小心设计时效果最好。
  • 在大规模预训练中,F-TFM 取得具有竞争力的 GLUE 分数并在 RACE 上取得强劲结果,在可比 FLOPs 下通常超越基线。
  • 当需要令牌级监督时(如 SQuAD 带解码器),非常大的 F-TFM 模型可能仍落后于完整序列 Transformer,凸显了令牌级任务的权衡。
  • 消融研究表明 pool-query-only 设计、分离的 [cls] 标记处理和相对位置编码对性能很重要。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。