SegRNN: Segment Recurrent Neural Network for Long-Term Time Series
  Forecasting
RNN-based methods have faced challenges in the Long-term Time Series
Forecasting (LTSF) domain when dealing with excessively long look-back windows
and forecast horizons. Consequently, the dominance in this domain has shifted
towards Transformer, MLP, and CNN approaches. The substantial number of
recurrent iterations are the fundamental reasons behind the limitations of RNNs
in LTSF. To address these issues, we propose two novel strategies to reduce the
number of iterations in RNNs for LTSF tasks: Segment-wise Iterations and
Parallel Multi-step Forecasting (PMF). RNNs that combine these strategies,
namely SegRNN, significantly reduce the required recurrent iterations for LTSF,
resulting in notable improvements in forecast accuracy and inference speed.
Extensive experiments demonstrate that SegRNN not only outperforms SOTA
Transformer-based models but also reduces runtime and memory usage by more than
78%. These achievements provide strong evidence that RNNs continue to excel in
LTSF tasks and encourage further exploration of this domain with more RNN-based
approaches. The source code is coming soon.
Shengsheng Lin, Weiwei Lin, Wentai Wu, Feiyu Zhao, Ruichao Mo, Haotong Zhang
# SegRNN: Segment Recurrent Neural Network for Long-Term Time Series Forecasting

###### Abstract

RNN-based methods have faced challenges in the Long-term Time Series Forecasting (LTSF) domain when dealing with excessively long look-back windows and forecast horizons. Consequently, the dominance in this domain has shifted towards Transformer, MLP, and CNN approaches. The substantial number of recurrent iterations are the fundamental reasons behind the limitations of RNNs in LTSF. To address these issues, we propose two novel strategies to reduce the number of iterations in RNNs for LTSF tasks: Segment-wise Iterations and Parallel Multi-step Forecasting (PMF). RNNs that combine these strategies, namely SegRNN, significantly reduce the required recurrent iterations for LTSF, resulting in notable improvements in forecast accuracy and inference speed. Extensive experiments demonstrate that SegRNN not only outperforms SOTA Transformer-based models but also reduces runtime and memory usage by more than 78%. These achievements provide strong evidence that RNNs continue to excel in LTSF tasks and encourage further exploration of this domain with more RNN-based approaches. The source code is coming soon.

## 1 Introduction

Time series forecasting involves using past observed time series data to predict future unknown time series. It finds applications in various fields, such as energy and smart grids, traffic flow control, server energy optimization [1]. Recurrent Neural Networks (RNNs) [14], as a deep learning architecture, have been extensively adopted for conventional time series forecasting due to their effectiveness in capturing sequential dependencies [11].

In recent years, there has been a shift in focus towards predicting longer horizons, known as Long-term Time Series Forecasting (LTSF) [23]. Figure 1 (a) illustrates the concept of LTSF, where the objective is to provide richer semantic information by predicting a longer future sequence, thus offering more practical guidance. However, extending the forecast horizon poses significant challenges: (i) Forecasting further into the future leads to increased uncertainty, resulting in decreased forecast accuracy. (ii) Longer forecast horizons require models to consider a more extensive historical context for accurate predictions, significantly increasing the complexity of modeling.

While RNNs have exhibited remarkable performance in conventional time-series tasks, they have gradually lost prominence in the LTSF domain. Figure 1 (b) and (c) illustrate the limitations of RNNs (either vanilla RNN or its variants: Long Short-Term Memory (LSTM) [15] and Gated Recurrent Unit (GRU) [1]) in LTSF: (i) The model's forecast error rapidly increases as the forecast horizon expands, especially when the horizon reaches 64, at which point it becomes comparable to random forecasting. (ii) The models' inference time rapidly increases with the length of horizon. These observations widely support the belief that RNNs are no longer suitable for LTSF tasks that involve modeling long-term dependencies [23, 24]. Consequently, there is currently no prominent RNN-based solution in the LTSF field.

In contrast, Transformers [22], an advanced neural network architecture designed to model long-term dependencies in sequences, have achieved remarkable success in natural language processing, computer vision, and other fields. Consequently, there has been a surge in Transformer-based LTSF solutions, breaking several state-of-the-art (SOTA) records [23, 25, 26].

Figure 1: Challenges faced by vanilla RNN and its variants in LTSF. Data is obtained from the ETTh1 dataset.
2023). The undeniable efficacy of Transformers notwithstanding, their intricate design and substantial computational requirements have constrained their accessibility. Recently, there has been significant debate regarding whether the self-attention mechanism in Transformers is suitable for modeling time-series tasks (Zeng et al., 2023; Li et al., 2023). This leads us to contemplate: _Are RNNs, which are conceptually simple and structurally well-suited for modeling time-series data, truly unsuitable for LTSF tasks?_

_The answer might be No._ It is well-known that RNNs suffer from the vanishing/exploding gradient problem (Bengio, Simard, and Frasconi, 1994), which limits the length of sequences they can effectively model. We can hypothesize that the current RNNs' failure in LTSF stems from excessively long look-back and forecast horizons, which result in prohibitively high recurrent iteration counts. To address this, we propose a straightforward yet powerful strategy: **Minimizing the count of recurrent iterations in RNNs while striving to retain sequential information.** Specifically, we introduce SegRNN, which is designed with two key components:

