Multi-Task Time Series Forecasting With Shared Attention

Zekai Chen, Jiaze E, Xiao Zhang, Hao Sheng, Xiuzheng Cheng

TL;DR

This paper introduces MTL-Trans, a Transformer-based framework designed to forecast multiple related time series simultaneously. By incorporating a novel "shared attention" mechanism that acts as a global memory across different tasks, the model outperforms both traditional single-task models and existing RNN-based multi-task approaches.

What Problem Does This Paper Address?

Time series forecasting—predicting future values based on historical data—is vital for everything from stock markets to IoT traffic management. However, most existing models focus on single-task learning, where a model is trained on one specific data stream. This approach often fails when data is sparse or when multiple streams (like traffic sensors in the same city) share underlying patterns that could help the model learn faster and better.

While Recurrent Neural Networks (RNNs) like LSTMs have been the go-to for these problems, they suffer from "shared information forgetting" and struggle with long-term dependencies. The authors aim to bridge the gap between Multi-Task Learning (MTL) and the Transformer architecture to capture these complex, shared relationships more effectively.

Methods

The authors propose a framework called MTL-Trans, which uses a "shared-private" attention scheme. Instead of just running parallel Transformers for each task, they augment the system with an external, public multi-head attention function.

They detail two specific architectures:

  1. General Global Shared Attention: Each task has its own private encoder layers, but they all contribute to and draw from a single shared attention layer. This shared layer captures "task-invariant" information—patterns that apply to everyone.
  2. Hybrid Local-global Shared Attention: This version is more sophisticated; it recurrently feeds the outputs of task-specific encoders back into the shared attention layer. This allows the model to record task-specific nuances while still maintaining a global memory.

The core innovation is the Shared Attention Layer, which uses the standard Query-Key-Value (QKV) mechanism but updates its parameters using data from all tasks, effectively creating a "whiteboard" where common temporal patterns are stored.

Datasets

The model was evaluated on the TRA-MI dataset:

  • Source: Telecom Italia.
  • Content: Cellular traffic volume measurements from Milan, Italy.
  • Structure: The city was partitioned into a 100x100 grid. For the study, these were merged into 10 regions, representing 10 distinct tasks.
  • Scale: Each task contains 1,000 samples logged at 10-minute intervals.

Key Insights and Ideas

  • Mutual Benefit: The "aha moment" is that related tasks (like two cell towers in the same neighborhood) can "teach" each other. If Tower A has a data gap due to a malfunction, the shared attention layer can use patterns learned from Tower B to fill in the blanks.
  • Attention as Memory: Unlike RNNs, which compress history into a hidden state, the shared attention mechanism allows the model to "soft-address" specific historical points across all tasks. This prevents the "forgetting" problem common in deep LSTMs.
  • Global vs. Hybrid: The authors found that the Global scheme works best for tasks with highly similar patterns, while the Hybrid scheme is superior when tasks are more inconsistent, as it better preserves task-specific "local" information.

Key Results

The MTL-Trans models were compared against several heavyweights, including LSTM, Seq2Seq-Attn, DeepAR, and the multi-task RNN baseline (SSP-MTL).

  • Superior Accuracy: MTL-Trans consistently outperformed all baselines across three metrics: Empirical Correlation Coefficient (CORR), Root Mean Squared Error (RMSE), and Symmetric Mean Absolute Percentage Error (sMAPE).
  • Quantitative Gains: The proposed method showed a roughly 2% improvement across all metrics compared to the best RNN-based multi-task model (SSP-MTL).
  • Efficiency: Ablation studies showed that the shared attention models converged significantly faster during training than pure parallel encoders without a sharing mechanism.

Limitations and Future Work

The authors identify a few areas for improvement:

  • Computational Complexity: The self-attention mechanism has a complexity of $O(L^2)$, where $L$ is the sequence length. This makes it expensive to scale to very long historical windows or extremely high-frequency data.
  • Task Diversity: While successful on cellular traffic, the authors suggest testing the framework on other sequence tasks like machine translation to see if the shared attention benefits hold up in non-numerical domains.
  • Efficiency Research: Future work will focus on developing more memory-efficient versions of the shared attention function to handle longer sequences without requiring massive computational power.

Summary updated

BibTeX
@inproceedings{chen2020multi,
  author = {Zekai Chen and Jiaze E and Xiao Zhang and Hao Sheng and Xiuzheng Cheng},
  title = {{Multi-Task Time Series Forecasting With Shared Attention}},
  booktitle = {Workshops @ ICDM},
  year = {2020},
  url = {https://openreview.net/forum?id=Kpt9Ilt6sX2},
}
Figure