Authors: Patryk Krukowski, Jan Miksa, Piotr Helm, Jacek Tabor, Paweł Wawrzyński, Przemysław Spurek
GMUM — Jagiellonian University
This repository provides the core implementation of InTAct. However, we also offer an integration of InTAct into existing prompt-based continual learning methods, such as L2P, DualPrompt, and CODA-Prompt, available here.
InTAct tackles a core challenge in continual learning: representation drift. Even with strong prompt-based methods, shared network parameters often shift under domain changes, causing the model to forget previously learned knowledge. InTAct preserves the functional behavior of shared layers by capturing activation ranges from past tasks and constraining updates to stay consistent within these regions, without freezing parameters or storing old data.
InTAct is architecture-agnostic and integrates seamlessly into existing continual learning frameworks. By stabilizing important representations while allowing flexible adaptation elsewhere, it strikes an effective balance between stability and plasticity. Across domain-incremental benchmarks like DomainNet and ImageNet-R, InTAct consistently reduces representation drift and boosts performance, improving Average Accuracy by up to 8 percantage points over state-of-the-art baselines.
InTAct enables continual learning by selectively stabilizing the network's functional behavior in regions that matter, activation hypercubes (
Instead of freezing parameters or relying on data replay, InTAct summarizes the activation distribution of past tasks into hypercubes. These hypercubes capture the central
During training, we treat these hypercubes as critical functional manifolds. We use interval arithmetic (IA) to enforce that the network's output remains stable whenever an input falls within these protected regions.
InTAct employs a composite loss function to balance stability, plasticity, and representational efficiency:
| Component | Name | Purpose |
|---|---|---|
| Internal Representation Drift |
The Core Engine. Uses IA to enforce that |
|
| Activation Compactness | Minimizes the variance of activations for the current task. This forces new knowledge into tighter clusters, preventing "hypercube explosion" and preserving network capacity for future tasks. | |
| Inter-Task Alignment | Encourages the centers of new task hypercubes ( |
|
| Feature Distillation |
Stabilizes Early Layers. Since early layers (processing raw data) lack input hypercubes, |
-
Clone the repository
git clone https://github.com/pkrukowski1/InTAct cd InTAct -
Create and activate the conda environment
conda create -n "intact" python=3.9 conda activate intact -
Install remaining Python packages
pip install -r requirements.txt
-
Configure environment variables
cp example.env .env # Edit `.env` to configure WANDB, dataset paths, etc.
To launch a default experiment with Hydra:
WANDB_MODE=offline HYDRA_FULL_ERROR=1 python src/main.py --config-name=configUse WANDB_MODE=online to enable live logging to Weights & Biases
Predefined scripts for grid search, Bayesian search, and other experiment setups are available in the scripts folder. You can launch these predefined experiments for specific datasets and continual learning scenarios, for example:
./scripts/dil/cifar10/intact/intact.sh- Project structure adapted from Bartłomiej Sobieski’s template.
- This repository is a part of our continual learning package.
This project is licensed under the MIT License. See LICENSE for more information.
Questions, suggestions or issues?
Open an issue or contact the authors directly via GMUM.