1. [leftmargin=*]
2. The incorporation of segment technology in RNNs, replacing point-wise iterations with segment-wise iterations, significantly reducing the number of recurrent iterations.
3. The introduction of the Parallel Multi-step Forecasting (PMF) strategy, further reducing the number of recurrent iterations. The comparison between PMF and the traditional Recurrent Multi-step Forecasting (RMF) is illustrated in Figure 2.

Experimental results on popular LTSF benchmarks demonstrate that these two key design components significantly improve RNNs' performance in the LTSF domain. Reducing the number of recurrent iterations not only greatly improves the prediction accuracy of RNNs but also significantly enhances their inference speed. In most scenarios, SegRNN outperforms SOTA Transformer-based models, featuring a runtime and memory reduction of over 78%. We provide strong evidence that RNNs still possess powerful capabilities in the LTSF domain.

In summary, our contributions are as follows:

* We propose SegRNN, which utilizes time-series segment technique to replace point-wise iterations with segment-wise iterations in LTSF.
* We further introduce the PMF technique to enhance the inference speed and performance of RNNs.
* The proposed SegRNN outperforms the current SOTA methods while significantly reducing runtime and memory usage.
* The success of SegRNN demonstrates substantial improvements over existing RNN methods, highlighting the strong potential of RNNs in the LTSF domain.

## 2 Related Work

Significant efforts have been devoted to advancing the field of time series forecasting (An and Anh, 2015). With the evolution of hardware capabilities, deep learning approaches have gained prominence in uncovering patterns within time series data (Han et al., 2021). These approaches can be broadly categorized as follows:

Transformers.Originally designed for natural language processing tasks (Vaswani et al., 2017), Transformers have achieved remarkable success in various domains (Khan et al., 2022; Arnab et al., 2021). The self-attention mechanism in Transformers enables them to capture long-term dependencies in time series data, leading to a considerable body of work focused on adapting Transformers to LTSF tasks, demonstrating impressive performance (Wen et al., 2023). Earlier efforts, such as LogTrans (Li et al., 2019), Informer (Zhou et al., 2021), Pyraformer (Liu et al., 2021), Autoformer (Wu et al., 2021), and FEDformer (Zhou et al., 2022), aimed at reducing the complexity of Transformers. More recently, PatchTST (Nie et al., 2023) and Crossformer (Zhang and Yan, 2023) leveraged patch-based techniques from computer vision (Dosovitskiy et al., 2021; He et al., 2022), further enhancing the performance of Transformers. The patch technique, which inspired the segment-wise iterations technique in this paper, has proven to be influential.

MLPs.Multi-Layer Perceptrons (MLPs) have also found extensive use in time series forecasting (Olivares et al., 2023; Fan et al., 2022; Challu et al., 2023). Recently, DLinear achieved superiority over then-state-of-the-art Transformer-based models through a simple linear layer and channel-independent strategy (Zeng et al., 2023). The success of DLinear has spurred the development of a plethora of MLPs in LTSF, including MTS-Mixers (Li et al., 2023), TSMixer (Vijay et al., 2023), and TiDE (Das et al., 2023). The accomplishments of these MLP-based models have raised questions about the necessity of employing complex and cumbersome Transformers for time series prediction.

CNNs.Initially applied in image processing for capturing local patterns and extracting meaningful features (Krizhevsky, Sutskever, and Hinton, 2012; He et al., 2016), Convolutional Neural Networks (CNNs) have also shown remarkable performance in the time series domain (Bai, Kolter, and Koltun, 2018; Franceschi, Dieuleveut, and Jaggi, 2019; Cheng, Huang, and Zheng, 2020). Recently, CNN-based models such as MICN (Wang et al., 2023), TimesNet

Figure 2: Comparison of Recurrent Multi-step Forecasting (RMF) and Parallel Multi-step Forecasting (PMF). The positional embedding \(pe_{i}\) in PMF serves as a replacement for the sequential information of the recurrent structure.
(Wu et al., 2023), and SCINet (LIU et al., 2022) have demonstrated impressive results in the LTSF field.

**RNNs.** Recurrent Neural Networks (RNNs) have long been the primary choice for time series forecasting tasks due to their ability to handle sequential data. Numerous efforts have been devoted to utilizing RNNs for short-term and probabilistic forecasting, achieving significant advancements (Lai et al., 2018; Bergsma et al., 2022; Wen et al., 2018; Tan et al., 2023). However, in the LTSF domain with excessively long look-back windows and forecast horizons, RNNs have been considered inadequate for effectively capturing long-term dependencies, leading to their gradual abandonment (Zhou et al., 2021, 2022). The emergence of SegRNN aims to challenge and change this situation by attempting to address these limitations.

## 3 Preliminaries

This section introduces the formulation of the LTSF problem, the Channel Independent (CI) strategy, and the fundamental RNN and its variants.

### LTSF Problem Formulation

The LTSF problem deals with predicting the future time series \(Y\in\mathbb{R}^{H\times C}\) based on a historical multivariate time series (MTS) \(X\in\mathbb{R}^{L\times C}\). Here, \(L\) represents the length of the historical look-back window, \(C\) denotes the number of feature dimensions or channels, and \(H\) signifies the length of the forecast horizon. The goal of the LTSF task is to extend the forecasting horizon \(H\) to its maximum potential (e.g., up to 720), which poses a considerable challenge.

