NeurIPS25-P-M

April 6, 2026 ยท View on GitHub

[NeurIPS 2025] Official Implementation for Train with Perturbation, Infer after Merging: A Two-Stage Framework for Continual Learning

Authors

Haomiao Qiu1,2, Miao Zhang1*, Ziyue Qiao2*, Liqiang Nie1

1 Harbin Institute of Technology (Shenzhen)
2 Great Bay University
* Corresponding author


Updates

  • [05/2025] Initial release

Introduction

We propose P&M, a continual learning framework that mitigates forgetting via optimal post-training model merging and task-vector perturbations, achieving sota performance. This repository provides the official implementation, train and evaluation scripts.


Installation

1. Clone the repository

git clone https://github.com/iLearn-Lab/NeurIPS-P-M_CL.git
cd NeurIPS25-P-M_CL

2. Create environment

python -m venv .venv
source .venv/bin/activate   # Linux / Mac
# .venv\Scripts\activate    # Windows

3. Install dependencies

pip install -r requirements.txt

4. Dataset preparation

Download the datasets and uncompress them:

Rearrange the directory structure:

Directory structure for three datasets:

DATA_ROOT
    |- train
    |    |- class_folder_1
    |    |    |- image_file_1
    |    |    |- image_file_2
    |    |- class_folder_2
    |         |- image_file_2
    |         |- image_file_3
    |- val
         |- class_folder_1
         |    |- image_file_5
         |    |- image_file_6
         |- class_folder_2
              |- image_file_7
              |- image_file_8

We provide the scripts split_[dataset].py in the tools folder to rearange the directory structure. Please change the root_dir in each script to the path of the uncompressed dataset.


Usage

For three datasets: bash reproduce.sh


Citation

@article{qiu2025train,
  title={Train with Perturbation, Infer after Merging: A Two-Stage Framework for Continual Learning},
  author={Qiu, Haomiao and Zhang, Miao and Qiao, Ziyue and Nie, Liqiang},
  journal={arXiv preprint arXiv:2505.22389},
  year={2025}
}

Acknowledgement


License

This project is released under the Apache License 2.0.