Abstract
Continual learning in Vision Transformers (ViTs) has recently been dominated by prompt-tuning methods, which introduce additional learnable tokens to mitigate catastrophic forgetting. However, these methods often incur significant parameter and computational overhead. This paper introduces Continual LayerNorm Tuning (C-LN), a simple yet effective alternative that tunes only the scale and bias parameters of LayerNorm layers. Our approach achieves state-of-the-art performance on benchmarks like ImageNet-R while using up to 90% fewer parameters and doubling inference speed compared to existing prompt-based methods.
Introduction
In Class-Incremental Learning (IL), models must learn new categories sequentially without forgetting previous knowledge. While rehearsal-based methods (storing old data) are effective, they are often restricted by privacy or hardware constraints. Recent research has pivoted towards using frozen Vision Transformers (ViTs) with learnable "prompts"—task-specific input tokens. While successful, prompt-tuning faces a steep trade-off: high accuracy requires many prompts, increasing parameter count and inference latency.
We propose Continual LayerNorm Tuning (C-LN), demonstrating that internal normalization parameters ($\gamma$ and $\beta$) provide a powerful mechanism for steering frozen ViTs toward new tasks without the overhead of external prompts.
Methodology: Continual LayerNorm Tuning
C-LN keeps the ViT backbone frozen and learns a unique set of LayerNorm parameters for each task. At inference time, the model must identify the correct task parameters to use.
Task Selection Mechanism
To handle the lack of task labels at inference, C-LN employs a "key" mechanism. The model learns a set of keys representing each task. Input features are compared against these keys to select the most appropriate LayerNorm parameters.
Architectural Variants
We explore two primary variants of C-LN:
- Two-Stage: The model performs an initial pass to identify the task ID globally, then uses the corresponding LayerNorm parameters for the entire network.
- Single-Stage: The task identification happens "on the fly" at every layer, allowing for a single forward pass and significantly faster inference.
Classifier Refinement
To mitigate errors in task selection, we implement a two-step training process. After training the task-specific LayerNorm parameters, we fine-tune the classifier while simulating the noisy task-selection process. This "training for failure" approach makes the final classification more robust to incorrect task identification.
Experimental Results
We evaluated C-LN on CIFAR-100 (10 tasks) and ImageNet-R (up to 20 tasks).
Performance and Efficiency
C-LN Two-Stage sets a new state-of-the-art on ImageNet-R (10 tasks) with 76.36% accuracy, surpassing CODA-Prompt (74.00%). Crucially, this performance is achieved with a fraction of the parameters.
As shown in Figure 2, C-LN Two-Stage uses only 0.39M parameters compared to 3.69M for CODA-Prompt—a 90% reduction. Furthermore, the Single-Stage variant offers a 2x speedup in inference time, making it highly suitable for real-time edge applications.
The "Neighborhood" Effect
Analysis of the learned parameters reveals that tasks learned sequentially tend to have similar LayerNorm weights. This "neighborhood" effect implies that even if the task identifier makes a slight error, the selected parameters are likely similar enough to the correct ones to maintain reasonable accuracy.
Conclusion
Continual LayerNorm Tuning (C-LN) challenges the necessity of complex prompt-tuning for continual learning in ViTs. By leveraging the inherent flexibility of normalization layers, C-LN provides a more efficient and faster alternative that achieves superior accuracy. Future work will focus on improving temporal consistency in the Single-Stage variant and exploring key-less task identification using raw normalization statistics.
Summary updated