### Channel Independent Strategy

Intuitively, it may appear optimal to use all historical variables in a MTS to forecast all future variables simultaneously, as it captures the interrelations between the variables. However, recent studies have shown that the Channel Independent (CI) strategy surpasses this traditional approach (Han et al., 2023). The CI strategy aims to identify a function \(f:X^{(i)}\in\mathbb{R}^{L}\to Y^{(i)}\in\mathbb{R}^{H}\) that maps the univariate historical time series data to the future time series values, as opposed to \(f:X\in\mathbb{R}^{L\times C}\to Y\in\mathbb{R}^{H\times C}\), which maps the multivariate historical time series data to the future time series values. The current SOTA LTSF models have embraced the CI strategy (Zeng et al., 2023; Nie et al., 2023; Das et al., 2023), and we similarly align ourselves with this approach. Furthermore, our model introduces a channel identifier (Shao et al., 2022) to enhance its predictive capability for multivariate sequences, which will be discussed comprehensively in the following sections.

### RNN Variants

The vanilla RNN faces challenges such as vanishing and exploding gradients, which hinder the model's convergence during training (Bengio et al., 1994). To address these issues, LSTM and GRU architectures optimize the structure of their cell units. Figure 3 illustrates the differences in cell unit structures among these fundamental RNN variants. For more comprehensive information, we strongly recommend referring to the original papers (Hochreiter and Schmidhuber, 1997; Cho et al., 2014).

The proposed SegRNN is not limited to a specific RNN cell structure. Considering the stable performance of GRU in practical scenarios, this paper employs GRU as an exemplar to illustrate the architecture and performance of SegRNN. Therefore, for consistency throughout the text, the SegRNN model is assumed to be based on the GRU cell unless explicitly stated otherwise.

## 4 Model Architecture

The recurrent iterative nature of RNNs poses challenges for effective convergence when modeling extensive long sequences. SegRNN aims to reduce the number of recurrent iterations to facilitate its convergence. Specifically, SegRNN employs the following strategies:

1. In the encoding phase, it replaces the original time point-wise iterations with sequence segment-wise iterations, effectively reducing the number of iterations from \(L\) to \(L/w\).
2. In the decoding phase, it utilizes the PMF strategy to further reduce the number of iterations from \(H/w\) to 1.

The substantial reduction in the number of recurrent iterations in RNN not only leads to a remarkable performance improvement but also results in a significant increase in inference speed. The model architecture of SegRNN is illustrated in Figure 4.

### Encoding

**Segment partition and projection.** Given a sequence channel \(X^{(i)}\in\mathbb{R}^{L}\), it can be partitioned into segments \(X^{(i)}_{w}\in\mathbb{R}^{n\times w}\), where \(w\) represents the window length of each segment, and \(n=\frac{L}{w}\) denotes the number of segments. These segments, \(X^{(i)}_{w}\in\mathbb{R}^{n\times w}\), are then transformed to \(X^{(i)}_{d}\in\mathbb{R}^{n\times d}\) through a learnable linear projection \(W_{prj}\in\mathbb{R}^{w\times d}\) followed by a ReLU activation, where \(d\) represents the dimensionality of the hidden state of the GRU.

**Recursive encoding.** Subsequently, the transformed \(X^{(i)}_{d}\) is fed into the GRU for recurrent iterations to capture temporal features. Specifically, for \(x_{t}\in\mathbb{R}^{d}\) in \(X^{(i)}_{d}\), the entire process within the GRU cell can be formulated as:

\[z_{t} =\sigma\left(W_{z}\cdot[h_{t-1},x_{t}]\right),\] \[r_{t} =\sigma\left(W_{r}\cdot[h_{t-1},x_{t}]\right),\] \[\tilde{h}_{t} =\tanh\left(W\cdot[r_{t}\times h_{t-1},x_{t}]\right),\]

Figure 3: Comparison of the cell of RNN and its variants.
\(h_{t}=(1-z_{t})\times h_{t-1}+z_{t}\times\tilde{h}_{t}\).

After \(n\) recurrent iterations, the hidden feature \(h_{n}\) obtained from the last step already encapsulates all the temporal features of the original sequence \(X^{(i)}\). This hidden feature will be passed to the Decoding part for the subsequent steps of inference and prediction.

### Decoding

RMF is a straightforward method for accomplishing multi-step prediction. In RMF, single-step predictions are made to obtain \(\bar{y}_{t}\). The predicted \(\bar{y}_{t}\) is then used as input for the subsequent prediction of \(\bar{y}_{t+1}\), and this process continues until the complete set of prediction results is obtained. By incorporating the segment technique from the Encoding phase with RMF, the number of iterations required for a prediction horizon of \(H\) is reduced to \(H/w\).

However, despite the reduction in the number of recurrent iterations, recursive decoding has its limitations. These include: (i) the accumulation of errors resulting from recursive predictions, and (ii) the sequential nature of recursion, which hampers parallel computation within training examples and restricts improvements in inference speed (Vaswani et al., 2017). To address these limitations, we propose a novel prediction strategy called Parallel Multi-step Forecasting (PMF), as described below.

