A theoretical framework for self-supervised contrastive learning for continuous dependent data

Alexey Zaytsev, Alexander Marusov, Alexander Yuhay, Alexey Zaytsev 0002arXiv 2025 · DOI

Abstract

Self-supervised contrastive learning has revolutionized fields like computer vision by leveraging the semantic independence assumption. However, this assumption often fails for dependent data types such as time-series, where temporal proximity implies semantic similarity. This paper presents a novel theoretical framework that replaces the binary "same vs. different" paradigm with a data continuity model. By formalizing "Hard" and "Soft" dependencies through similarity matrices inspired by classical time-series models like Moving Average (MA) and Autoregressive (AR) processes, we introduce DepTS2Vec. Our approach demonstrates significant performance improvements across diverse benchmarks, including the UCR/UEA archives and global climate forecasting tasks.

Introduction: The Independence Problem

Traditional self-supervised learning (SSL) breakthroughs, such as SimCLR and MoCo, are built upon the semantic independence assumption. This principle posits that distinct samples in a dataset belong to different classes. In practice, models learn by pulling together two augmented "views" of the same sample while pushing away all other samples as negatives.

While effective for images, this logic is fundamentally flawed for dependent data like time-series or spatio-temporal sequences. In these domains, a data point at one moment is inherently related to its immediate neighbors. Treating temporally adjacent points as "negatives" to be pushed apart ignores the underlying data structure and can degrade model performance. Although some heuristic methods have attempted to address this, they often lack a rigorous mathematical foundation.

A Theoretical Framework for Data Continuity

To address these limitations, we propose a framework that shifts from binary labels to a similarity matrix approach. Instead of a hard distinction between positive and negative pairs, we model the degree of relationship between samples based on their temporal or spatial distance.

Modeling Dependencies

We define two primary ways to model these relationships, drawing parallels to classical time-series theory:

  1. Hard Dependency (Moving Average style): This model assumes that only immediate neighbors within a specific window are "similar" (positives), while all other points are treated as negatives.
  2. Soft Dependency (Autoregressive style): This model reflects a more gradual transition, where similarity decreases exponentially as the distance between time steps increases.
Comparison of semantic independence (TS2Vec) vs. Hard (MA) and Soft (AR) dependency models.

As shown in the figure above, our framework allows for a more nuanced representation of data relationships compared to the strict diagonal of standard semantic independence.

DepTS2Vec Implementation

We integrated these dependency-aware loss functions into the TS2Vec architecture, creating DepTS2Vec. The model optimizes an estimated similarity matrix ($\hat{G}$) against a ground truth matrix ($G$). We mathematically proved that our derived analytical solution for $\hat{G}$ is the unique minimum for the proposed optimization problem, ensuring stable and interpretable representation learning. The final loss is decomposed into a spatial loss (cross-sequence) and a temporal loss (intra-sequence).

Key Insights

  • The Continuity Assumption: By formalizing the idea that "closeness in time implies semantic similarity," we bridge the gap between classical time-series analysis (e.g., ARIMA) and modern deep learning.
  • Dimensional Collapse: Our analysis confirms that time-series data requires fewer latent dimensions than images. We observed that only approximately 21% of embedding dimensions were effectively utilized, highlighting "dimensional collapse" as a key challenge for future SSL research.
  • Interpretability: Unlike previous heuristic approaches, our similarity matrices are fully interpretable, providing clear insights into how the model weights temporal relationships.

Experimental Results

DepTS2Vec was evaluated against state-of-the-art baselines like TS2Vec and SoftCL across several large-scale benchmarks:

  • Time-Series Classification: DepTS2Vec achieved an average accuracy of 84.64% on the UCR archive (+2.08% over TS2Vec) and 72.89% on the UEA archive (+4.17% over TS2Vec).
  • Drought Prediction (PDSI): In complex spatio-temporal tasks, our method outperformed standard approaches by 7% in ROC-AUC score.
  • Temperature Forecasting (WeatherBench): The model produced the lowest Root Mean Squared Error (RMSE), demonstrating superior long-term forecasting capabilities.

Limitations and Future Work

While the framework is robust for continuous data, it assumes a degree of smoothness. Future work will focus on:

  • Non-Smooth Data: Incorporating "seasonal components" (similar to SARIMA) for data with abrupt transitions or strong seasonality.
  • Concept Drift: Developing adaptive similarity matrices for streaming data where patterns evolve over time.
  • Graph Structures: Extending the theory to graph-structured data by defining similarity through path lengths or spectral distances.

Summary updated

BibTeX
@misc{zaytsev2025theoretical,
  author = {Alexey Zaytsev and Alexander Marusov and Alexander Yuhay and Alexey Zaytsev},
  title = {{A theoretical framework for self-supervised contrastive learning for continuous dependent data}},
  year = {2025},
  eprint = {2506.09785},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.09785},
}
Figure