UniTS: A Unified Multi-Task Time Series Model

Shanghua Gao, Teddy Koker, Owen Queen, Thomas Hartvigsen, Theodoros Tsiligkaridis, Marinka Zitnik

TL;DR

UniTS is a unified multi-task foundation model for time series that successfully bridges the gap between predictive tasks (like classification) and generative tasks (like forecasting and imputation). By introducing a novel task tokenization framework and a flexible transformer architecture, a single set of model weights can handle 38 datasets across diverse domains without requiring task-specific heads.

What Problem Does This Paper Address?

Traditional time series models are highly specialized and siloed. A model optimized for forecasting (like iTransformer) typically fails at classification, while top-tier classification models (like TimesNet) underperform at forecasting. This specialization exists because time series data is notoriously heterogeneous, featuring varying sequence lengths, sampling rates, and variable/channel counts.

While large language models (LLMs) have recently been repurposed for time series, they still require heavy fine-tuning or dataset-specific input/output modules. UniTS addresses the challenge of building a true multi-task, multi-domain foundation model that unifies both predictive and generative time series tasks under a single architecture with shared weights.

Figure 1: UNITS is a unified multi-task time series model for predictive and generative tasks.

Methods

The core innovation of UniTS lies in treating time series data and task specifications uniformly through tokenization, processed by a flexible backbone:

  • Task Tokenization: UniTS converts data and task specifications into a unified token stream. It uses sample tokens for multivariate data, prompt tokens to provide dataset/task context, and task tokens (GEN for generative tasks like forecasting/imputation and CLS for predictive classification).
  • Unified Architecture: Instead of standard transformers that attend only to time or variables, UniTS utilizes a two-way self-attention mechanism covering both dimensions simultaneously to handle varying channel counts.
  • DyLinear (Dynamic Linear Operator): To handle varying sequence lengths without changing network structures, the authors replace the standard feed-forward network (FFN) layer with a dynamic operator that uses bi-linear weight interpolation to resize weights dynamically.
  • Gating Module: A gating mechanism is added after each layer to minimize feature space interference between wildly different domains during joint training.
  • Unified Masked Reconstruction Pre-training: The model is pre-trained using a dual-loss objective. It forces the model to reconstruct masked sample tokens directly (via a GEN tower) and indirectly through a classification routing mechanism (via a CLS tower), embedding both capabilities into the shared backbone.
Figure 2: a) UNITS for forecasting; input is tokenized, and GEN tokens are un-patchified to infer the forecast horizon. b) UNITS for classification; a CLS token is used to represent class information and then compared to class tokens to get prediction class. c) Architecture of UNITS model.

Datasets

The authors evaluate UniTS on a massive benchmark of 38 datasets spanning domains like healthcare (ECG), human activity sensors, engineering, and finance:

  • Forecasting: ETT (Electricity Transformer Temperature) suite, ECL (Electricity Consuming Load), Traffic, Weather, and Solar-Energy.
  • Classification: 10 multivariate datasets from the UEA classification archive (e.g., Heartbeat, JapaneseVowels, SpokenArabicDigits).
  • Few-Shot/Zero-Shot Transfer: Evaluated on out-of-domain datasets like SaugeenRiverFlow, Hospital, and the SMD/MSL/SMAP anomaly detection benchmarks.

Key Insights and Ideas

  • Unified Task Space: Generative and predictive tasks can share the exact same representation space if framed via tokenization. For example, simply replicating a GEN token $f$ times allows direct multi-step forecasting for any arbitrary length.
  • Prompting Works for Time Series: Just like in NLP, a frozen time-series model can adapt to entirely new tasks or domains simply by tuning a small set of learnable prompt tokens (UniTS-PMT), avoiding expensive full-model fine-tuning.
  • Data Quantity Trumps Data Type: Cross-task pre-training ablations revealed that pre-training solely on forecasting data transfers remarkably well to classification tasks. This suggests that data scale and diversity matter more than strict task alignment during pre-training.

Key Results

  • Single-Task Superiority: When trained individually on single datasets (UniTS-ST), it outperforms 12 forecasting, 20 classification, 18 anomaly detection, and 16 imputation models, setting a new state-of-the-art.
  • Multi-Task Performance: A single UniTS-SUP model handles all 38 tasks simultaneously, outperforming iTransformer by 5.8% in forecasting MSE and TimesNet by 0.7% in classification accuracy.
  • Direct Multi-Step Forecasting: Replicating GEN tokens outperforms the standard sliding-window approach by 10.5% in MSE while delivering a 3x inference speedup.
  • Few-Shot Transfer: On unseen datasets, UniTS improves upon the strongest baseline by 12.4% in MSE for imputation and 2.3% in F1-score for anomaly detection.

Limitations and Future Work

The current dataset collection does not cover all available time series data, missing some univariate datasets from the UCR archive and complex physiological signals from PhysioNet. Additionally, while few-shot transfer is highly effective, true zero-shot generalization to completely novel domains remains a challenging frontier. The authors plan to explore alternative backbones, such as Mamba or MLP-based blocks, to further scale the model's capabilities.

Summary updated

BibTeX
@inproceedings{gao2024units,
  author = {Shanghua Gao and Teddy Koker and Owen Queen and Thomas Hartvigsen and Theodoros Tsiligkaridis and Marinka Zitnik},
  title = {{UniTS: A Unified Multi-Task Time Series Model}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=nBOdYBptWW},
}
Figure