Online Continual Learning via Logit Adjusted Softmax

Zhehao Huang, Tao Li, Chenhe Yuan, Yingwen Wu, Xiaolin Huang

Introduction

In the field of Online Continual Learning (CL), models are tasked with learning from a continuous, single-pass stream of data. A primary challenge in this setting is catastrophic forgetting, where the model loses previously acquired knowledge as it adapts to new information. Researchers from Shanghai Jiao Tong University identify recency bias as a major driver of this forgetting: because new classes appear more frequently in the data stream than old ones (even with a replay buffer), models become heavily biased toward predicting the most recent classes.

To address this, the authors propose Logit Adjusted Softmax (LAS), a lightweight, "plug-and-play" modification to the loss function that mathematically separates class-specific features from their appearance frequency.

The LAS Framework

The core of LAS is the realization that while class frequencies (priors) change over time, the underlying features of a class (conditionals) remain stable. From a Bayesian perspective, the probability of a sample belonging to a class $y$ is $P(y|x) \propto P(x|y)P(y)$. Standard training often conflates these, leading the model to rely on the biased prior $P(y)$ rather than the invariant conditional $P(x|y)$.

The LAS framework (left) uses a sliding-window estimator to adjust logits, effectively balancing prediction counts across tasks (right) compared to standard fine-tuning or experience replay.

LAS modifies the Softmax loss by adding a log-adjustment term based on estimated class frequencies: $$\Phi_y(x) + \tau \cdot \log \pi_{y,t}$$ By subtracting the influence of class frequency during training, the model is forced to focus on intrinsic features. A batch-wise sliding window estimator tracks these frequencies ($\pi_{y,t}$) on the fly, allowing LAS to adapt to non-stationary distributions without needing explicit task boundaries. This approach is highly orthogonal to other CL techniques and can be easily combined with existing rehearsal-based methods like Experience Replay (ER).

Experimental Results

The authors evaluated LAS across diverse benchmarks, including CIFAR10/100, TinyImageNet, and large-scale datasets like ImageNet (90 tasks) and iNaturalist (26 tasks). LAS was integrated into standard ER frameworks and compared against state-of-the-art baselines.

Quantitative performance of ER-LAS across various benchmarks. LAS consistently achieves higher accuracy ($A_T$) and lower forgetting ($F_T$) compared to other rehearsal-based methods.

Key findings include:

  • Superior Accuracy: On CIFAR10, LAS improved baseline accuracy by 4.6%. On the complex ImageNet-90 benchmark, it reached 39.3% accuracy, outperforming the next best method (MRO) by 3.5%.
  • Reduced Forgetting: In the ImageNet-90 run, the forgetting rate dropped from 10.2% to 9.0%.
  • Efficiency: Unlike contrastive learning methods that can be significantly slower, LAS adds virtually zero computational overhead, with training times nearly identical to standard ER.

Discussion and Insights

The simplicity of LAS is its greatest strength. As a one-line change to the loss function, it addresses a fundamental statistical imbalance that plagues online learning. The paper highlights that inter-class imbalance becomes the dominant cause of forgetting in long-sequence learning (e.g., 90 tasks), making LAS particularly effective for real-world, long-term applications where data streams are inherently non-stationary.

Conclusion

Logit Adjusted Softmax provides an elegant solution to recency bias in online continual learning. While it currently relies on a replay buffer for accurate prior estimation, it establishes a robust foundation for learning class-conditional invariants. Future work aims to extend this framework to address intra-class domain drift and develop fully task-free, rehearsal-free implementations.

Summary updated

BibTeX
@article{huang2024online,
  author = {Zhehao Huang and Tao Li and Chenhe Yuan and Yingwen Wu and Xiaolin Huang},
  title = {{Online Continual Learning via Logit Adjusted Softmax}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
}
Figure