Introduction
Real-world time series data, from medical monitors to financial markets, is frequently sampled at irregular intervals. While Transformers have set new benchmarks in sequence modeling, their inherent permutation invariance necessitates the use of Positional Embeddings (PE) to understand temporal order. However, standard PEs often assume uniform time steps, creating a "blind spot" when dealing with irregular data.
In the paper "Continuous-Time Linear Positional Embedding for Irregular Time Series Forecasting," researchers Byunghyun Kim and Jae-Gil Lee introduce CTLPE. This approach utilizes a continuous linear function to represent time, offering a mathematically rigorous solution that adheres to the fundamental geometric properties of time while outperforming more complex state-of-the-art methods.
Problem Statement: The Challenge of Irregularity
Standard Transformer architectures are optimized for sequences where the temporal distance between tokens is constant. Irregularly sampled data introduces two primary challenges:
- Inconsistent Observation Patterns: Discrete positional parameters can lead to "interference" in the model's memory when different time points share similar parameters.
- Irregular Time Gaps: The context of a data point is heavily dependent on the elapsed time since the previous observation. Traditional embeddings, such as date-time features or sinusoidal functions, struggle to capture these varying distances concisely as gaps grow larger or more unpredictable.
Methodology: The Power of Linearity
CTLPE (Continuous-Time Linear Positional Embedding) departs from fixed lookup tables or complex wave functions. Instead, it defines position as a learnable linear function: $$p(x) = kx + b$$ where $x$ is the timestamp, and the slope ($k$) and bias ($b$) are parameters learned during training for each dimension of the data embedding.
The authors validated this simplicity through empirical and theoretical means. By implementing a Neural Controlled Differential Equation (NCDE)-based PE—a universal function approximator—they observed that the model naturally converged toward a linear relationship. This led to Theorem 3.1, proving that any positional embedding satisfying Monotonicity (increasing time implies increasing embedding distance) and Translation Invariance (distance depends only on the temporal gap) must be linear.
Experimental Setup
The efficacy of CTLPE was evaluated on three standard benchmarks:
- ETT (Electricity Transformer Temperature): High-resolution temperature data.
- Weather: Hourly climate data.
- ECL (Electricity Consuming Load): Consumption data from hundreds of users.
To simulate real-world conditions, data points were randomly dropped at rates of 20%, 40%, and 60%, testing the models' ability to forecast amidst significant missingness and uneven intervals.
Results and Discussion
CTLPE was integrated as a plug-and-play component into popular models like Informer and FEDformer. The results demonstrate its robustness and efficiency.
Key findings include:
- Superior Accuracy: CTLPE consistently achieved the lowest Mean Squared Error (MSE) and Mean Absolute Error (MAE) across nearly all datasets and missingness levels.
- Robustness to Gaps: Unlike sinusoidal embeddings, which degrade as missing rates increase, CTLPE remains stable even at 60% missingness.
- Computational Efficiency: The simple linear calculation ($kx+b$) is significantly faster and less memory-intensive than NCDE-based or complex learnable embeddings during inference.
- Size-Awareness: By learning the slope $k$, the embedding scales itself relative to the data features, ensuring positional information does not overwhelm the actual data values.
Conclusion
CTLPE demonstrates that complexity is not always a prerequisite for performance. By adhering to the fundamental logic of time—distance and order—a simple linear embedding can outperform sophisticated alternatives. While future work may explore integration with patch-based models like PatchTST or applications in classification and anomaly detection, CTLPE currently stands as a highly effective and efficient solution for irregular time series forecasting.
Summary updated