Online Continual Learning Without the Storage Constraint

Ameya Prabhu, zhipeng cai, Puneet K. Dokania, Philip Torr, Vladlen Koltun, Ozan Sener · Submission to ICLR 2024 · Withdrawn

TL;DR

Continual learning research has long fixated on restrictive memory buffers, even though disk storage is now dirt-cheap while computation remains the real bottleneck. By removing the storage constraint and pairing a frozen, pre-trained feature extractor with an approximate $k$-nearest neighbors index, the authors introduce Adaptive Continual Memory (ACM)—a simple approach that scales to 39 million images, achieves zero "stability gap," and outperforms deep continual learning baselines by over 20% in accuracy.

What Problem Does This Paper Address?

Traditional online continual learning (OCL) evaluates how well an agent can learn from a non-stationary stream of data without suffering from catastrophic forgetting. Historically, methods assume the learner can only keep a tiny buffer of past images (e.g., a few thousand samples), driving vast research into coreset selection and replay management.

However, the authors argue that this setup mismatches modern computing economics. Storing 39 million images costs under $100 in modern cloud storage, whereas running gradient updates on a deep network costs thousands of dollars in GPU compute. In enterprise and edge deployments, compute is the real bottleneck. Furthermore, standard deep networks struggle with online single-sample updates, exhibit a temporary drop in past performance during updates (the stability gap), and quickly overwrite past representations.

Methods

Rather than continually updating deep neural network weights with gradient descent, the authors propose Adaptive Continual Memory (ACM):

  • Fixed Pretrained Representations: The image backbone (e.g., an ImageNet-pretrained ResNet50 or Vision Transformer) is frozen. A lightweight 2-layer MLP projects 2048-dimensional features down to a compact 256-dimensional space.
  • Hierarchical Navigable Small World (HNSW) Indexing: Instead of naive, linear-scan $k$NN ($O(n)$ complexity), ACM uses approximate nearest neighbors via HNSWlib. Retrieval and insertion operations scale logarithmically ($O(\log n)$), allowing sub-millisecond neighbor searches across tens of millions of samples.
  • Streamlined Pipeline: For each incoming sample:
  • Extract embedding $z_t = f(x_t; \theta)$.
  • Retrieve $k$ nearest neighbors from the index and classify via majority vote.
  • Receive ground truth label $y_t$ and insert $(z_t, y_t)$ into the HNSW memory.
  • Efficient Online Tuning: Because $k$NN has only one hyperparameter ($k$), the model dynamically selects $k$ (searching powers of two up to 512) based on past simulated performance at minimal runtime cost.

ACM possesses several distinct mathematical properties: fast adaptation (it can learn from a single sample), consistency (it will never forget or misclassify an identical historical point), and zero stability gap (no gradient descent oscillations).

Datasets

The authors benchmark on two large-scale, real-world continual learning setups ordered chronologically by image upload timestamps:

  1. Continual YFCC-100M / CLOC: A massive geolocalization dataset with ~39 million images spanning 712 classes.
  2. Continual Google Landmarks V2 (CGLM): A new benchmark introduced in this paper, derived from Google Landmarks v2. It consists of ~580K images across 10,788 fine-grained classes with severe long-tail distribution shifts and strict timestamp ordering.

Key Insights and Ideas

  • The Storage Constraint Was a Red Herring: When baselines (like Experience Replay) are given unrestricted access to all historical data, they still fail and catastrophically forget because fixed compute budgets prevent sufficient replay optimization.
  • Consistency Beats Re-training: Storing feature embeddings and querying them directly ensures that historical data is never forgotten. ACM preserves early knowledge over 39 million stream updates, while deep models drop to near-zero retention.
  • The Curse of Dimensionality Matters for kNN: Raw 2048-d features from ResNet50 perform surprisingly poorly with nearest neighbors. Projecting embeddings down to 256 dimensions using a small MLP trained on the initial pre-training set improves $k$NN classification by over 30%.
  • Near-Zero Compute Overhead: Querying and inserting into an index of 40 million embeddings takes only ~5 ms on a standard 16-core CPU—less than half the time of a single forward pass of ResNet50.

Key Results

  • Rapid Adaptation (Online Accuracy): ACM outperforms traditional deep OCL methods (ER, MIR, ACE, LwF, RWalk) by 35% on CGLM and 5% on CLOC, even though baselines had unrestricted replay storage.
  • Information Retention (Backward Transfer): ACM outperforms deep OCL baselines by 20% on both datasets. On CLOC, competing methods completely collapse on earlier tasks, while ACM maintains high accuracy.
  • Comparison to Fixed-Backbone Baselines: Against streaming classifiers like Streaming LDA, Online SVM, and Adaptive Random Forests, ACM maintains a 10% advantage on CGLM and a 20% advantage on CLOC (where alternatives collapse to near random guessing).
  • Speed & Feasibility: At 30 FPS, processing a video stream with 256-d embeddings on an Intel i7 CPU would take ~900 GB and ~$20 of storage per year, remaining viable for over 70 years without degradation.

Limitations and Future Work

  • Dependency on Pretrained Representations: ACM relies on existing, frozen feature representations. If the upstream pretraining fails to capture relevant domain features, ACM cannot learn new representations from scratch.
  • Privacy: While raw images are discarded, storing millions of high-dimensional feature vectors still carries potential privacy risks (e.g., feature inversion). Integrating differentially private encoders remains open work.
  • Non-Representation Learning: ACM sidesteps representation learning rather than solving continual representation updates in neural networks. Future work could investigate hybrid architectures that update feature extractors at slow, decoupled intervals.

Summary updated

BibTeX
@misc{prabhu2023online,
  author = {Ameya Prabhu and zhipeng cai and Puneet K. Dokania and Philip Torr and Vladlen Koltun and Ozan Sener},
  title = {{Online Continual Learning Without the Storage Constraint}},
  year = {2023},
  eprint = {2305.09253},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.09253},
}
Figure