Positional embeddings.During the decoding phase, the sequential order between segments is lost due to the break in the recurrent recursion. To address this, \(m\) corresponding positional embeddings, denoted as \(PE^{(i)}\in\mathbb{R}^{m\times d}\), are generated to identify the positions of the segments. Here, \(m=\frac{H}{w}\) represents the number of windows obtained by partitioning the prediction horizon into segments. Each positional embedding \(pe^{(i)}\in\mathbb{R}^{d}\) is constructed by concatenating the relative position encoding \(rp\in\mathbb{R}^{\frac{d}{2}}\) and the channel position encoding \(cp\in\mathbb{R}^{\frac{d}{2}}\).

Figure 5 illustrates the positional embeddings for the target sequence \(Y^{(i)}\). The relative position encoding indicates the position of each segment that needs to be predicted within the complete sequence \(Y^{(i)}\). Meanwhile, the channel position encoding represents the channel position \(i\in{1,2,...,C}\) of the current sequence \(Y^{(i)}\) within the multi-channel sequence \(Y\in\mathbb{R}^{H\times C}\)(Shao et al., 2022). The inclusion of the channel position encoding partially compensates for the limitations of the CI strategy in capturing relationships between variables, thereby enhancing the model's performance.

Parallel decoding.In the Decoding phase, the same GRU cell used in the Encoding phase is shared. Specifically, the final state \(h_{n}\) obtained from the Encoding phase is duplicated \(m\) times and combined with the \(m\) positional embeddings from \(PE^{(i)}\). These pairs are then simultaneously processed in parallel by the GRU cell. This parallel processing generates \(m\) output vectors, each with a length of \(d\), denoted as \(\bar{Y}_{d}^{(i)}\in\mathbb{R}^{m\times d}\). It is important to note that this approach differs from the previous recursive processing in RMF, as the computation of each vector is independent of the previous time step's result. As a result, intra-sample parallel computation is achieved, leading to improved inference speed. Additionally, prediction errors do not accumulate with the number of iterations, resulting in enhanced prediction accuracy.

Prediction and sequence recovery.The \(\bar{Y}_{d}^{(i)}\) undergoes a Dropout layer, randomly dropping out a certain proportion of values for regularization purposes. Subsequently, it is transformed into \(\bar{Y}_{w}^{(i)}\in\mathbb{R}^{m\times w}\) using a learnable linear prediction layer \(W_{prd}\in\mathbb{R}^{d\times w}\). Furthermore, \(\bar{Y}_{w}^{(i)}\) is reshaped

Figure 4: The model architecture of SegRNN.

Figure 5: Positional embeddings \(PE^{(i)}\) for the target sequence \(Y^{(i)}\).
into \(\bar{Y}^{(i)}\in\mathbb{R}^{H}\), representing the final prediction result.

### Normalization and Evaluation

Instance normalization.Time series data often experience distribution shift issues, and employing simple sample normalization strategies can help alleviate this problem. In this paper, we utilize a simple sample normalization strategy [13] that involves subtracting the last value of the sequence from the input before encoding and subsequently adding back the value after decoding, formulated as:

\[x^{(i)}_{1:L} =x^{(i)}_{1:L}-x^{(i)}_{L},\] \[\bar{y}^{(i)}_{1:L} =\bar{y}^{(i)}_{1:L}+x^{(i)}_{L}.\]

Loss function.The mean absolute error (MAE) is employed as the loss function for our model, defined as:

\[\mathcal{L}(Y,\bar{Y})=\frac{1}{HC}\sum_{t=1}^{H}\sum_{i=1}^{C}|\bar{y}^{(i)}_{ t}-y^{(i)}_{t}|.\]

## 5 Experiments

In this section, we present the main experimental results on popular LTSF benchmarks. Furthermore, we conduct an ablation study to analyze the impact of the segment-wise iterations and the PMF strategies on the effectiveness of RNN in LTSF. We also investigate the influence of some important parameters on SegRNN. All experiments in this section are implemented in PyTorch and executed on two NVIDIA T4 GPUs, each equipped with 16GB of memory.

### Experimental Setup

An overview of the experimental setup is presented here, and for further details, please refer to the Appendix.

Datasets.The performance evaluation of SegRNN is carried out on 7 popular datasets in the LTSF domain, comprising 4 ETT datasets (ETTh1, ETTh2, ETTm1, ETTm2), as well as Traffic, Electricity, and Weather datasets. The statistics of these datasets are presented in Table 1.

Baselines and metrics.As baselines, we select SOTA and representative models in the LTSF domain, including the following categories: (i) Transformers: PatchTST [21], FEDformer [15], Informer [15]; (ii) MLPs: TiDE [13], Dlinear [13]; (iii) CNNs: MICN [12], TimesNet [23]; (iv) RNNs: DeepAR [2], GRU [1]. It is worth mentioning that while DeepAR and GRU were not initially designed for LTSF, we include them as baselines due to the limited presence of prominent RNN solutions in the field. The proposed SegRNN aims to fill this gap.

Two commonly employed evaluation metrics, Mean Squared Error (MSE) and Mean Absolute Error (MAE), are used here to assess the performance of the LTSF models.

