Class Balanced Replay for Non-IID Data Streams

You are reading version 1 of this direction, frozen 2026-10-04. The latest version is version 2.

Version 1 of 2126 papers178 conceptsfrozen 2026-10-04

In the ideal world of machine learning, data is "i.i.d."—independent and identically distributed. In the real world, data arrives as a messy, non-stationary stream. A self-driving car might see nothing but highway concrete for hours before encountering a rare pedestrian; a medical monitor might process thousands of "normal" heartbeats before a single arrhythmia occurs.

When deep neural networks learn from these imbalanced or temporally correlated streams, they suffer from two related failures: catastrophic forgetting (overwriting old knowledge with new data) and majority bias (collapsing the decision boundary toward the most frequent classes).

The research direction emerging across these papers is the use of Class-Balanced Replay Buffers. By explicitly managing a small memory of past experiences to ensure every category is represented equally—regardless of how often they appear in the live stream—researchers are enabling models to maintain stable, unbiased performance in dynamic environments.

The Buffer as a Distribution Simulator

The core intuition behind balanced replay is that the memory buffer acts as a "distribution simulator." While the optimizer sees a skewed or correlated input stream, the replay mechanism periodically injects a curated batch of historical samples that mimics a balanced, IID dataset.

As Arslan Chaudhry and colleagues demonstrate in Continual Learning with Tiny Episodic Memories, even a "tiny" memory of just one or two examples per class can be more effective than complex regularization techniques. By using a per-class FIFO (First-In, First-Out) management strategy, the model ensures that the "tail" classes are never fully evicted by the "head" classes.

This structural balance is critical for metrics like the Area Under the ROC Curve (AUC). In Kernelized Online Imbalanced Learning with Fixed Budgets, Junjie Hu and Haiqin Yang show that maintaining separate buffers for majority and minority classes allows an online learner to minimize pairwise losses effectively, preventing the majority class from overwhelming the decision boundary.

Partitioning and Allocation Strategies

How should a fixed memory budget be divided? Simple uniform sampling often fails when the stream is highly imbalanced because rare classes may never enter the buffer at all.

Chris Dongjoo Kim and Gunhee Kim addressed this in Imbalanced Continual Learning with Partitioning Reservoir Sampling. They introduced Partitioning Reservoir Sampling (PRS), which uses a power allocation formula to define target quotas for different classes. This allows the model to tune the balance between a perfectly uniform class representation and one that is somewhat proportional to the observed data frequency, which is vital in multi-label settings where common and rare labels co-occur in the same image.

Similarly, in the context of Human-Object Interaction (HOI) detection, Ting Lei proposed ADA-CM (Efficient Adaptive Human-Object Interaction Detection with Concept-guided Memory), which uses a balanced key-value cache to ensure that rare interactions (like "throwing a frisbee") have as much retrieval weight as common ones (like "holding a phone").

Quality Control: Confidence and Information

Simply being "balanced" isn't enough if the stored samples are noisy or redundant. Modern approaches add a layer of "quality control" to the selection process.

  1. Confidence Filtering: In Test-Time Adaptation (TTA), where a model adapts to new data during inference, there are no ground-truth labels. Taesik Gong in SoTTA and Ding-Chu Zhang in ADAPROMPT use confidence thresholds. Only samples the model is "sure" about are admitted to the buffer, and the buffer is then balanced based on the model's own predicted labels.
  2. Information Content: Instead of random sampling, Shengyang Sun and Daniele Calandriello suggest in Information-theoretic Online Memory Selection for Continual Learning that we should select samples based on their "information gain." This prioritizes rare but critical data points that provide the most "surprise" to the model's current state.

Beyond Simple Classes: Groups and Hierarchies

Recent work has extended the concept of balance beyond simple class labels to combat more subtle forms of bias.

  • Spurious Correlations: Donggyu Lee and Taesup Moon found that models often learn "shortcuts" (e.g., associating "water" with "boat"). In Continual Learning in the Presence of Spurious Correlation, they proposed Group-class Balanced Greedy Sampling (BGS), which balances the memory buffer across both the target classes and the spurious attributes, forcing the model to learn robust, causal features.
  • Hierarchical Labels: In Online Continual Learning on Hierarchical Label Expansion, Byung Hyun Lee and Se Young Chun show that memory management should be hierarchy-aware. By prioritizing samples that help distinguish fine-grained "child" classes from "parent" categories, the model can refine its knowledge over time without losing the big picture.

Why It Works: Decoupling Representation from Frequency

The success of these methods stems from a fundamental realization: learning representations is different from learning classifiers.

Standard training on a long-tailed stream causes the feature space to collapse, as the model optimizes only for the most frequent patterns. By using a class-balanced memory bank—as seen in OpenDet for object detection or ResCom for contrastive learning—researchers decouple the feature learning process from the input frequency. This ensures that the model's "latent space" remains organized and discriminative for all classes, providing a stable foundation for the final classification layer to adapt to the changing world.

Papers in this version

Showing 60 of 126 papers.

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 88 papers
  2. Version 1 · 2026-10-04 · 126 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_class_balanced_memory_management_b8c1b25c,
  title = {class-balanced memory management},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/class-balanced-memory-management/rdr_b8c1b25c9a0a4c29bea9621e9835a43c},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-21},
}

This exact version (version 1, frozen text):

@misc{lacuna_class_balanced_replay_for_non_iid_data_s_b8c1b25c_v1,
  title = {Class Balanced Replay for Non-IID Data Streams},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/class-balanced-replay-for-non-iid-data-streams/rdr_b8c1b25c9a0a4c29bea9621e9835a43c/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-21},
}