{"name":"PETSA: Parameter-Efficient Test-Time Adaptation for Time Series Forecasting","description":"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.","github":"https://github.com/BorealisAI/PETSA","url":"https://osrepos.com/repo/borealisai-petsa","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/borealisai-petsa","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/borealisai-petsa.md","json":"https://osrepos.com/repo/borealisai-petsa.json","topics":["deeplearning","test-time-adaptation","time-series","time-series-forecasting","machine-learning","python","pytorch","ai"],"keywords":["deeplearning","test-time-adaptation","time-series","time-series-forecasting","machine-learning","python","pytorch","ai"],"stars":null,"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.","content":"## Introduction\n\nPETSA (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.\n\nThis 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.\n\n## Installation\n\nTo get started with PETSA, first ensure you have a suitable Python environment. The project's dependencies can be installed using `pip`.\n\n1.  **Clone the repository:**\n    bash\ngit clone https://github.com/BorealisAI/PETSA.git\ncd PETSA\n    \n2.  **Install requirements:**\n    bash\npip install -r requirements.txt\n    \n3.  **Prepare Datasets:**\n    Download the datasets from the [Time-Series-Library](https://github.com/thuml/Time-Series-Library){target=\"_blank\"}. Place the downloaded datasets in `data/{dataset}/{dataset}.csv`. For example, for ETTh1, place it in `data/ETTh1/ETTh1.csv`.\n\n## Examples\n\nThe project includes scripts to demonstrate the execution of PETSA with various models and datasets. These scripts are located in the `scripts/` directory.\n\nTo run an example, use the following command structure:\n\nbash\nbash scripts/{model}/{dataset}_{pred_len}/run_petsa.sh\n\n\n**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:\n\nbash\nbash scripts/iTransformer/ETTh1_96/run_petsa.sh 3 16 0.2 0.02\n\n\nIf pre-trained checkpoints are not available for a specific setting, you can train the model using a similar script:\n\nbash\nbash scripts/iTransformer/ETTh1_96/train.sh\n\n\n## Why Use PETSA?\n\nPETSA offers significant advantages for time series forecasting, particularly in dynamic environments:\n\n*   **Parameter Efficiency:** It drastically reduces computational and memory costs compared to full model adaptation by only updating small, dedicated modules.\n*   **Enhanced Accuracy:** Despite its efficiency, PETSA maintains or improves forecasting accuracy, especially for non-stationary data, thanks to its specialized multi-component loss function.\n*   **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.\n*   **Versatile Integration:** PETSA can be applied to various forecasting backbones, improving their adaptability without requiring extensive modifications.\n\n## Links\n\nFor more detailed information, contributions, or to explore the codebase, please refer to the following resources:\n\n*   **GitHub Repository:** [BorealisAI/PETSA](https://github.com/BorealisAI/PETSA){target=\"_blank\"}\n*   **Time-Series-Library:** [thuml/Time-Series-Library](https://github.com/thuml/Time-Series-Library){target=\"_blank\"} (Referenced for datasets and model implementations)\n*   **TAFAS Library:** [kimanki/TAFAS](https://github.com/kimanki/TAFAS){target=\"_blank\"} (Acknowledged for reference)","metrics":{"detailViews":4,"githubClicks":3},"dates":{"published":null,"modified":"2026-02-19T20:01:17.000Z"}}