A Temporal Kernel Approach for Deep Learning with Continuous-time Information

Da Xu, Chuanwei Ruan, Evren Körpeoglu, Sushant Kumar, Kannan AchanICLR 2021

In the world of deep learning, we are highly adept at processing sequences—think text or audio. However, standard models like RNNs and Transformers generally assume that data arrives in neat, equally spaced intervals. In reality, the world is messy: a patient’s medical checkups are irregular, and a user’s shopping clicks happen in random bursts.

The common "fix" is to discretize time into bins, but as this research demonstrates, that approach is fundamentally flawed. Here is how a team proposed a more principled way to handle the continuous "flow" of time in neural networks.

TL;DR

The authors introduce a Temporal Kernel approach that allows standard deep learning architectures (RNNs, CNNs, Attention) to natively handle continuous-time and irregularly sampled data. By representing time through learned spectral densities and random features, they achieve superior performance on time-series and recommendation tasks without the information loss caused by discretization.

What Problem Does This Paper Address?

Most deep learning models are inherently "time-blind." They treat a sequence of events as a simple ordered list. When researchers do want to include time, they usually discretize it (e.g., "binning" events into hourly slots).

The authors prove that even for simple systems, discretization changes the Spectral Density Function (SDF)—essentially the "DNA" of the signal's frequencies. This creates an "inconsistency gap" that grows even wider when data is sampled irregularly. While "Neural ODEs" exist to solve this, they often require complex, custom implementations. This paper seeks a "plug-and-play" solution that works seamlessly with the neural networks we already use.

Methods: The Temporal Kernel and RF-INN

The core idea is to represent the continuous-time system as a composition of a neural network and a temporal kernel.

Conceptual visualization of the Temporal Kernel mapping continuous-time features.
  1. The Temporal Kernel ($K_T$): Instead of assuming a fixed time-decay (like an exponential decay), the model learns a kernel that describes how information propagates forward in time.
  2. Random Fourier Features (RFF): To make this computationally efficient, they use Bochner’s Theorem. This allows them to approximate the kernel using a set of random features, essentially transforming time into a high-dimensional "frequency" space.
  3. Spectral Density Estimation via INN: The most novel part is how they learn these frequencies. They use an Invertible Neural Network (INN) to estimate the spectral density. This allows the model to learn complex, non-stationary temporal patterns directly from the data using the "reparameterization trick"—the same math that powers Variational Autoencoders (VAEs).
  4. Compatibility: Because this approach results in a feature vector ($\phi(t)$), it can be simply concatenated or multiplied with hidden states in any standard RNN, CNN, or Attention block.
Architecture of the RF-INN module integrating continuous-time features with a standard GRU cell.

Datasets and Key Results

The authors evaluated their approach on four diverse datasets:

  • Jena Weather Dataset: 14 features recorded every 10 minutes.
  • Wikipedia Traffic: Daily visit counts for 550 pages.
  • Alibaba Online Shopping: User-item interaction sequences.
  • Walmart.com E-commerce Data: Session-based shopping data from frequent users.

They tested three scenarios: regularly sampled data, irregularly sampled history, and predicting a random future point. The proposed T-NN (Temporal Neural Network) approach consistently outperformed baselines like simple time concatenation ("NN+time") and sine/cosine feature engineering ("NN+trigo").

  • Accuracy: On the Wikipedia traffic task, the T-RNN significantly reduced Mean Absolute Error (MAE) compared to a standard RNN.
  • Recommendation: On the Walmart dataset, the T-GRU-Rec model achieved a DCG (Discounted Cumulative Gain) of 8.44, nearly tripling the performance of a standard GRU-Rec (3.44).
  • Efficiency: Despite the added mathematical complexity, the training and inference speeds are nearly identical to simple time-concatenation methods, making it highly practical for production environments.

Key Insights

  • Discretization is a Trap: The paper mathematically demonstrates that binning temporal data isn't just a simplification—it's a distortion of the underlying process's spectral structure.
  • Kernels as a Bridge: By using a kernel approach, the authors bridge the gap between classical signal processing (which relies on differential equations) and modern deep learning (which relies on gradient-based optimization).
  • Preserving Properties: Representing the temporal kernel via random features preserves the Gaussian Process and Neural Tangent Kernel (NTK) properties of the original neural network. This means our theoretical understanding of why deep learning works still applies.
  • Non-Stationarity Matters: Most previous kernel methods assume the "rhythm" of time is constant (stationary). This paper provides theoretical guarantees even when the temporal kernel is non-stationary and the density is misspecified.

Limitations and Future Work

While the theory relies on the "infinite-width" limit of neural networks (Gaussian Process behavior), the experiments use regular, finite-width networks. There is still a theoretical gap in understanding how these results translate to very small models. Furthermore, the authors acknowledge that their kernel approach is an "indirect" way to model continuous-time systems compared to Neural ODEs. While more compatible with standard DL, it might not capture certain physical constraints as strictly as a pure ODE solver.

Future directions suggested by the authors include extending this to spatial-temporal modeling (adding "where" to the "when") and applying it to outlier and burst detection in streaming data.

Summary updated

BibTeX
@inproceedings{xu2021temporal,
  author = {Da Xu and Chuanwei Ruan and Evren Körpeoglu and Sushant Kumar and Kannan Achan},
  title = {{A Temporal Kernel Approach for Deep Learning with Continuous-time Information}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure