PETSA: Parameter-Efficient Test-Time Adaptation for Time Series Forecasting

PETSA: Parameter-Efficient Test-Time Adaptation for Time Series Forecasting

Summary

PETSA offers a parameter-efficient solution for Test-Time Adaptation (TTA) in time series forecasting, addressing the performance degradation caused by non-stationary data. It adapts pre-trained models during inference by updating small calibration modules, reducing memory and compute costs. This method, which includes low-rank adapters, dynamic gating, and a specialized loss, improves forecasting accuracy across diverse backbones and datasets.

Repository Info

Updated on February 19, 2026
View on GitHub

Introduction

PETSA (Parameter-Efficient Test-Time Adaptation for Time Series Forecasting) is an innovative method designed to enhance the performance of pre-trained forecasting models when encountering non-stationary real-world time series data. Traditional Test-Time Adaptation (TTA) methods often update the entire model, leading to high memory and computational demands. PETSA addresses this by proposing a parameter-efficient approach that adapts forecasters at test time through the update of only small calibration modules on the input and output.

This method leverages low-rank adapters and dynamic gating to adjust representations without the need for extensive retraining. To ensure high accuracy despite its limited adaptation capacity, PETSA incorporates a specialized loss function comprising a robust term, a frequency-domain term to preserve periodicity, and a patch-wise structural term for structural alignment. As a result, PETSA improves the adaptability of various forecasting backbones, requiring fewer parameters than existing baselines, and achieves competitive or superior performance across benchmark datasets. This work is slated for presentation at ICML 2025.

Installation

To get started with PETSA, first ensure you have a suitable Python environment. The project's dependencies can be installed using pip.

  1. Clone the repository:
    git clone https://github.com/BorealisAI/PETSA.git
    cd PETSA
  2. Install requirements:
    pip install -r requirements.txt
  3. Prepare Datasets: Download the datasets from the Time-Series-Library. Place the downloaded datasets in data/{dataset}/{dataset}.csv. For example, for ETTh1, place it in data/ETTh1/ETTh1.csv.

Examples

The project includes scripts to demonstrate the execution of PETSA with various models and datasets. These scripts are located in the scripts/ directory.

To run an example, use the following command structure:

bash scripts/{model}/{dataset}_{pred_len}/run_petsa.sh

Specific Example: For the iTransformer model and ETTh1 dataset with a prediction length of 96, and specific GPU, low-rank, loss alpha, and gating initialization parameters:

bash scripts/iTransformer/ETTh1_96/run_petsa.sh 3 16 0.2 0.02

If pre-trained checkpoints are not available for a specific setting, you can train the model using a similar script:

bash scripts/iTransformer/ETTh1_96/train.sh

Why Use PETSA?

PETSA offers significant advantages for time series forecasting, particularly in dynamic environments:

  • Parameter Efficiency: It drastically reduces computational and memory costs compared to full model adaptation by only updating small, dedicated modules.
  • Enhanced Accuracy: Despite its efficiency, PETSA maintains or improves forecasting accuracy, especially for non-stationary data, thanks to its specialized multi-component loss function.
  • Robustness to Non-Stationarity: The method is specifically designed to adapt models to changing data distributions at test time, making it highly effective for real-world time series.
  • Versatile Integration: PETSA can be applied to various forecasting backbones, improving their adaptability without requiring extensive modifications.

Links

For more detailed information, contributions, or to explore the codebase, please refer to the following resources: