A Set-Sequence Model for Time Series

Elliot L Epstein, Apaar Sadhwani, Kay Giesecke

TL;DR

Predicting time series usually means looking at one sequence at a time, or jamming a fixed number of sequences together into one giant model. Set-Sequence introduces a lightweight, plug-and-play wrapper that lets standard sequence models (like Transformers or Mamba) track large, dynamically changing populations of time series—like thousands of mortgages or stocks—all at once. By extracting a shared "vibe" of the whole population at every time step in linear time, it boosts accuracy across the board without requiring tedious manual feature engineering.

What Problem Does This Paper Address?

Imagine trying to predict whether a homeowner will default on their mortgage next month, or how a specific stock will move tomorrow. You have a rich history of features for that single loan or stock—a Multivariate Time Series (MTS). Standard sequence models are great at reading that single history.

Here’s the catch: loans and stocks don't exist in a vacuum. When defaults spike across a neighborhood, property values drop and default risk spreads like a contagion. You aren't just predicting one MTS; you are predicting a set of MTSs moving along a shared timeline.

If you stack 10,000 loans with 50 features each into one mega-sequence, you get 500,000 features per time step—computationally miserable, and it breaks the moment new loans are issued or old ones are paid off. Historically, practitioners worked around this by modeling each unit in isolation and tacking on hand-crafted summary statistics (like the regional foreclosure rate). That requires domain expertise and inevitably misses hidden cross-unit signals. How do we let a model learn population-wide context automatically, efficiently, and for sets whose sizes change on the fly?

Methods

The authors propose Set-Sequence, a two-part architecture that cleanly decouples cross-sectional (across units) and temporal (across time) modeling.

Figure 1: The Set-Sequence model. The Set model estimates a cross-sectional summary at each time, in linear complexity over the number of units. This augments the original features of each unit and the Sequence model consumes this augmented series to make predictions for each unit independently. Note that the Set model has a look-back of L time periods, where L ≥1 is a model parameter. The number of units M and time periods T may vary at inference.
  1. The Novel Part (Dynamic Set Module): At each time step $t$, the model grabs a short look-back chunk (e.g., $L=3$ steps) for every active unit, passes each through a small neural network, takes the mean across all units, and projects that average into a low-dimensional vector $F_t$. Because averaging doesn't care about unit order or count, this summary is permutation-invariant, handles missing/unaligned start dates, and scales linearly with the number of units $M$. (The authors also test an attention-based variant, MHA-Seq, which scales quadratically).
  2. The Standard Part (Sequence Backbone): That learned population summary $F_t$ is concatenated onto each individual unit's features. Then, any off-the-shelf sequence layer—Transformer, S4, Mamba, LongConv, etc.—processes each unit's augmented history independently with shared weights.

Using a Stone–Weierstrass mathematical argument, the authors prove that simple mean-pooling is expressive enough to approximate any continuous, order-invariant population statistic.

Datasets

Standard time-series benchmarks (like ETTh1 or Traffic) have small, fixed unit counts, making them poor stress tests for massive cross-sections. Instead, the authors evaluate on three high-dimensional setups:

  • Synthetic Contagion Benchmark (New): 1,000 simulated loans over 100 time steps (4,000 cross-sectional dimensions), where defaults feed back into a hidden contagion factor $\lambda_t$ that drives future risk.
  • U.S. Equity Portfolio Construction: Daily return data from CRSP covering 36,600 stocks, dynamically filtering to the top 500 liquid stocks per period with 79 financial features each (39,500 cross-sectional dimensions).
  • U.S. Mortgage Risk Prediction: CoreLogic data from Los Angeles comprising 5 million loan-month transitions across 117,523 mortgages (sampled in batches of 2,500 loans with 52 features each, yielding 130,000 cross-sectional dimensions).

Key Insights and Ideas

  • Every backbone gets a boost: Wrapping a sequence model with the Set module isn't tied to one specific temporal architecture. Whether the backbone uses attention, convolutions, or state-space equations, feeding it learned population context consistently improves predictions—whereas concatenating all units into one joint sequence actually degrades learning.
  • Emergent interpretability (no labels required): Even though the model is never told what macro factors exist, its low-dimensional set summaries spontaneously lock onto real-world phenomena. On the synthetic task, the learned summary correlates at 0.951 with the hidden contagion factor; on real mortgage data, the first-layer summary closely tracks the actual aggregate foreclosure rate.
  • Graceful scaling across partial views: A single trained Set-Sequence model can make accurate predictions whether it observes 1% of the population or 100% at inference time, closely hugging the theoretical upper bound of an oracle Kalman Filter.
Figure 2: Comparison between the Set-Sequence model and the oracle-like Kalman Filter baseline on the synthetic task, as a function of the fraction of observed units. We report AUC for the absorbing (rare) state (left) and the correlation between the predicted and true next-step transition probabilities (right). The Set-Sequence model approaches the Kalman Filter performance across the full range of observed pool sizes, despite being trained on a finite dataset.

Key Results

  • Synthetic Contagion: Wrapping seven distinct backbones (Mamba, Hyena, Transformer, LongConv, S4, DLinear, H3) cuts KL divergence error by 3.0x to 6.9x across the board. While quadratic MHA-Seq edges out mean-pooling in accuracy (0.815 vs. 0.802 AUC), it requires 3.35x the training time and 3.52x the memory.
Table 1: Set-Seq improves every sequence backbone. For each backbone X, we report KL(true | pred) for X alone (one unit at a time, shared parameters across units) and for Set-Seq(X) (same backbone wrapped with the Set module); the bottom row reports the multiplicative KL reduction.
  • Stock Portfolios: Over a 20-year out-of-sample test (2002–2021), adding Set-Seq raises the annualized Sharpe ratio (risk-adjusted return) of all six tested backbones by +0.42 on average (e.g., S4 jumps from 4.12 to 4.83). Between 2002 and 2016, Set-Seq(S4) hits a Sharpe ratio of 5.68, beating a specialized CNN-Transformer finance baseline by 36%, and maintains its edge even after factoring in transaction costs.
  • Mortgage Risk: Set-Seq lowers cross-entropy loss across all five tested backbones and lifts average transition AUC to 0.683, outperforming the previous domain-specific neural network benchmark (0.642) on 23 out of 26 state transitions.

Limitations and Future Work

  • Shared schema assumption: Set-Sequence assumes all units represent the same kind of entity sharing the same features (a basket of stocks, a fleet of identical sensors). It isn't built for heterogeneous grab-bags of unrelated variables (like mixing stock prices with gas-flow readings).
  • Bottleneck capacity: Because population context is squeezed into a small vector of size $r$, that dimension limits how many distinct subgroup dynamics the model can track simultaneously.
  • Ignoring known graphs: When an explicit, reliable network of unit-to-unit connections is already known, specialized architectures like Graph Neural Networks may exploit those direct links better than global pooling. Future directions were otherwise not explicitly detailed in the main text.

Summary updated

BibTeX
@inproceedings{epstein2026set,
  author = {Elliot L Epstein and Apaar Sadhwani and Kay Giesecke},
  title = {{A Set-Sequence Model for Time Series}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=y1ZoyGsVuL},
}
Figure