NuTime: Numerically Multi-Scaled Embedding for Large- Scale Time-Series Pretraining

Chenguo Lin, Xumeng Wen, Wei Cao, Congrui Huang, Jiang Bian, Stephen Lin, Zhirong Wu

Abstract

Recent research on time-series self-supervised models shows great promise in learning semantic representations. However, it has been limited to small-scale datasets, e.g., thousands of temporal sequences. In this work, we make key technical contributions that are tailored to the numerical properties of time-series data and allow the model to scale to large datasets, e.g., millions of temporal sequences. We adopt the Transformer architecture by first partitioning the input into non-overlapping windows. Each window is then characterized by its normalized shape and two scalar values denoting the mean and standard deviation within each window. To embed scalar values that may possess arbitrary numerical amplitudes to high-dimensional vectors, we propose a numerically multi-scaled embedding module enumerating all possible numerical scales for the scalars. The model undergoes pretraining with a simple contrastive objective on a large-scale dataset over a million sequences collected by merging existing public data. Our method exhibits remarkable improvement against previous pretraining approaches and establishes the new state of the art, even compared with domain-specific non-learning-based methods.

Introduction: The "Amplitude Problem"

Time-series data is notoriously difficult to generalize across domains. Unlike RGB images with fixed pixel ranges or natural language with discrete vocabularies, time-series values are continuous and vary wildly in magnitude. A single dataset might contain brainwaves measured in micro-volts alongside altitude data measured in thousands of meters.

Standard normalization techniques like Z-score or instance normalization often fall short because they either assume a single dominant scale or strip away critical "amplitude" information (mean and variance) necessary for distinguishing data classes. This "numerical scale" dilemma has historically forced researchers to train small, domain-specific models rather than large-scale, foundation-style models.

The "Amplitude Problem": Time-series data across different domains (a) and within a single sequence (b) exhibit vast differences in numerical scale, making standard normalization difficult.

Methodology

NuTime addresses these challenges by treating time-series sequences as a collection of patches or windows, similar to Vision Transformers (ViT). The core innovation lies in the Numerically Multi-Scaled Embedding (NME) module.

Window Decomposition and Embedding

Each non-overlapping window is decomposed into three components:

  1. Normalized Shape: The relative pattern within the window.
  2. Mean ($\mu$): The average value of the window.
  3. Standard Deviation ($\sigma$): The volatility within the window.

Since $\mu$ and $\sigma$ can have arbitrary values, a standard linear layer would saturate. The NME module uses a bank of parallel linear layers with varying "bias multipliers" ($k$). These act as sensors for different numerical scales (e.g., $10^{-4}$ to $10^4$). The outputs are then aggregated using a weighted fusion mechanism that favors the scale closest to the input value.

The NuTime architecture decomposes windows into shape, mean, and standard deviation, using a Numerically Multi-Scaled Embedding (NME) module to handle arbitrary amplitudes.

Large-Scale Pretraining

The model utilizes a standard Transformer encoder and is pretrained using the Bootstrap Your Own Latent (BYOL) objective. To achieve scale, the authors merged several major public sources, including the UCR Time Series Archive and the UEA Benchmark, resulting in a dataset of approximately 1.89 million univariate sequences (roughly 60 million tokens).

Key Results and Insights

NuTime represents a significant milestone: it is the first deep learning model to consistently outperform heavily engineered, non-learning-based ensemble methods like HIVE-COTE 2.0 (HC2) across the UCR archive.

  • Classification Performance: NuTime achieved a mean accuracy of 86.9% across 125 UCR datasets, significantly outperforming previous self-supervised leaders like TS2Vec (83.0%).
  • Few-Shot and Unsupervised Learning: In 5-shot scenarios, NuTime reached 67.5% accuracy. It also showed superior performance in unsupervised clustering (Silhouette Score of 0.7945) and anomaly detection.
  • Cross-Domain Transfer: Pretraining on massive univariate data provides representations that transfer exceptionally well to multivariate tasks, suggesting the model learns fundamental "temporal primitives."

Conclusion and Future Work

By solving the amplitude problem through NME, NuTime enables the scaling of time-series models to millions of sequences. While the model is an excellent encoder, it currently lacks a decoding mechanism for generative or forecasting tasks. Future research may explore iterative decoding procedures, similar to diffusion models, to map these multi-scaled representations back into raw numerical space.

Summary updated

BibTeX
@article{lin2024nutime,
  author = {Chenguo Lin and Xumeng Wen and Wei Cao and Congrui Huang and Jiang Bian and Stephen Lin and Zhirong Wu},
  title = {{NuTime: Numerically Multi-Scaled Embedding for Large- Scale Time-Series Pretraining}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=TwiSBZ0p9u},
}
Figure