Skip to main content
QUICK REVIEW

[Paper Review] Self-attention with Functional Time Representation Learning

Da Xu, Chuanwei Ruan|arXiv (Cornell University)|Nov 28, 2019
Advanced Graph Neural NetworksComputer Science36 citations
TL;DR

The paper introduces functional time embeddings to integrate continuous time differences into self-attention for continuous-time event sequences, using Bochner and Mercer theoretical foundations, and shows improved prediction performance on real-world datasets.

ABSTRACT

Sequential modelling with self-attention has achieved cutting edge performances in natural language processing. With advantages in model flexibility, computation complexity and interpretability, self-attention is gradually becoming a key component in event sequence models. However, like most other sequence models, self-attention does not account for the time span between events and thus captures sequential signals rather than temporal patterns. Without relying on recurrent network structures, self-attention recognizes event orderings via positional encoding. To bridge the gap between modelling time-independent and time-dependent event sequence, we introduce a functional feature map that embeds time span into high-dimensional spaces. By constructing the associated translation-invariant time kernel function, we reveal the functional forms of the feature map under classic functional function analysis results, namely Bochner's Theorem and Mercer's Theorem. We propose several models to learn the functional time representation and the interactions with event representation. These methods are evaluated on real-world datasets under various continuous-time event sequence prediction tasks. The experiments reveal that the proposed methods compare favorably to baseline models while also capturing useful time-event interactions.

Motivation & Objective

  • Motivate the need to capture continuous temporal patterns in self-attention beyond discrete positional encodings.
  • Propose translation-invariant time kernels and functional feature maps to embed time spans into vector spaces.
  • Derive and compare Bochner-based and Mercer-based time embeddings with learnable interactions between time and event representations.
  • Empirically validate the approach on real-world datasets and demonstrate improved continuous-time event sequence prediction.

Proposed method

  • Formulate time embedding as a translation-invariant kernel K(t1,t2)=ψ(t1−t2) with feature map Φ.
  • Ground Φ via Bochner’s Theorem (random Fourier features) and Mercer’s Theorem (Fourier basis/periodic kernels) to obtain finite-dimensional embeddings.
  • Provide practical Bochner time encoding variants using reparameterization, inverse CDF transformations, or non-parametric options to learn Φ.
  • Propose Mercer time embedding as truncated Fourier basis with learnable coefficients and a set of frequencies to cover multiple bandwidths.
  • Integrate time embeddings with event embeddings in self-attention by concatenating Z (event) and Φ(t) (time), feeding into Q/K/V projections.
  • Model time-event interactions with linear or non-linear (MLP) transformations and optionally residual blocks to capture complex dependencies.

Experimental results

Research questions

  • RQ1Can continuous-time differences be effectively embedded into self-attention via principled, kernel-based time representations?
  • RQ2Which functional forms (Bochner vs. Mercer) provide robust, learnable time embeddings compatible with deep models?
  • RQ3Do time-aware embeddings improve continuous-time event sequence prediction over standard positional encoding and time-augmented baselines?

Key findings

  • Mercer and Bochner-based time embeddings consistently improve performance over baselines across real-world datasets.
  • Mercer time embedding with a Fourier basis often yields the best overall performance, with effective time-event interaction modeling.
  • Bochner time embeddings with non-parametric inverse CDF transformations also show strong results, sometimes outperforming baselines.
  • Bochner methods benefit from flexible distribution learning (e.g., Inv CDF, MAF, NVP), while Mercer offers stability via truncated Fourier expansions.
  • Time-event interactions captured by the embeddings reveal interpretable temporal patterns in attention weights (qualitative analyses).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.