TL;DR
C-Flat Turbo is a new optimizer designed to accelerate continual learning by drastically reducing the computational overhead required to find "flat minima." By identifying and reusing stable, direction-invariant components of first-order flatness gradients, it achieves up to a 1.25× speedup over the state-of-the-art C-Flat optimizer while maintaining or even improving accuracy.
What Problem Does This Paper Address?
In Continual Learning (CL), a neural network learns from a continuous stream of tasks. The primary challenge is catastrophic forgetting—the tendency of the model to overwrite previously learned knowledge when adapting to new data.
Recent optimization-based approaches combat this by seeking out flat minima in the loss landscape. If a model sits in a wide, flat valley of the loss function, slight shifts in its parameters (caused by learning new tasks) won't drastically degrade its performance on older tasks. The recently proposed C-Flat optimizer excels at this by jointly optimizing for zeroth-order sharpness and first-order flatness. However, C-Flat is incredibly slow: it requires three additional backward passes per iteration to compute these geometric properties, creating a massive computational bottleneck for practical applications.
Methods
The authors introduce C-Flat Turbo, an optimized variant that cuts down these redundant computations through three core mechanisms:
- Taking Shortcuts Toward Flatness: The authors mathematically decompose the first-order flatness gradient and discover a "direction-invariant" component ($g_{vf}$) that is orthogonal to the proxy model's gradient. Crucially, they observe that this component changes very slowly across training iterations. Instead of recomputing it at every step, C-Flat Turbo caches this direction and reuses it for $k-1$ surrogate steps, taking a computational "shortcut."
- Stage-wise Turbo Step Scheduling: The authors notice that gradient dynamics stabilize not just within a single task, but across sequential tasks. They introduce a linear scheduler that progressively increases the shortcut interval ($k_t$) for later tasks, allowing the optimizer to become "lazier" and faster as training goes on.
- Adaptive Triggering: Flatness regularization isn't always needed. C-Flat Turbo tracks the variance of the gradient landscape using an Exponential Moving Average (EMA). It only triggers the expensive flatness computations when the landscape exhibits high volatility, falling back to standard empirical risk minimization otherwise.
Datasets
The method was thoroughly evaluated across a variety of standard continual learning benchmarks and challenging out-of-distribution datasets:
- CIFAR100 (Standard image classification benchmark)
- CUB200 (Fine-grained visual categorization)
- ImageNet-R (Evaluates robustness to domain shifts like art, cartoons, and sketches)
- ObjectNet (Evaluates robustness to variations in object viewpoint, background, and rotation)
Experiments were conducted both by fine-tuning pre-trained vision transformers (ViT-B/16) and by training convolutional architectures (ResNet-18/34) from scratch.
Key Insights and Ideas
- Flatness is More Stable Than Sharpness: While prior work (like LookSAM) successfully cached zeroth-order sharpness, this paper shows that the first-order flatness gradient ($g_{vf}$) varies even more slowly over iterations (as illustrated in Figure 3b). This makes flatness an even better candidate for gradient caching.
- Cross-Task Stabilization: As a model successfully navigates a continual learning pipeline, the learned parameter space naturally becomes more stable across subsequent tasks. This macro-level trend allows the authors to safely scale up the optimization shortcuts as the task index increases without risking catastrophic forgetting.
Key Results
- Substantial Speedups: C-Flat Turbo processes data at roughly 2× the throughput (Img/s) of standard C-Flat, translating to an overall training speedup of 1.0× to 1.25× across various baseline CL methods (such as iCaRL, MEMO, L2P, and EASE).
- Improved Accuracy: Reusing cached gradients acts as a soft regularizer. Instead of degrading performance, C-Flat Turbo frequently outperforms standard C-Flat. For example, when training the MEMO framework from scratch on ResNet-18, C-Flat Turbo improved final task accuracy by 3.05% over the baseline.
Limitations and Future Work
While C-Flat Turbo significantly narrows the efficiency gap, it remains computationally more expensive than vanilla optimizers like standard SGD or Adam due to the baseline overhead of occasionally calculating the flatness component. The authors note that integrating cheaper finite-difference schemes or lower-rank approximations could yield further speedups. Additionally, the current evaluation is restricted to computer vision classification tasks; exploring how this flatness optimization transfers to large vision-language models (VLMs) or reinforcement learning agents remains an open direction.
Summary updated