← Back to Home

Comparative Analysis of RNN, GRU, and LSTM for Airline Passenger Time Series Forecasting

Hojung Lim  ·  MASC 520 – Project 3 · USC Spring 2026

RNN GRU LSTM Time Series PyTorch Forecasting Hyperparameter Tuning

Overview

Vanilla RNN, GRU, and LSTM compared on the International Airline Passengers dataset (144 monthly counts, 1949–1960). A baseline (Test 1) vs. an improved training regime (Test 2) shows that training methodology — not just architecture — determines whether a theoretically stronger model delivers better results. Best result: LSTM RMSE = 33.17 (Test 2, lr=0.005).
33.17
Best RMSE (LSTM, Test 2)
52%
LSTM Improvement over Baseline
64
Optimal Hidden Units
lr = 0.005
Optimal Learning Rate

Method

Figure 1: Network Architecture

Figure 1: Shared recurrent network architecture — 64 hidden units, dropout, FC output

All three models share the same structure: a recurrent layer with 64 hidden units, a dropout layer (rate=0.0), and a fully connected output layer producing a single scalar. The vanilla RNN uses tanh activation; GRU and LSTM use gating mechanisms.

Dataset: 144 monthly passenger counts normalized to [0,1] with min-max scaling. Sliding window of length 12 (matching the seasonal period) creates input-output pairs. 80/20 temporal split: 105 training sequences, 27 validation sequences.

Training Configurations

HyperparameterTest 1 (Baseline)Test 2 (Improved)
Epochs150300
Learning Rate0.0010.005
Batch Size1616
OptimizerAdamAdam
LR SchedulerNonePlateau-based adaptive
Best-Model CheckpointingNoYes
Gradient ClippingMax norm 1.0Max norm 1.0

Results

Loss Curves — Test 1 (Baseline)

Figure 2A: Test 1 loss curves

Figure 2A: Training and Validation Loss Curves — RNN, GRU, LSTM (Test 1, seq_len=12, hidden=64, lr=0.001)

Loss Curves — Test 2 (Improved)

Figure 2B: Test 2 loss curves

Figure 2B: Training and Validation Loss Curves — RNN, GRU, LSTM (Test 2, seq_len=12, hidden=64, lr=0.001)

Predictions vs. Actual

Figure 3: Predictions vs. actual

Figure 3: Predictions vs. Actual Passengers — Validation Set (Test 2, lr=0.001)

Hyperparameter Analysis — Learning Rate

Learning RateTest 1 RMSETest 1 MAETest 2 RMSETest 2 MAE
0.000176.7167.1474.6159.87
0.00169.6457.6149.5036.46
0.005 ★46.8339.0833.1727.67
0.0161.2551.4037.1528.83

lr=0.005 + adaptive scheduler achieves the best RMSE of 33.17. The scheduler amplifies the benefit of a correct learning rate while providing robustness against suboptimal choices.

Hyperparameter Analysis — Hidden Size

Hidden UnitsParametersTest 1 RMSETest 1 MAETest 2 RMSETest 2 MAE
161,23366.1148.5846.9237.72
324,51361.5344.8137.6331.71
64 ★17,21769.6457.6133.1727.67
12867,20144.7238.6337.6232.11

In Test 2, RMSE improves steadily from 16 to 64 hidden units, then worsens at 128 due to overfitting on just 105 training sequences. 64 units provides the right capacity for this small dataset.

Conclusion

  • In Test 1 (baseline), the LSTM performed worst (RMSE=69.64) despite its architectural advantage — a fixed learning rate fails to navigate its complex loss landscape.
  • In Test 2 (adaptive scheduler + extended training + checkpointing), the LSTM recovered to RMSE=33.17 — the best result overall and a 52% improvement over its own baseline.
  • Architecture alone does not determine performance; a more powerful model requires a training regime capable of exploiting its capacity.
  • Optimal configuration: LSTM, lr=0.005, 64 hidden units, 300 epochs, plateau-based LR scheduler.