Model configuration.The uniform configuration of SegRNN consists of a look-back of 720, a segment length of 48, a single GRU layer, a hidden size of 512, 30 training epochs, a learning rate decay of 0.8 after the initial 3 epochs, and early stopping with a patience of 10. The dropout rate, batch size, and learning rate vary based on the scale of the data.

### Main Result

The multivariate long-term time series forecasting results of SegRNN and other baselines are presented in Table 2. Remarkably, SegRNN achieved top-two positions in 50 out of 56 metrics across all scenarios, including 45 first-place rankings, signifying its significant superiority over other baselines, including the current SOTA transformer-based model, PatchTST. SegRNN demonstrated outstanding performance on the ETT and Weather datasets, nearly surpassing the SOTA performance across all metrics. In larger-scale datasets such as Electricity and Traffic, where the channel numbers exceed 300 and 800, respectively, SegRNN's performance experienced a slight decrease. This is likely due to the relatively smaller capacity of the SegRNN model, as it is built on a single GRU layer. However, even in these cases, SegRNN demonstrated competitive or superior performance compared to the competing models.

Regarding the RNN-based methods GRU and DeepAR, SegRNN achieved MSE improvements of 75% and 80%, respectively. This provides strong evidence that SegRNN significantly enhances the performance of existing RNN methods in the LTSF domain. These results highlight the success of the SegRNN design and demonstrate that RNN methods still hold strong potential in the current LTSF domain.

### Ablation Studies

Segment-wise iterations vs. point-wise iterations.Figure 6 illustrates the performance differences between segment-wise and point-wise iterations. It is essential to note that the segment length directly determines the number of iterations, and when the segment length \(w=1\), segment-wise

\begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline Datasets & ETTTh1 & ETTh2 & ETTm1 & ETTm2 & Electricity & Traffic & Weather \\ \hline Channels & 7 & 7 & 7 & 7 & 7 & 321 & 862 & 21 \\ Frequency & 1 hour & 1 hour & 15 mins & 15 mins & 1 hour & 1 hour & 10 mins \\ Timesteps & 17,420 & 17,420 & 69,680 & 69,680 & 26,304 & 17,544 & 52,696 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of datasets for evaluation.

Figure 6: The forecast error (bar plot) and the inference time (line plot) of SegRNN with different segment length on ETTm1 dataset. Both look-back and horizon are 192.
iterations degenerates into point-wise iterations. The following observations can be made:

1. [leftmargin=*]
2. As the segment length increases (i.e., the number of iterations decreases), the forecast error consistently decreases. However, when the segment length equals the look-back length, the model degenerates into a multi-layer perceptron, leading to an increase in prediction error.
3. With the continuous increase of the segment length, the inference time steadily decreases.

These findings indicate that a relatively large yet appropriate segment length (i.e., minimizing the number of iterations) significantly improves the performance of the RNN method in LTSF.

PMF vs. RMF.Figure 7 illustrates the performance disparities between RMF and PMF. Concerning the forecast error, PMF significantly outperforms RMF for various forecast horizons, exhibiting a more stable distribution. The advantage of PMF becomes increasingly evident as the forecast horizon increases.

As for inference time, when the forecast horizon \(H<192\), PMF is slightly slower than RMF. This is because the intra-sample parallel computation advantage of PMF is not fully manifested with fewer iterations; instead, it incurs additional overhead due to data replication in memory. However, when the forecast horizon \(H>192\), the larger number of iterations allows PMF to leverage its intra-sample parallel computation advantage, leading to improved hardware utilization and accelerated computation.

In conclusion, these results demonstrate that PMF significantly enhances the performance of RNNs in LTSF tasks compared to RMF.
Impact of look-back length.A powerful LTSF model typically performs better with a longer look-back context as it contains more trend and periodic information. The ability to leverage a longer look-back context directly reflects the model's capability to capture long-term dependencies. However, longer look-back contexts also increase the modeling complexity, and many Transformer-based models encounter difficulties when dealing with long look-back scenarios (i.e., \(L>96\)) [23].

Regarding SegRNN, as illustrated in Figure 8, the forecast error consistently diminishes as the look-back length increases. Notably, SegRNN also exhibits commendable performance with relatively shorter look-backs, showcasing its robustness across diverse look-back lengths. This finding suggests that SegRNN not only excels in modeling long-term dependencies but also maintains its robustness in handling varying look-back requirements.

Impact of RNN variants.The proposed SegRNN exhibits versatility across various RNN types. Nevertheless, in practical implementations, it consistently achieves lower forecast errors and demonstrates greater stability when employed with the GRU variant, as depicted in Figure 9. This advantage is attributed to the integration of gating mechanisms in the GRU, which enhances its capacity to model long-term dependencies while retaining a simpler structure in comparison to LSTM. Consequently, SegRNN defaults to the adoption of GRU. However, should more potent RNN variants emerge in the future, SegRNN holds the potential to further bolster its robustness.

SegRNN vs. PatchTST.We conducted a comparison between SegRNN and the latest SOTA Transformer-based model, PatchTST, to showcase the runtime performance advantage of SegRNN. Table 3 reveals that compared to PatchTST, SegRNN demonstrates a reduction of over 78% in average training time and a decrease of over 82% in average maximum GPU memory consumption. This significant improvement in efficiency is particularly beneficial for practical model training and deployment.

