A Set-Sequence Model for Time Series

—

A Set-Sequence Model for Time Series

Elliot L. Epstein
Apaar Sadhwani
Kay Giesecke
Published on 5/16/2025
Equities
Stocks
Machine learning
Deep learning
Factor investing
Risk management
Stock picking

The paper introduces the Set-Sequence model, a novel architecture for time series prediction with large cross-sections of exchangeable units. The model decouples cross-sectional and temporal modeling: at each time step, a permutation-invariant Set module aggregates unit features into a low-dimensional summary, which is then concatenated to each unit's features and fed into a Sequence module (e.g., Transformer, S4, LongConv). This design eliminates the need for hand-crafted cross-sectional features, scales linearly in the number of units, and supports variable numbers of units at inference. Theoretical results show that mean-based aggregation can approximate any continuous permutation-invariant function and that the forward pass complexity is linear in M, unlike quadratic attention-based alternatives.

The model is evaluated on three tasks: a synthetic contagion task mimicking loan defaults, equity portfolio optimization with 36,600 stocks, and mortgage risk prediction with 5 million loan-month observations. On the synthetic task, Set-Sequence reduces KL divergence by up to 10× and achieves near-optimal performance across varying pool sizes, with learned summaries correlating strongly (ρ=0.95) with the true latent factor. In portfolio optimization, it achieves a Sharpe ratio of 4.82, outperforming the best baseline (S4: 3.94) by 22% and domain-specific CNN-Transformer by 42%. For mortgage risk, it achieves an average AUC of 0.683, surpassing both general-purpose sequence models and domain-specific baselines. The results demonstrate that learning cross-sectional structure directly yields significant gains in accuracy, scalability, and interpretability across diverse applications.

Highlights

  • 1Proposes Set-Sequence model that learns cross-sectional dependencies directly from data, eliminating manual feature engineering.
  • 2Achieves linear scaling in the number of units, unlike quadratic scaling of attention-based methods.
  • 3Outperforms strong baselines on synthetic contagion, equity portfolio optimization, and mortgage risk prediction tasks.
  • 4Provides interpretable set summaries that correlate with latent factors (e.g., default rate).
  • 5Handles variable number of units at inference and unaligned time series.

Methods

  • M
    Set module: permutation-invariant aggregation (e.g., mean of embeddings) to produce cross-sectional summary at each time step.
  • M
    Sequence module: any backbone (e.g., LongConv, Transformer) processes each unit's features augmented with the set summary.
  • M
    Multi-head attention variant (MHA-Seq) for small cross-sections with strong dependencies.
  • M
    Training with variable number of units per batch to encourage generalization across pool sizes.

Results

  • R
    On synthetic contagion task, Set-Sequence reduces KL divergence by 4.4–10.2× and improves AUC by ~0.04 over per-unit baselines.
  • R
    On equity portfolio task (2002–2021), Set-Sequence achieves Sharpe ratio 4.82, 22% higher than best baseline (S4: 3.94).
  • R
    On mortgage risk prediction, Set-Sequence achieves average AUC 0.683, outperforming domain-specific 5-layer NN (0.642).
  • R
    Set summaries in synthetic task correlate with true latent factor up to ρ=0.95.
  • R
    Set-Sequence generalizes to varying number of observed units at inference, approaching oracle Kalman filter performance.
0/5

Analyze Paper

Generate insights from "A Set-Sequence Model for Time Series".

Suggested Actions