Approximating Stacked and Bidirectional Recurrent Architectures with the Delayed Recurrent Neural Network

Javier S. Turek, Shailee Jain, Vy A. Vo, Mihai Capotă, Alexander G. Huth, Theodore L. Willke · DOI

Abstract

Recent work has shown that topological enhancements to recurrent neural networks (RNNs) can increase their expressiveness and representational capacity. Two popular enhancements are stacked RNNs, which increase the capacity for learning non-linear functions, and bidirectional processing, which exploits acausal information in a sequence. In this work, we explore the delayed-RNN (d-RNN), a single-layer RNN that introduces a delay between the input and output. We prove that a weight-constrained version of the d-RNN is equivalent to a stacked-RNN. We also show that the delay gives rise to partial acausality, much like bidirectional networks. Synthetic experiments confirm that the d-RNN can mimic bidirectional networks, solving some acausal tasks similarly and outperforming them in others. Moreover, we show similar performance to bidirectional networks in real-world natural language processing tasks. These results suggest that d-RNNs can approximate complex topologies—including stacked and bidirectional RNNs—with equivalent or faster runtimes.

Introduction: The Depth and Causality Bottleneck

Recurrent Neural Networks (RNNs) are fundamental to sequential data processing, yet "vanilla" architectures face two significant constraints:

  1. Shallow Non-linearity: While deep in time, standard RNNs are shallow in the non-linear transformations applied to any single input. To address this, researchers typically stack multiple RNN layers, which significantly increases computational overhead.
  2. Strict Causality: Standard RNNs process information chronologically, meaning they cannot "see" the future. Tasks like machine translation or speech recognition often require future context, leading to the use of Bidirectional RNNs (Bi-RNNs). However, Bi-RNNs are computationally expensive, requiring full backward passes and creating synchronization bottlenecks on parallel hardware.

The d-RNN architecture aims to provide the benefits of stacking and bidirectionality without these architectural complexities and runtime penalties.

The Delayed RNN (d-RNN)

The core proposal is the d-RNN, a simple modification where the output for an input at time $t$ is delayed by $d$ timesteps. Instead of producing $y_t$ immediately, the network produces $\hat{y}_{t+d}$.

The d-RNN architecture with a delay $d=2$. Input $x_t$ produces output $\hat{y}_{t+d}$, allowing the hidden state to incorporate future context before generating an output.

Mathematical Equivalence and Temporal Depth

A key theoretical contribution is the proof that a $k$-layer stacked RNN is exactly equivalent to a single-layer d-RNN with a delay of $d=k-1$, provided the d-RNN's weight matrices follow a specific sparse, block-bidiagonal structure. By relaxing these constraints, a d-RNN can potentially learn even more complex representations than a stacked RNN of the same size.

Furthermore, the delay introduces partial acausality. Because the output for $x_t$ is generated at $t+d$, the hidden state has already processed inputs $x_{t+1}, \dots, x_{t+d}$. This allows the model to look into a local "future" window, effectively mimicking the behavior of a Bi-RNN within that window.

Experimental Evaluation

The researchers evaluated the d-RNN (using LSTM cells, or d-LSTM) across synthetic tasks, character-level language modeling (text8), and real-world Part-of-Speech (POS) tagging (Universal Dependencies v2.3).

Key Results

  • Efficiency: In masked language modeling, the d-LSTM achieved performance within 5% of a Bi-LSTM while running at least 4x faster.
  • Accuracy: On POS tagging, the d-LSTM matched or outperformed state-of-the-art bidirectional models. For instance, on German text, a d-LSTM with $d=1$ achieved 92.87% accuracy, surpassing a standard Bi-LSTM's 91.58%.
  • Scaling with Delay: Synthetic tests demonstrate that as the delay $d$ increases, the d-LSTM's performance steadily improves, eventually matching the performance of fully bidirectional models.
Accuracy of d-LSTM as a function of delay $d$. As the delay increases, the model's performance approaches the performance of a BiLSTM, demonstrating its ability to capture acausal information through temporal depth.

Discussion and Future Work

The d-RNN demonstrates that "depth in layers" can be mapped to "depth in time." A single layer running for more steps can perform the same sequence of non-linearities as multiple layers. By exploiting local future context, the d-RNN provides a parallel-friendly alternative to Bi-RNNs.

However, the delay $d$ remains a fixed hyperparameter. If a task requires dependencies longer than the chosen delay, a full Bi-RNN might still be necessary. Future work may explore "dilated" recurrent connections to capture longer-term dependencies without excessively increasing the delay.

For more details, see the full paper: Approximating Stacked and Bidirectional Recurrent Architectures with the Delayed Recurrent Neural Network (ICML 2020).

Summary updated

BibTeX
@misc{turek2019approximating,
  author = {Javier S. Turek and Shailee Jain and Vy A. Vo and Mihai Capotă and Alexander G. Huth and Theodore L. Willke},
  title = {{Approximating Stacked and Bidirectional Recurrent Architectures with the Delayed Recurrent Neural Network}},
  year = {2019},
  eprint = {1909.00021},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.00021},
}
Figure