Skip to main content
QUICK REVIEW

[论文解读] Hierarchically Gated Recurrent Neural Network for Sequence Modeling

Zhen Qin, Songlin Yang|arXiv (Cornell University)|Nov 8, 2023
Topic ModelingComputer Science被引用 24
一句话总结

HGRN 在具有复数域递归的门控线性RNN中引入分层下界忘记门,以有效建模跨语言、视觉以及长期任务的长短期依赖。

ABSTRACT

Transformers have surpassed RNNs in popularity due to their superior abilities in parallel training and long-term dependency modeling. Recently, there has been a renewed interest in using linear RNNs for efficient sequence modeling. These linear RNNs often employ gating mechanisms in the output of the linear recurrence layer while ignoring the significance of using forget gates within the recurrence. In this paper, we propose a gated linear RNN model dubbed Hierarchically Gated Recurrent Neural Network (HGRN), which includes forget gates that are lower bounded by a learnable value. The lower bound increases monotonically when moving up layers. This allows the upper layers to model long-term dependencies and the lower layers to model more local, short-term dependencies. Experiments on language modeling, image classification, and long-range arena benchmarks showcase the efficiency and effectiveness of our proposed model. The source code is available at https://github.com/OpenNLPLab/HGRN.

研究动机与目标

  • 在 Transformer 时代,重新审视 RNN 在长序列建模中的作用的动机。
  • 提出分层门控递归单元(HGRU),具有随层增长的下界忘记门。
  • 通过逐元素更新和复值动力学实现高效的可并行递归。
  • 展示 HGRN 在语言建模、图像分类和长距离基准上的有效性与高效性。

提出的方法

  • 使用多层 HGRN,其中每层结合 HGRU(在复数域中基于门控的线性递归)与基于 GLU 的通道混合。
  • 将忘记门 f_t 表示为 f_t = λ_t · exp(iθ_t),其中 λ_t 是衰减幅度,θ_t 是相位(可学习或受 RoPE 启发)。
  • 通过跨层的 cummax 引入可学习的下界 γ^k,使得上层更趋向记忆、下层更趋向遗忘。
  • 通过 i_t = 1 − f_t 将输入门和忘记门绑定,以减少参数量并改善梯度流。
  • 在投影到隐藏状态前加入输出门以及 LayerNorm,遵循门控线性状态空间模型的做法。
  • 将 token 混合描述为基于 HGRU 的递归,得到矩阵 A = Λ ⨀ Θ,分解为长距离衰减(Λ)与相对位置(Θ)分量。
  • 提供一种复值递归以扩展表达能力并捕获相对位置信息。

实验结果

研究问题

  • RQ1分层门控递归网络(HGRN)在自回归语言建模任务上是否能达到与 Transformer 及基于 RNN 的模型相当或更优的性能?
  • RQ2数据相关的、逐层的下界忘记门是否能改善跨模态的长短期依赖建模?
  • RQ3复值递归动力学与 RoPE 启发的相位分量是否提升线性递归模型的表达能力与位置编码?
  • RQ4HGRN 是否足够高效以处理长序列,并在如 ImageNet-1k 的视觉基准上具竞争力?
  • RQ5与最先进模型相比,HGRN 在长距离基准(LRA)和下游任务中的表现如何?

主要发现

  • HGRN 在 WikiText-103 与 Pile 上达到具有竞争力的困惑度,常常优于若干高效 Transformer 变体,且超过其他基于 RNN 的模型。
  • 在 Pile 上、参数量为 1B 时,HGRN 在自回归语言建模中产生的困惑度(PPL)低于 Transformer 和 LRU 基线。
  • HGRN 在 Long Range Arena(LRA)获得强劲结果,在 list-ops、文本、检索和图像任务中常常领先竞争方法。
  • 在 ImageNet-1k 分类中,HGRN 达到与 DeiT 基线相同或更高的性能,参数量相近,表明多模态的适用性。
  • 消融研究显示忘记门的必要性、下界门控的益处,以及复值递归在表达能力方面的优势。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。