Tri-Level Navigator: LLM-Empowered Tri-Level Learning for Time Series OOD Generalization

Chengtao Jian, Kai Yang, Yang Jiao

Introduction

The Tri-Level Navigator (TTSO) is a novel framework designed to help time series models handle "Out-of-Distribution" (OOD) data—situations where the test data significantly diverges from the training data. By combining a nested tri-level optimization strategy with the pattern-recognition capabilities of pre-trained Large Language Models (LLMs), TTSO achieves up to a 4.9% performance boost over state-of-the-art baselines on real-world sensor datasets.

The Challenge of Time Series OOD Generalization

In real-world applications, data is messy and constantly shifting. A model trained to recognize human activity using data from one demographic might fail when deployed on a new group due to differences in body types, habits, or sensor placements. This vulnerability is known as the Out-of-Distribution (OOD) generalization problem.

While OOD generalization is heavily studied in computer vision and natural language processing, time series data presents unique hurdles due to complex temporal dependencies and dynamic shifts over time. Most existing methods focus on either sample-level uncertainty (noise or variations in individual data points) or group-level uncertainty (shifts between entire domains or environments). The authors argue that ignoring the interplay between these two types of uncertainty fundamentally limits a model's robustness.

Comparison of sample-level, group-level, and combined uncertainties in OOD generalization.

The TTSO Framework

To address these challenges, the researchers introduce TTSO (Tri-level learning for Time Series OOD). The framework formulates the learning process as a nested "tri-level" optimization problem:

  1. Lower Level (Model Learning): Minimizes the standard loss to find the optimal model parameters.
  2. Middle Level (Group Re-grouping): Dynamically re-groups data to identify "worst-case" distributions, forcing the model to remain robust across different environments (addressing group-level uncertainty).
  3. Upper Level (Data Augmentation): Maximizes alignment loss under the most challenging data perturbations to handle sample-level noise.

Solving this complex nested problem using traditional "hypergradient" methods incurs massive computational costs. To overcome this, the authors developed the Stratified Localization Algorithm (SLA). Utilizing cutting planes—a technique from classical optimization—SLA iteratively narrows down the search space for the best parameters.

Furthermore, TTSO leverages GPT-2 as its backbone. Instead of training from scratch, the LLM is fine-tuned using a dual-stage process: an initial "alignment" stage using contrastive loss to adapt the LLM to time series patterns, followed by a downstream classification stage.

Datasets and Evaluation

The researchers evaluated TTSO on six diverse, real-world time series datasets, primarily focusing on human activity recognition and health monitoring:

  • HHAR: Activity data from smartphones.
  • PAMAP: Physical activity monitoring using wearable sensors.
  • WESAD: Stress and affect detection (ECG, EMG, etc.).
  • SWELL: Stress responses in office environments.
  • USC-HAD: Detailed motion and orientation data.
  • DSADS: 19 different daily and sports activities.

Key Insights and Results

The TTSO framework consistently outperformed a wide array of baselines, including standard Empirical Risk Minimization (ERM) and specialized OOD methods like GroupDRO and IRM.

  • Performance Gains: On the HHAR, PAMAP, and WESAD datasets, TTSO improved classification accuracy by 2.8%, 4.8%, and 4.9%, respectively, over the next best baseline.
  • LLMs as "Pattern Machines": The paper reinforces the growing consensus that LLMs are not restricted to text. Their self-attention mechanisms excel at capturing complex patterns in any sequential data, provided they are fine-tuned correctly. Ablation studies showed that while the tri-level framework improves any model, it works best when paired with a pre-trained LLM. Using GPT-2 provided a significant "intrinsic capacity" for generalization that randomly initialized models lacked.
  • Theoretical Soundness: By addressing sample-level and group-level uncertainties together, the authors provide a tighter theoretical bound on "target error" than single-level methods. Furthermore, they proved that the SLA algorithm converges to an $\epsilon$-stationary point with a complexity of $O(1/\epsilon^2)$, providing a solid mathematical foundation for their empirical results.

Limitations and Future Work

While highly effective, the current TTSO framework is primarily designed and tested for time series classification. Extending this approach to other critical tasks, such as forecasting future values and anomaly detection, is a necessary next step. Additionally, while validated on sensor data, the authors suggest the tri-level approach could be adapted to other domains like computer vision or natural language processing to further demonstrate its versatility.

Summary updated

BibTeX
@inproceedings{jian2024tri,
  author = {Chengtao Jian and Kai Yang and Yang Jiao},
  title = {{Tri-Level Navigator: LLM-Empowered Tri-Level Learning for Time Series OOD Generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=a6HzEu4Kpo},
}
Figure