## 6 Conclusion

In this paper, we introduce SegRNN, an innovative RNN-based model designed for Long-term Time Series Forecasting (LTSF). SegRNN incorporates two fundamental strategies: (i) the replacement of point-wise iterations with segment-wise iterations, and (ii) the substitution of Recurrent Multi-step Forecasting (RMF) with Parallel Multi-step Forecasting (PMF). The segment-wise iteration strategy significantly reduces the number of required recurrent iterations for extracting temporal features, thus addressing the challenge of effectively training RNNs on excessively long sequences. Moreover, the adoption of PMF further mitigates the issue of error accumulation inherent in traditional RMF methods. By adopting these innovative strategies, SegRNN not only outperforms the current SOTA models in terms of prediction accuracy but also yields substantial efficiency improvements, including a remarkable reduction of over 78% in training time and memory usage. These compelling outcomes serve as robust evidence that RNNs remain potent in LTSF tasks, thereby encouraging further exploration and breakthroughs with more RNN methods in the future.

Figure 8: The forecast error of SegRNN with different look-back length on ETTm1 dataset. The horizon is 192.

\begin{table}
\begin{tabular}{c c c c c} \hline \hline Metric & Datasets & PatchTST & SegRNN & Imp. \\ \hline \multirow{2}{*}{Training Time} & ETTm1 & 94.9 & 29.7 & 69\% \\  & Weather & 273.4 & 50.3 & 82\% \\  & Electricity & 1.97k & 313.8 & 84\% \\ \hline \multirow{3}{*}{MACs (MMac)} & ETTm1 & 265.9 & 213.4 & 20\% \\  & Weather & 797.8 & 640.2 & 20\% \\  & Electricity & 12.2k & 9.79k & 20\% \\ \hline \multirow{3}{*}{Parameters (M)} & ETTm1 & 2.62 & 1.63 & 38\% \\  & Weather & 2.62 & 1.63 & 38\% \\  & Electricity & 2.62 & 1.71 & 35\% \\ \hline \multirow{3}{*}{Max Memory (MB)} & ETTm1 & 289 & 77 & 73\% \\  & Weather & 780 & 124 & 84\% \\ \cline{1-1}  & Electricity & 11.3k & 1.23k & 89\% \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison of performance metrics between SegRNN and PatchTST on ETTm1 dataset with a single NVIDIA T4 GPU. The look-back is 720 and the horizon is 192.

Figure 9: The forecast error of SegRNN with different RNN variants on ETTm1 dataset. The look-back is 720 and the horizon is 192.
Appendix

In this section, we provide additional information, including more detailed experimental details, SegRNN's results in univariable long-term time series forecasting, convergence of different iteration schemes, and an analysis of the role of positional embeddings in PMF.

### Experimental details

**Datasets.** We utilize the most popular multivariate datasets in Long-term Time Series Forecasting (LTSF), including:

