Rough Transformers: Lightweight and Continuous Time Series Modelling through Signature Patching

Fernando Moreno-Pino, Alvaro Arroyo, Harrison Waldon, Xiaowen Dong, Alvaro Cartea

TL;DR

Rough Transformers introduce "multi-view signature attention," a method that uses mathematical path signatures to compress long, irregularly sampled time series into continuous-time representations. This approach allows the model to handle long-range dependencies with up to 25x faster training and significantly lower memory usage than vanilla Transformers, all while remaining naturally robust to missing data and irregular sampling.

What Problem Does This Paper Address?

Modeling real-world sequential data—like financial tick data, ECG readings, or climate sensors—presents a "pick your poison" scenario for researchers:

  1. Transformers are the gold standard for capturing long-range dependencies, but their computational cost grows quadratically with sequence length ($O(L^2)$). Furthermore, they treat data as discrete "tokens," making them struggle with sequences sampled at irregular intervals or varying frequencies.
  2. Neural ODEs and CDEs (Ordinary/Controlled Differential Equations) are designed for continuous-time data and handle irregular sampling beautifully. However, they rely on expensive numerical solvers that become agonizingly slow as sequences get longer.

The authors identify a critical gap: we need a model that possesses the long-range reasoning of a Transformer, the continuous-time awareness of an ODE, and the computational efficiency required for high-frequency data.

Methods

The core innovation is the Rough Transformer, which replaces standard attention with multi-view signature attention.

The Secret Sauce: Path Signatures

The model leverages Rough Path Theory, specifically the "path signature." Think of a signature as a mathematical summary of a path's "shape" using a series of iterated integrals. Crucially, signatures are time-reparameterization invariant—meaning the signature of a path is the same whether you traverse it quickly, slowly, or at irregular intervals.

Signature Patching

Instead of feeding every individual data point into the attention mechanism, the authors "patch" the sequence into windows.

Multi-view signature attention extracts both local and global path signatures from time-series windows.

For each window, they calculate:

  • Local View: The signature of the data within that specific window.
  • Global View: The signature of the path from the very beginning up to that window.

By concatenating these, the model creates a "multi-view" representation. This reduces the effective sequence length from $L$ (thousands of points) to $\bar{L}$ (a few dozen windows), slashing the attention complexity from $O(L^2)$ to $O(\bar{L}^2)$.

Datasets

The authors evaluated the model across a diverse range of challenging temporal tasks:

  • Synthetic Sinusoids: Classifying frequencies in long, noisy, and "long-range" sinusoidal paths.
  • Heart Rate (HR) Dataset: Forecasting a patient’s heart rate from 3-channel ECG readings (4,000 time steps).
  • UEA Time Series Archive: Five long-context classification tasks, including Eigenworms (motion of C. elegans) and Ethanol Concentration.
  • Irregularly Sampled Benchmarks: Testing performance when 30% to 70% of data points are randomly dropped.

Key Insights and Ideas

  • Continuous-Time by Design: Because signatures represent the underlying path rather than discrete points, the model doesn't need to "interpolate" missing data explicitly. It treats the signal as a continuous object.
  • Smart Compression: Unlike simple downsampling (which loses information), signatures capture high-order interactions between variables within a window. The authors found that even a "Level 1" signature (essentially the net change) provides a better inductive bias than raw data.
  • Spatial Awareness: Signatures naturally capture how different channels (e.g., different sensors) move in relation to one another. This "spatial processing" allows the model to outperform vanilla Transformers on multivariate data without needing complex, pre-defined graph structures.
  • Preventing "Oversquashing": By coarsening the sequence through signatures, the model avoids the "oversmoothing" or "oversquashing" issues common when Transformers try to process extremely long, redundant sequences.

Key Results

The Rough Transformer (RFormer) demonstrates significant improvements in both speed and predictive performance across multiple benchmarks.

Training time scaling comparison. RFormer maintains low computational cost as input length increases, unlike standard Transformers or Neural ODEs.
  • Massive Speedups: RFormer achieved training speedups of 1.4x to 26.11x compared to vanilla Transformers. Against Neural ODE-based models, the difference was even more dramatic, often being orders of magnitude faster.
  • Superior Accuracy: On the Heart Rate forecasting task, RFormer improved upon the vanilla Transformer's error (RMSE) by 67%.
  • Extreme Robustness: In experiments where 50% of the data was dropped, RFormer maintained high accuracy (e.g., 87.7% on Eigenworms), while the vanilla Transformer often crashed due to Out-of-Memory (OOM) errors or saw its performance collapse.
  • Efficiency: RFormer can process sequences of up to 250,000 points on a single consumer GPU, a feat impossible for standard attention mechanisms.

Limitations and Future Work

  • Hyperparameter Tuning: The model's performance is sensitive to the choice of window size and the "level" of the signature truncation. Finding the "elbow" of the Dirichlet energy helps, but it still requires more setup than a standard Transformer.
  • The Curse of Dimensionality: The number of terms in a signature grows exponentially with the number of input channels ($d$) and the signature level ($n$). While the authors suggest using "univariate signatures" to mitigate this, scaling to very high-dimensional multivariate data (e.g., hundreds of sensors) remains a challenge.
  • Scale: The experiments were conducted on relatively small-scale datasets compared to modern LLMs. Future work could explore whether these "Rough" principles can be applied to massive-scale foundation models for time series.

Summary updated

BibTeX
@inproceedings{morenopino2024rough,
  author = {Fernando Moreno-Pino and Alvaro Arroyo and Harrison Waldon and Xiaowen Dong and Alvaro Cartea},
  title = {{Rough Transformers: Lightweight and Continuous Time Series Modelling through Signature Patching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=gXWmhzeVmh},
}
Figure