Official implementation for the ICLR 2026 Oral paper: Plug-and-Play Compositionality for Boosting Continual Learning with Foundation Models.
Paper: https://openreview.net/forum?id=22hBwIf7OC
This project is built on top of LAMDA-PILOT.
Vision learners often struggle with catastrophic forgetting due to their reliance on class recognition by comparison, rather than understanding classes as compositions of representative concepts. This limitation is prevalent even in state-of-the-art continual learners with foundation models and worsens when current tasks contain few classes. Inspired by the recent success of concept-level understanding in mitigating forgetting, we design a universal framework CompSLOT to guide concept learning across diverse continual learners. Leveraging the progress of object-centric learning in parsing semantically meaningful slots from images, we tackle the challenge of learning slot extraction from ImageNet-pretrained vision transformers by analyzing meaningful concept properties. We further introduce a primitive selection and aggregation mechanism to harness concept-level image understanding. Additionally, we propose a method-agnostic self-supervision approach to distill sample-wise concept-based similarity information into the classifier, reducing reliance on incorrect or partial concepts for classification. Experiments show CompSLOT significantly enhances various continual learners and provides a universal concept-level module for the community.
Requirements are managed in pyproject.toml and include PyTorch 2.0.1, torchvision 0.15.2, and timm 0.6.12.
uv sync
source .venv/bin/activate- Download CFST data from https://huggingface.co/datasets/jiangmingchen/CGQA_and_COBJ.
- Unzip to
./data/CFST. - Data structure should include:
CFST/CGQA/CGQA_100/...CFST/COBJ/annotations/...
- Keep the dataset structure consistent with the project data loader in
./utils/data_manager.py.
Training is driven by JSON configs and a single entry script main.py:
python main.py --config ./exps/aper_aperpter_cgqa.jsonCompSLOT typically uses two stages:
- Train slot learner.
- Train target continual learner with slot-based regularization.
Example on CFST-CGQA:
python main.py --config ./exps/aper_aperpter_compslot_cgqa.json
# Or, you can learn slot learner and target cl algorithm separately.
# Stage 1: slot learner
python main.py --config ./exps/slot_cgqa.json
# Stage 2: target learner + CompSLOT regularization
python main.py --config ./exps/aper_aperpter_compslot_cgqa.jsonFor baselines without CompSLOT:
python main.py --config ./exps/aper_aperpter_cgqa.jsonYou can switch to CFST-COBJ by using the corresponding config files under exps.
- Slot pretraining configs follow pattern: exps/slot_cgqa.json, exps/slot_cobj.json.
- CompSLOT-enabled configs include fields such as:
use_slotslot_projectslot_argsslot_prefixuse_s_l_regs_l_reg_coeff
During training, logs and args are saved to logs with structure:
- dataset/init_cls/increment/project_name
- main.py: global entry point.
- trainer.py: training loop, task iteration, logging, and evaluation.
- models: continual learner implementations.
- models/slot_learner.py: slot learner and wrapper regularization logic.
- backbone: backbone adapters and prompt modules.
- utils: data manager, model factory, and utilities.
- exps: ready-to-run experiment configurations.
To add a new continual learner:
- Implement a learner class in models.
- Ensure the learner provides
_get_loss(...)for compatibility with the wrapper strategy in models/slot_learner.py. - Register the learner in utils/factory.py via
get_model(). - Add a new experiment JSON under exps.
If you find this repository useful, please cite the paper:
@inproceedings{liao2026plugandplay,
title={Plug-and-Play Compositionality for Boosting Continual Learning with Foundation Models},
author={Weiduo Liao and Fei Han and Hisao Ishibuchi and Qingfu Zhang and Ying Wei},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://openreview.net/forum?id=22hBwIf7OC}
}And the LAMDA-PILOT:
@article{sun2025pilot,
title={PILOT: A Pre-Trained Model-Based Continual Learning Toolbox},
author={Sun, Hai-Long and Zhou, Da-Wei and Zhan, De-Chuan and Ye, Han-Jia},
journal={SCIENCE CHINA Information Sciences},
year={2025},
volume = {68},
number = {4},
pages = {147101},
doi = {https://doi.org/10.1007/s11432-024-4276-4}
}