Skip to main content
QUICK REVIEW

[Paper Review] Hierarchically Gated Recurrent Neural Network for Sequence Modeling

Zhen Qin, Songlin Yang|arXiv (Cornell University)|Nov 8, 2023
Topic ModelingComputer Science24 citations
TL;DR

HGRN introduces hierarchically lower-bounded forget gates in gated linear RNNs with complex-valued recurrence to efficiently model long- and short-range dependencies across language, vision, and long-range tasks.

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.

Motivation & Objective

  • Motivate revisiting RNNs for long-sequence modeling in the era of Transformers.
  • Propose Hierarchically Gated Recurrent Units (HGRU) with lower-bounded forget gates that grow across layers.
  • Enable efficient parallelizable recurrence via element-wise updates and complex-valued dynamics.
  • Demonstrate HGRN’s effectiveness and efficiency on language modeling, image classification, and long-range benchmarks.

Proposed method

  • Use multi-layer HGRN where each layer combines HGRU (gate-based linear recurrence in the complex domain) and GLU-based channel mixing.
  • Represent forget gates f_t as f_t = λ_t · exp(iθ_t) with λ_t as decay magnitude and θ_t as phase (learnable or RoPE-inspired).
  • Introduce a learnable lower bound γ^k for layer k via cummax across layers to push upper layers toward memory and lower layers toward forgetting.
  • Tie input and forget gates via i_t = 1 − f_t to reduce parameters and improve gradient flow.
  • Incorporate an output gate with LayerNorm before projection to the hidden state, following gated linear state-space model practices.
  • Describe token mixing as HGRU-based recurrence yielding a matrix A = Λ ⨀ Θ that decomposes into long-range decay (Λ) and relative-position (Θ) components.
  • Provide a complex-valued recurrence to expand expressiveness and capture relative positional information.

Experimental results

Research questions

  • RQ1Does Hierarchically Gated Recurrent Network (HGRN) achieve competitive or superior performance to Transformer- and RNN-based models on autoregressive language modeling tasks?
  • RQ2Can a data-dependent, layer-wise lower bound on forget gates improve long- and short-term dependency modeling across modalities?
  • RQ3Do complex-valued recurrent dynamics and RoPE-inspired phase components improve expressiveness and position encoding in linear recurrence models?
  • RQ4Is HGRN efficient enough to handle long sequences and competitive on vision benchmarks like ImageNet-1k?
  • RQ5How does HGRN perform on long-range benchmarks (LRA) and downstream tasks compared to state-of-the-art models?

Key findings

  • HGRN achieves competitive perplexity on WikiText-103 and Pile, often outperforming several efficient Transformer variants and surpassing other RNN-based models.
  • On Pile with 1B parameters, HGRN yields lower perplexity (PPL) than Transformer and LRU baselines in autoregressive language modeling.
  • HGRN attains strong results on Long Range Arena (LRA), often besting competing methods across list-ops, text, retrieval, and image tasks.
  • In ImageNet-1k classification, HGRN matches or exceeds DeiT baselines with similar parameter counts, indicating multimodal applicability.
  • Ablation studies show the necessity of the forget gate, the benefit of the lower-bound gating, and the advantage of the complex-valued recurrence for expressiveness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.