* ETTs1: These datasets contain data collected from electricity transformers, including 7 indicators recorded from July 2016 to July 2018 in two regions of a province in China. ETTh1 and ETTh2 provide hourly-level data, while ETTm1 and ETTm2 offer data at a 15-minute granularity. Footnote 1: [https://github.com/zhouhaoyi/ETDataset](https://github.com/zhouhaoyi/ETDataset)
* Electricity: This dataset comprises hourly electricity consumption for 321 customers from 2012 to 2014.
* Traffic2: Collected by the California Department of Transportation, this dataset provides hourly data describing road occupancy measured by 862 sensors on highways in the San Francisco Bay Area. Footnote 2: [https://pems.dot.ca.gov/](https://pems.dot.ca.gov/)
* Weather3: This dataset includes 21 meteorological indicators, such as temperature and humidity, recorded every 10 minutes throughout the year 2020.

Footnote 3: [https://www.bgc-jena.mpg.de/weitter/](https://www.bgc-jena.mpg.de/weitter/)

We split all the datasets into training, validation, and test sets in chronological order. Following previous research [21, 22, 23, 24], the ETT datasets are split into proportions of 6:2:2, while the other datasets are divided into proportions of 7:1:2.

**Baselines.** We selected various state-of-the-art (SOTA) deep learning methods in the LTSF domain as our baselines, including:

* PatchTST [23]: The most advanced Transformer-based method as of July 2023. It improves the performance of Transformers in LTSF by partitioning time series into patches and adopting a channel independent strategy. The patch technique not only inspired subsequent works such as TS-Mixer but also influenced the segment-wise iterations strategy proposed in this paper.
* FEDformer [22]: This method combines Transformer with the seasonal-trend decomposition method and frequency-enhanced techniques, making it one of the classic Transformer-based approaches for time series forecasting.
* Informer [22]: A pioneering method that introduced the prob-sparse self-attention mechanism, self-attention distilling, and the generative style decoder. It paved the way for Transformers in LTSF and discussed the challenges faced by RNNs in long-term modeling, which led to the rise of Transformer methods and the decline of RNNs in the LTSF domain.
* DLinear [23]: An influential work that defeated the dominant Transformer-based methods, including FEDformer and Informer, by using trend decomposition and a single-layer linear approach. It questioned the necessity of attention mechanisms in modeling time series tasks. Additionally, it indirectly proposed the channel independence technique and brought attention to the importance of long look-back, inspiring subsequent research.
* TiDE [23]: Clearly inspired by DLinear, TiDE inherits the channel independence technique and upgrades the linear layer to a multi-layer perceptron capable of modeling nonlinear dependencies. TiDE achieves comparable performance to PatchTST and is currently one of the most advanced MLP methods.
* MICN [24]: This method introduces the Multi-scale Isometric Convolution Network to capture both local and global features of time series simultaneously. It is one of the most advanced CNN-based methods as of the current state.
* TimesNet [25]: This method extends the analysis of temporal variations into 2D space by transforming 1D time series into a set of 2D tensors based on multiple periods, providing a task-general foundation model for time series analysis.
* DeepAR [26]: A classic RNN-based time series forecasting model that utilizes a deep LSTM network for Probabilistic forecasting. We modified it for long-term forecasting to use as a baseline.
* GRU [1]: One of the powerful variants of RNN that mitigates the vanishing/exploding gradient problem. We employed it for long-term forecasting as the most basic RNN baseline.

For the results in Table 2, the data for PatchTST, FEDformer, and Informer are sourced from the PatchTST's official publication, while the data for DLinear, TiDE, MICN, and TimesNet are from their respective official papers. We implemented DeepAR and GRU ourselves, using a look-back of 720.

**Configuration.** We employed the Adam optimizer [10] to train the models for 30 epochs, with a learning rate decay of 0.8 after the initial 3 epochs. Early stopping was implemented with a patience of 10. The specific parameters used for SegRNN on different datasets are presented in Table 4. The meanings of each parameter in the table are as follows:

\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline Datasets & 1\_pack & s\_len & d\_model & channel & dropout & b\_size & 1\_rate \\ \hline ETTh1 & 720 & 48 & 512 & True & 0.5 & 256 & 0.001 \\ ETTh2 & 720 & 48 & 512 & True & 0.5 & 256 & 0.0002 \\ ETTm1 & 720 & 48 & 512 & True & 0.5 & 256 & 0.0002 \\ ETTm2 & 720 & 48 & 512 & True & 0.5 & 256 & 0.0001 \\ Weather & 720 & 48 & 512 & True & 0.5 & 64 & 0.0001 \\ Electricity & 720 & 48 & 512 & True & 0.1 & 16 & 0.0005 \\ Traffic & 720 & 48 & 512 & False & 0.1 & 8 & 0.003 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The complete configuration of SegRNN results in Table 2.
* 1_back: The length of the historical look-back window.
* s_len: The window length for dividing the original sequence into segments.
* d_model: The dimensionality of the hidden variables in the RNN layer.
* channel: Whether to enable channel positional embeddings.
* dropout: The dropout rate.
* b_size: The batch size used for training.
* 1_rate: The initial learning rate used in the optimization process.

### Univariate Forecasting Results

The univariate long-term time series forecasting results of SegRNN and other baselines on the full ETT benchmarks are presented in Table 5. The channel position encoding is disabled in univariate scenarios. Remarkably, SegRNN achieved a top-two position in 30 out of 32 metrics across all scenarios, including 23 first-place rankings, signifying its significant superiority over other baselines. These results further demonstrate the effectiveness of SegRNN and reaffirm the competitiveness of RNN methods in LTSF, whether in multivariate or univariate scenarios.

### Convergence of Different Iteration Schemes

Figure 10 illustrates the convergence curve of point-wise iterations and segment-wise iterations. It is evident that segment-wise iterations have considerably enhanced both the final convergence error and the convergence speed when compared to point-wise iterations. Furthermore, as the segment length increases (indicating a decrease in the number of segment-wise iterations), this improvement becomes more pronounced. Conclusionly, reducing the number of iterations as much as possible facilitates the convergence of the RNN and consequently enhances its performance.

Translated with www.DeepL.com/Translator (free version)

### Effect of Positional Embeddings

Table 6 presents the results of the ablation study on the effect of Positional Embeddings (PE). It can be observed that the Relative Position (RP) encoding plays a crucial role in PE. Compared to the original scheme without RP (None), the MSE is reduced by 28.8%. This is because, for Parallel Multi-step Forecasting (PMF), the sequential order between segments is lost, and thus, it is essential to provide the model with relative positional information. As for the

Figure 10: The convergence curve of point-wise iterations and segment-wise iterations on ETTm1 dataset.

\begin{table}
\begin{tabular}{c|c c c c c c c c c c c c c} \multicolumn{1}{c}{Models} & \multicolumn{2}{c}{SegRNN} & \multicolumn{2}{c}{PatchTST} & \multicolumn{2}{c}{Dlinear} & \multicolumn{2}{c}{MICN} & \multicolumn{2}{c}{FEDformer} & \multicolumn{2}{c}{Autoormer} & \multicolumn{2}{c}{Informer} \\  & \multicolumn{2}{c}{(ours)} & \multicolumn{2}{c}{(2023)} & \multicolumn{2}{c}{(2023)} & \multicolumn{2}{c}{(2023)} & \multicolumn{2}{c}{(2022)} & \multicolumn{2}{c}{(2021)} & \multicolumn{2}{c}{(2021)} \\ \hline \multicolumn{1}{c}{Metric} & MSE & MAE & MSE & MAE & MSE & MAE & MSE & MAE & MSE & MAE & MSE & MAE & MSE & MAE \\ \hline \multirow{3}{*}{ETTh1} & 96 & **0.053** & **0.18** & 0.059 & 0.189 & 0.056 & **0.18** & 0.058 & 0.186 & 0.079 & 0.215 & 0.071 & 0.206 & 0.193 & 0.377 \\  & 192 & **0.068** & 0.208 & 0.074 & 0.215 & 0.071 & **0.204** & 0.079 & 0.21 & 0.104 & 0.245 & 0.114 & 0.262 & 0.217 & 0.395 \\  & 336 & **0.073** & **0.215** & 0.076 & 0.22 & 0.098 & 0.244 & 0.092 & 0.237 & 0.119 & 0.270 & 0.107 & 0.258 & 0.202 & 0.381 \\  & 720 & **0.085** & **0.233** & 0.087 & 0.236 & 0.189 & 0.359 & 0.138 & 0.298 & 0.142 & 0.299 & 0.126 & 0.283 & 0.183 & 0.355 \\ \hline \multirow{3}{*}{ETTh2} & 96 & **0.121** & 0.272 & 0.131 & 0.284 & 0.131 & 0.279 & 0.155 & 0.3 & 0.128 & **0.271** & 0.153 & 0.306 & 0.213 & 0.373 \\  & 192 & **0.158** & 0.317 & 0.171 & 0.329 & 0.176 & 0.329 & 0.169 & **0.316** & 0.185 & 0.330 & 0.204 & 0.351 & 0.227 & 0.387 \\  & 336 & 0.18 & 0.345 & **0.171** & **0.336** & 0.209 & 0.367 & 0.238 & 0.384 & 0.231 & 0.378 & 0.246 & 0.389 & 0.242 & 0.401 \\  & 720 & **0.205** & **0.365** & 0.223 & 0.38 & 0.276 & 0.426 & 0.447 & 0.561 & 0.278 & 0.420 & 0.268 & 0.409 & 0.291 & 0.439 \\ \hline \multirow{3}{*}{ETTm1} & 96 & **0.026** & **0.121** & **0.026** & 0.123 & 0.028 & 0.123 & 0.033 & 0.134 & 0.033 & 0.140 & 0.056 & 0.183 & 0.109 & 0.277 \\  & 192 & **0.039** & 0.152 & 0.04 & **0.151** & 0.045 & 0.156 & 0.048 & 0.164 & 0.058 & 0.186 & 0.081 & 0.216 & 0.151 & 0.310 \\  & 336 & **0.052** & 0.177 & 0.053 & **0.174** & 0.061 & 0.182 & 0.079 & 0.21 & 0.084 & 0.231 & 0.076 & 0.218 & 0.427 & 0.591 \\  & 720 & 0.081 & 0.223 & **0.073** & **0.206** & 0.08 & 0.21 & 0.096 & 0.233 & 0.102 & 0.250 & 0.110 & 0.267 & 0.438 & 0.586 \\ \hline \multirow{3}{*}{ETTm2} & 96 & **0.059** & **0.174** & 0.065 & 0.187 & 0.063 & 0.183 & **0.059** & 0.176 & 0.067 & 0.198 & 0.065 & 0.189 & 0.088 & 0.225 \\  & 192 & **0.084** & **0.215** & 0.093 & 0.231 & 0.092 & 0.227 & 0.1 & 0.234 & 0.102 & 0.245 & 0.118 & 0.256 & 0.132 & 0.283 \\ \cline{1-1}  & 336 & **0.108** & **0.25** & 0.121 & 0.266 & 0.119 & 0.261 & 0.153 & 0.301 & 0.130 & 0.279 & 0.154 & 0.305 & 0.180 & 0.336 \\ \cline{1-1}  & 720 & **0.153** & **0.304** & 0.172 & 0.322 & 0.175 & 0.322 & 0.21 & 0.354 & 0.178 & 0.325 & 0.182 & 0.335 & 0.300 & 0.435 \\ \hline \multicolumn{1}{c}{Count} & \multicolumn{2}{c}{**30**} & \multicolumn{2}{c}{17} & \multicolumn{2}{c}{14} & \multicolumn{2}{c}{5} & \multicolumn{2}{c}{2} & \multicolumn{2}{c}{0} & \multicolumn{2}{c}{0} & \multicolumn{2}{c}{0} \\ \hline \end{tabular}
\end{table}
Table 5: Univariate long-term time series forecasting results. The forecast horizon \(H\in\{\{96,192,336,720\}\}\) is set for all datasets. The reported SegRNN results are averaged over 5 runs. The best results are highlighted in **bold** and the second best are underlined. The _Count_ row counts the total number of times each method obtained the best or second results.
Channel Position (CP) encoding, it also contributes to some performance improvements. CP compensates for the missing relationship information between variables in the Channel Independent (CI) strategy, which has been extensively studied in STID [22]. However, in the case of Traffic, it might be an exception due to having over 800 variables. Modeling overly complex variable information solely through simple CP encoding might not be sufficient. Therefore, in the future, finding more reasonable ways to model complex multivariate relationships in time series forecasting will be a challenging yet promising direction.
