Abstract
Recurrent Neural Networks (RNNs), particularly Long Short-Term Memory (LSTM) networks, have long been the standard for hydrological modeling. However, the rise of foundation models in other domains has prompted a shift toward Attention-based architectures. This study introduces a unified deep learning framework to benchmark 11 Transformer-based models against traditional LSTMs across diverse hydrologic tasks. While LSTMs remain superior for standard regression, Transformers demonstrate significant advantages in complex scenarios like long-term autoregressive forecasting and zero-shot prediction in data-scarce regions. This work provides a critical reference for the evolution of water resource modeling in the era of large-scale models.
Introduction
Hydrologic prediction is fundamental to water resource management but faces significant challenges, including non-stationary data and the "Prediction in Ungauged Basins" (PUB) problem. While LSTMs have dominated the field due to their temporal memory, the success of Attention mechanisms in natural language processing (e.g., ChatGPT) suggests a potential paradigm shift. This paper systematically evaluates whether Transformers can outperform LSTMs in hydrology, addressing fragmented previous research with a comprehensive, multi-dataset benchmarking framework.
Methodology and Framework
The researchers developed an automated, "plug-and-play" framework for multi-model benchmarking. They compared 11 attention-based architectures—including Vanilla Transformer, Informer, iTransformer, PatchTST, and TimesNet—against LSTM and DLinear baselines. The evaluation spanned four distinct task scenarios:
- Regression: Simulating target variables within a known window.
- Data Integration: Time-lagged prediction using meteorological and historical inputs.
- Autoregression: Forecasting future values based solely on historical trends.
- Zero-Shot Forecasting: Utilizing pre-trained Large Language Models (LLMs) and Time Series Attention Models (TSAMs) without prior hydrologic training.
The study utilized five major datasets: CAMELS (US runoff), Global Streamflow (3,434 basins), Global Soil Moisture (ISMN), Snow Water Equivalent (SNOTEL), and Dissolved Oxygen (CAMELS-Chem).
Results and Discussion
The benchmarking revealed a "complexity threshold" for model performance. LSTMs proved superior for memory-dependent regression tasks, likely because hydrologic signals are often "low-semantic" and noisy, making the simpler gating of LSTMs less prone to overfitting than complex attention layers. For example, in the CAMELS runoff task, LSTM achieved a Kling-Gupta Efficiency (KGE) of 0.80, compared to 0.73 for the best Transformer (Crossformer).
However, Transformers excelled as task complexity increased. In long-term autoregressive forecasting (60-day horizon), LSTM performance collapsed (KGE -0.19), while models like TimesNet and Reformer remained robust. This is attributed to the Attention mechanism's ability to focus on specific historical time steps rather than processing sequences linearly.
A significant finding was the potential of zero-shot forecasting. In tests on seven US basins, TimeGPT (KGE 0.68) and Llama 3B (KGE 0.54) outperformed a supervised LSTM (KGE 0.50) at a 7-day horizon, indicating that models trained on massive general datasets can transfer temporal logic to hydrologic systems.
Sustainability remains a concern; training a Crossformer model emitted approximately 13 times more CO2 than an LSTM, highlighting the environmental cost of increased architectural complexity.
Conclusion
While LSTMs remain the gold standard for simple regression, Attention-based models are the new frontier for long-term and zero-shot hydrologic forecasting. Future work should focus on improving peak flow (flood) prediction, refining prompt engineering for LLMs, and integrating physical constraints into these flexible architectures to ensure reliable performance during extreme events.
Reference: Liu, J., Shen, C., et al. (2025). From RNNs to Transformers: benchmarking deep learning architectures for hydrologic prediction. EGUsphere [Preprint].
Summary updated