Abstract
In many practical applications of machine learning data arrives sequentially over time in large chunks. Practitioners have then to decide how to allocate their computational budget in order to obtain the best performance at any point in time. Online learning theory for convex optimization suggests that the best strategy is to use data as soon as it arrives. However, this might not be the best strategy when using deep non-linear networks, particularly when these perform multiple passes over each chunk of data rendering the overall distribution non i.i.d.. In this paper, we formalize this learning setting in the simplest scenario in which each data chunk is drawn from the same underlying distribution, and make a first attempt at empirically answering the following questions: How long should the learner wait before training on the newly arrived chunks? What architecture should the learner adopt? Should the learner increase capacity over time as more data is observed? We probe this learning setting using convolutional neural networks trained on classic computer vision benchmarks as well as a large transformer model trained on a large-scale language modeling task.
Introduction
In real-world large-scale systems, data is rarely static. Instead, it often arrives in discrete "mega-batches"—for instance, monthly snapshots of web crawls or periodic updates to image databases. For practitioners, this creates a fundamental dilemma: should the model be updated immediately to incorporate new information, or is it better to wait and aggregate more data to ensure a stable training signal?
While classic online learning theory, rooted in convex optimization, advocates for immediate ("greedy") updates, deep learning presents a different landscape. Deep neural networks are non-linear and non-convex; training on small, sequential snapshots can lead to overfitting or entrapment in poor local optima. This paper formalizes this challenge as Anytime Learning at MAcroscale (ALMA), aiming to maximize performance at any given time within fixed computational and memory constraints.
The ALMA Paradigm
The ALMA framework situates itself between traditional online learning and batch supervised learning. As shown in the taxonomy below, while online learning typically deals with linear models and immediate updates, and batch learning waits for an infinite (or complete) dataset, ALMA focuses on non-linear models operating with medium waiting times.
The Benefit of Waiting: Avoiding the Greediness Trap
A core finding of this research is that "greediness"—updating the model as soon as a single chunk of data arrives—is often suboptimal for deep networks. By aggregating several chunks (e.g., 10 mega-batches) before training, the learner encounters a distribution that more closely resembles an i.i.d. (independent and identically distributed) sample. This leads to better optimization and lower cumulative error over time.
In experiments on CIFAR-10, a waiting time of 10 mega-batches consistently yielded the lowest Cumulative Error Rate (CER). In contrast, greedy models (waiting time = 1) failed to converge as effectively, while "tardy" models—those that wait until all data is collected—offered no predictive utility for the majority of the operational timeline.
Architecture and Scaling Strategies
The study evaluated various architectural strategies, including fixed-size models, ensembles, and growing architectures (like Growing Mixture of Experts or Firefly). Several key insights emerged:
- Simplicity and Ensembling: Fixed-size ensembles consistently provided the best trade-off between accuracy and computational cost. More complex "growing" architectures often failed to outperform a simple, large, fixed-capacity model.
- Data Efficiency of Large Models: Larger models proved to be more statistically efficient. In language modeling tasks, a high-capacity model trained on a single mega-batch could outperform a smaller base model that had seen four times as much data.
- The Role of Replay: While re-training on all historical data (replay) improves final accuracy, it does not significantly shift the fundamental trade-off curve between error and total compute. Model size and waiting time remain the primary levers for performance.
Conclusion
The ALMA framework highlights that for deep non-linear networks, the optimal strategy for sequential data is not necessarily the most immediate one. Waiting to aggregate data chunks and utilizing high-capacity, fixed-size ensembles offers a more robust path to high performance over time. Future work will need to address non-stationary environments where "concept drift" occurs, as well as more efficient methods for integrating new information without the overhead of full retraining.
Summary updated