Temporal Query Network for Efficient Multivariate Time Series Forecasting

Shengsheng Lin, Haojun Chen, Haijie Wu, Chunyun Qiu, Weiwei Lin

Abstract

Sufficiently modeling the correlations among variables (aka channels) is crucial for achieving accurate multivariate time series forecasting (MTSF). In this paper, we propose a novel technique called Temporal Query (TQ) to more effectively capture multivariate correlations, thereby improving model performance in MTSF tasks. Technically, the TQ technique employs periodically shifted learnable vectors as queries in the attention mechanism to capture global inter-variable patterns, while the keys and values are derived from the raw input data to encode local, sample-level correlations. Building upon the TQ technique, we develop a simple yet efficient model named Temporal Query Network (TQNet), which employs only a single-layer attention mechanism and a lightweight multi-layer perceptron (MLP). Extensive experiments demonstrate that TQNet learns more robust multivariate correlations, achieving state-of-the-art forecasting accuracy across 12 challenging real-world datasets. Furthermore, TQNet achieves high efficiency comparable to linear-based methods even on high-dimensional datasets, balancing performance and computational cost.

Introduction

In multivariate time series forecasting (MTSF), predicting future values across multiple interconnected variables—such as traffic sensors or power grid nodes—requires a deep understanding of how these variables correlate. However, real-world data is often non-stationary, containing disturbances like sensor noise, missing values, or extreme spikes.

Standard self-attention mechanisms often struggle because they rely purely on local time windows to determine variable relationships, making them susceptible to noise. Conversely, "Channel Independence" models avoid this noise by treating variables separately but miss out on critical cross-variable information. TQNet bridges this gap by capturing stable, global correlation patterns without losing local context, all while maintaining a computationally efficient architecture.

Methodology

The core of the proposed approach is the Temporal Query (TQ) technique, integrated into a minimalist architecture called TQNet.

The Temporal Query (TQ) Technique

In a standard Multi-Head Attention mechanism, the Queries (Q), Keys (K), and Values (V) are typically derived from the raw input data. TQNet introduces periodically shifted learnable vectors as the Queries. These learnable Queries act as a global memory of inter-variable relationships over time. By shifting these queries periodically to match the natural rhythms of the data (e.g., a 24-hour cycle), the model aligns with intrinsic periodicities. The attention mechanism then compares these stable global Queries against the noisy, local Keys derived from the current input sequence.

TQNet Architecture

As shown in the architecture diagram, TQNet is designed to be aggressively lightweight. It utilizes a single TQ-enhanced attention layer to handle multivariate correlations, followed by a shallow Multi-Layer Perceptron (MLP) for temporal dependencies. The process includes Instance Normalization (IN) to mitigate data distribution shifts.

The TQNet architecture featuring the Temporal Query-Enhanced Multi-Head Attention (TQ-MHA) and a lightweight MLP.

Key Insights and Robustness

By fusing global priors (learnable queries) with local data (raw keys/values), TQNet effectively "averages out" noise across multiple periods. This prevents the model from being distracted by single anomalous data points, leading to highly stable correlation mapping.

Comparison of global, learned, and sample correlations alongside examples of data disturbances like extreme points and missing values.
  • Periodicity as a Prior: Tying learnable parameters to the dataset's natural cycle length allows for efficient parameter reuse. Visualizations confirm that TQ vectors successfully learn intrinsic semantic groupings of similar channels.
  • Portability: The TQ module is highly portable and can be integrated into other architectures (e.g., iTransformer, PatchTST) to improve their multivariate forecasting performance.

Experimental Results

TQNet was evaluated on 12 real-world benchmark datasets, including Energy (ETT, Electricity, Solar), Transportation (Traffic, PEMS), and Weather.

  • State-of-the-Art Accuracy: TQNet achieved Top-2 performance in 22 out of 24 forecasting error metrics (MSE and MAE) across all datasets, outperforming heavyweights like TimeXer and iTransformer.
  • High-Dimensional Dominance: The model excelled on complex datasets with hundreds of variables (e.g., Traffic with 862 channels), proving its ability to untangle massive webs of correlation.
  • Efficiency: Despite using attention, TQNet's design allows for near-linear computational overhead. On the 862-channel Traffic dataset, it trains nearly as fast as simple linear models while using significantly fewer parameters than standard Transformers.

Conclusion and Future Work

TQNet demonstrates that a single, well-designed attention layer combined with a basic MLP can outperform much more complex models. However, the model's performance is currently linked to the clear definition of a periodicity hyperparameter ($W$). Future work will focus on adapting the model for datasets with irregular or multi-periodic structures and improving performance when explicit multivariate modeling may be less critical due to very long historical look-back windows.

Summary updated

BibTeX
@inproceedings{lin2025temporal,
  author = {Shengsheng Lin and Haojun Chen and Haijie Wu and Chunyun Qiu and Weiwei Lin},
  title = {{Temporal Query Network for Efficient Multivariate Time Series Forecasting}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=e24CueVty2},
}
Figure