Sliced Recurrent Neural Networks

Zeping Yu, Gongshen Liu

Abstract

Recurrent Neural Networks (RNNs) are fundamental to sequence modeling but suffer from a sequential bottleneck that hinders parallelization on modern hardware. This paper introduces Sliced Recurrent Neural Networks (SRNNs), which parallelize the recurrent process by slicing input sequences into multiple subsequences processed across hierarchical layers. Experimental results on large-scale sentiment analysis datasets demonstrate that SRNNs achieve significant speedups—up to 136x for long sequences—while maintaining or improving classification accuracy compared to standard RNNs and convolutional alternatives.

Introduction

The primary challenge in scaling Recurrent Neural Networks (RNNs) is their inherent sequential nature. To compute the hidden state at any given time step, the model must wait for the completion of all previous steps. This "sequential bottleneck" prevents effective utilization of the massive parallel processing capabilities of modern GPUs. While Convolutional Neural Networks (CNNs) offer parallelization, they often fail to capture long-range temporal dependencies as effectively as recurrent units. Sliced Recurrent Neural Networks (SRNNs) address this by restructuring the network to allow for parallel processing of sequence segments without sacrificing the benefits of recurrence.

Methods: The Sliced Architecture

The core innovation of the SRNN is its hierarchical slicing mechanism. Instead of processing a sequence of length $T$ linearly, the SRNN divides it into $n$ subsequences.

The hierarchical architecture of a Sliced Recurrent Neural Network (SRNN), showing how sequences are divided into subsequences across multiple layers for parallel processing.

The process involves:

  1. Slicing: The input sequence is divided into $n$ subsequences. This slicing can be applied recursively across $k$ layers.
  2. Parallel Processing: At the base layer (0th layer), all "minimum subsequences" are processed simultaneously by independent recurrent units (e.g., GRUs or LSTMs).
  3. Hierarchical Aggregation: The final hidden state of each subsequence at layer $i$ serves as the input for the layer $i+1$ above it. This continues until a single final hidden state $F$ is produced at the top layer, representing the entire original sequence.

The authors provide a mathematical proof that under linear activation, a standard RNN is a special case of an SRNN, establishing a theoretical foundation for this parallelized form of recurrence.

Experimental Setup

The SRNN was evaluated on six large-scale sentiment analysis benchmarks, including Yelp Reviews (2013, 2014, 2015), Yelp Polarity, and Amazon Reviews (Full and Polarity). These datasets provide a rigorous testbed due to their varying sequence lengths and large document counts, requiring models to capture both local and global context.

Results and Discussion

SRNNs demonstrate a superior balance of speed and accuracy. As shown in the performance tables, SRNN variants consistently outperform standard GRUs and Dilated Causal CNNs (DCCNNs) in terms of test accuracy while requiring significantly less training time per epoch.

Comparison of model performance on Yelp 2013 and 2014 datasets, highlighting the substantial reduction in training time per epoch for SRNNs compared to standard GRUs.

Speed and Scalability

The speed advantage of SRNNs is most pronounced with longer sequences. For a sequence length of 512, SRNNs are approximately 13.5x faster than standard GRUs. At an extreme length of 32,768, the speedup reaches 136x. This efficiency stems from the ability to process multiple subsequences in parallel, effectively reducing the time complexity relative to the sequence length.

Accuracy and Information Extraction

Beyond speed, SRNNs often achieve higher accuracy than their sequential counterparts. The hierarchical structure allows the model to extract information at different granularities—word or sentence level at lower layers, and paragraph or document level at higher layers—mimicking human reading patterns.

Conclusion

Sliced Recurrent Neural Networks provide a robust solution to the sequential bottleneck of traditional RNNs. By introducing a parallelizable hierarchical structure, SRNNs enable significantly faster training on modern hardware without compromising the model's ability to capture temporal dependencies. Future work will explore the application of SRNNs to sequence-to-sequence tasks such as machine translation and the integration of attention mechanisms.

Summary updated

BibTeX
@inproceedings{yu2018sliced,
  author = {Zeping Yu and Gongshen Liu},
  title = {{Sliced Recurrent Neural Networks}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2018},
}
Figure