One-Prompt Strikes Back: Sparse Mixture of Experts for Prompt-based Continual Learning (ICLR 2026)
March 29, 2026 ยท View on GitHub
๐ Abstract
Prompt-based methods have recently gained prominence in Continual Learning (CL) due to their strong performance and memory efficiency. However, existing methods face a dilemma: Task-specific prompts incur high computational overhead and linear memory scaling, while Shared prompts suffer from knowledge interference and degraded performance.
To reconcile this trade-off, we propose SMoPE, a novel framework that integrates the benefits of both strategies. Inspired by the relationship between Prefix Tuning and Mixture of Experts (MoE), SMoPE organizes a shared prompt into multiple "prompt experts" within a sparse MoE architecture.
Key Contributions:
- ๐ง Sparse Activation: Introduces a prompt-attention score aggregation mechanism to dynamically activate only a subset of relevant experts, effectively mitigating interference.
- โ๏ธ Adaptive Noise: A mechanism to encourage balanced expert utilization while preserving knowledge from prior tasks.
- ๐ Prototype-based Loss: Leverages prefix keys as implicit memory representations to enhance expert specialization.
Extensive experiments demonstrate that SMoPE consistently outperforms task-specific methods and competes with state-of-the-art approaches while significantly reducing parameter counts and computational costs.

๐ Table of Contents
๐ ๏ธ Requirements
We recommend using Anaconda to manage the environment.
-
Create environment:
conda create -n smope python=3.8 conda activate smope -
Install dependencies:
# Install PyTorch and core libraries pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 # Install other requirements pip install timm==0.9.12 scikit-learn==1.3.2 numpy pyaml pillow opencv-python pandas openpyxlAlternatively, you can use the provided file:
pip install -r requirements.txt
๐ Data Preparation
Please organize your project directory as follows. You will need to create data/ and pretrained/ directories.
1. Datasets (data/)
Download and extract the following datasets into the data/ folder:
2. Pre-trained Checkpoints (pretrained/)
Download the ViT backbones and place them in pretrained/:
๐ Project Structure
This is the expected folder structure after setting up the data and environment:
SMoPE/
โโโ configs/ # Configuration files for different datasets
โ โโโ cifar-100_prompt_smope.yaml
โ โโโ cub-200_prompt_smope.yaml
โ โโโ imnet-r_prompt_smope.yaml
โ โโโ ...
โโโ data/ # Dataset storage
โ โโโ cifar-100-python/
โ โโโ imagenet-r/
โ โโโ CUB_200_2011/
โโโ dataloaders/ # Data loading logic and splits
โ โโโ splits/
โ โโโ dataloader.py
โ โโโ ...
โโโ experiments/ # Shell scripts to run training
โ โโโ cifar-100.sh
โ โโโ cub-200.sh
โ โโโ imagenet-r_all.sh
โโโ figures/ # Images for README
โโโ learners/ # Training logic & prompt definitions
โ โโโ default.py
โ โโโ prompt.py
โโโ models/ # ViT Backbone
โโโ pretrained/ # Pre-trained ViT weights
โโโ utils/ # Metrics and helper functions
โโโ run.py # Entry point for single runs
โโโ trainer.py # Main training loop
โโโ requirements.txt
๐ Running Experiments
We evaluate our approach on standard CL benchmarks. The scripts are configured for 1 GPU.
The main entry point is the shell scripts located in experiments/, which utilize run.py and the configurations in configs/.
| Dataset | Command |
|---|---|
| CIFAR-100 | sh experiments/cifar-100.sh |
| ImageNet-R | sh experiments/imagenet-r_all.sh |
| CUB-200 | sh experiments/cub-200.sh |
Note: Results (logs, checkpoints, and excel sheets) will be automatically saved to a folder named
outputs/.
๐ค Acknowledgements
We thank the authors of the following repositories for their code, which aided our research:
๐ Citation
If you find our work or this codebase helpful, please consider citing:
@article{le2025one,
title={One-Prompt Strikes Back: Sparse Mixture of Experts for Prompt-based Continual Learning},
author={Le, Minh and Dao, Bao-Ngoc and Nguyen, Huy and Tran, Quyen and Nguyen, Anh and Ho, Nhat},
journal={arXiv preprint arXiv:2509.24483},
year={2025}
}
