Sparse self-attention guided generative adversarial networks for time-series generation

Nourhan Ahmed, Lars Schmidt-Thieme

Abstract

Generating high-fidelity synthetic time-series data remains a significant challenge due to long-term temporal dependencies and irregular sampling intervals. This paper introduces SparseGAN, a novel generative adversarial network (GAN) architecture that replaces traditional Recurrent Neural Network (RNN) and Convolutional Neural Network (CNN) layers with sparse self-attention mechanisms. By utilizing the 1.5-entmax transformation, SparseGAN effectively filters temporal noise and focuses on relevant historical events. Experimental results across five diverse datasets demonstrate that SparseGAN outperforms existing benchmarks like TimeGAN, achieving a 15% reduction in forecasting error and superior data distribution fidelity.

Introduction

The generation of realistic time-series data is critical for applications ranging from financial forecasting to sensor-based monitoring. However, standard deep learning architectures face two primary obstacles. First, the "Short Memory" problem: RNNs often suffer from vanishing gradients, limiting their ability to capture correlations over long horizons. Second, the "Regularity" assumption: most models struggle with "irregular" time series caused by sensor failures or lagging equipment.

While Transformers and standard self-attention mechanisms offer a solution for long-term memory, their reliance on the softmax function introduces "noise." Softmax forces the model to assign non-zero weights to every time step, diluting the focus on critical temporal events in long sequences. SparseGAN addresses these limitations by introducing sparsity into the attention mechanism.

Architecture and Methodology

SparseGAN consists of two primary components trained in an end-to-end fashion: a Supervision Network and a Generation Network.

The SparseGAN architecture consists of (a) a Supervision Network for latent representation learning and (b) a Generation Network utilizing sparse self-attention.

The Supervision Network

The supervision network functions as an autoencoder using Gated Recurrent Unit (GRU) cells. It learns a compressed, latent representation ($F$) of the real data ($X$). This network provides a reconstruction signal ($L_{Reconstruction}$) and a supervision signal ($L_{Supervision}$) to guide the generator. This dual-pathway approach acts as a "safety rail," ensuring the synthetic data maintains the structural integrity and underlying dynamics of the original source, thereby preventing mode collapse.

The Generation Network

The generation network comprises a Generator and a Discriminator, both of which incorporate sparse self-attention layers. The core innovation is the use of the 1.5-entmax transformation instead of standard softmax. This mathematical approach allows the model to assign weights of exactly zero to irrelevant time steps. By filtering out temporal noise, the model focuses exclusively on the most informative historical points, leading to more accurate synthetic representations.

Experimental Results

The model was evaluated on five datasets: Sine Waves, Google Stocks, Energy Appliances, and two irregular datasets (Power Consumption and Air Quality) where 60% of data points were removed to simulate sensor failure.

Forecasting Accuracy and Fidelity

In "train on synthetic, test on real" (TSTR) scenarios, SparseGAN-trained models achieved a 15% lower Mean Absolute Error (MAE) compared to TimeGAN. Visual analysis using PCA and t-SNE confirmed that SparseGAN’s synthetic distributions almost perfectly overlap with real data distributions.

Discriminative Performance

To measure data quality, a separate classifier was trained to distinguish real from synthetic data. SparseGAN achieved the lowest discriminative scores (closest to zero), indicating that its outputs are significantly harder to distinguish from real data than those of competing models.

Discussion and Conclusion

SparseGAN demonstrates that sparsity is a powerful feature for time-series generation. By forcing the model to ignore irrelevant past data, it becomes more robust to noise and better at capturing essential temporal patterns. Furthermore, SparseGAN proves highly effective in low-data regimes, serving as a robust tool for data augmentation.

Despite its advantages, the quadratic memory scaling of self-attention remains a computational challenge for extremely long sequences. Future work will explore varying levels of sparsity and optimizing the architecture for high-dimensional multivariate time series.

Summary updated

BibTeX
@article{ahmed2023sparse,
  author = {Nourhan Ahmed and Lars Schmidt-Thieme},
  title = {{Sparse self-attention guided generative adversarial networks for time-series generation}},
  journal = {Int. J. Data Sci. Anal.},
  year = {2023},
  doi = {10.1007/s41060-023-00416-6},
}
Figure