TL;DR
Training ensembles of deep neural networks is notoriously expensive, often requiring multiple independent training runs. This paper introduces an improved "snapshot ensembling" technique that collects multiple models from a single training path and combines them using a weighted stacking approach based on training-time likelihoods, achieving near-state-of-the-art accuracy at a fraction of the computational cost.
What Problem Does This Paper Address?
Ensembling—combining the predictions of multiple models—is a gold standard for boosting accuracy and estimating uncertainty. However, training $N$ deep learning models typically costs $N$ times as much as training one.
"Snapshot ensembling" was proposed to solve this by using a cyclical learning rate to visit multiple local minima in a single training run, saving a "snapshot" of the model at each minimum. While efficient, the standard approach simply averages these snapshots. The authors argue this is suboptimal because snapshots vary in quality and diversity; treating a mediocre early-stage model the same as a refined late-stage model leaves performance on the table.
Methods
The authors propose a more sophisticated way to select and combine these snapshots, which they call training-time stacking:
- Cyclical Learning Rate: They use a scheduler that oscillates between high and low learning rates, allowing the model to "jump" out of one local minimum and find another.
- Windowed Selection: Instead of just grabbing the model at the exact point of the lowest learning rate, they look at a small "window" of iterations around that point and pick the one with the best validation loss. Figure 1: Choosing the best model from a window near the learning rate minimum
- Likelihood-Based Weighting: Rather than simple averaging, they assign a weight ($w_k$) to each model based on its likelihood (how well it fits the data).
- Temperature Scaling: They introduce a temperature parameter ($\tau$) to calibrate these weights. A high temperature makes weights more uniform (like simple averaging), while a low temperature puts more weight on the best-performing models.
Crucially, they demonstrate that weights calculated using training data likelihood perform nearly as well as those using a separate validation set, making the process highly efficient.
Datasets
The researchers evaluated their approach using three standard image classification benchmarks:
- CIFAR-10
- CIFAR-100
- Fashion MNIST
All experiments were conducted using the ResNet18 architecture.
Key Insights and Ideas
- Not All Snapshots are Equal: The "aha moment" is that simple averaging is a blunt instrument. By weighting models based on their likelihood, you can filter out "noisy" snapshots that haven't fully converged.
- Training Data is a Sufficient Signal: Traditional stacking requires a hold-out validation set to determine weights. This paper shows that the internal training likelihood is a strong enough signal to rank model quality within a single training path.
- Diversity vs. Quality: The authors found that including models from the "middle" of a learning cycle (where the learning rate is higher) can actually improve the ensemble by providing more diversity, provided they are weighted correctly to account for their lower individual quality.
Key Results
The proposed stacking method consistently outperformed both single models and standard snapshot ensembles on the CIFAR-10 dataset:
- Single Model: 89.49% accuracy.
- Vanilla Snapshot Ensemble (Averaged): 89.9% accuracy.
- Proposed Stacked Snapshot Ensemble: Achieved up to 90.8% accuracy.
As shown in the table below, their method narrows the gap significantly between cheap snapshot ensembles and the "gold standard" of training five completely independent models (which reached 91.9% but cost 5x more to train).
The researchers also found that a temperature ($\tau$) around 1.0 was generally optimal for balancing the contributions of different snapshots. Figure 2: Heatmap showing how accuracy varies with the number of models and temperature
Limitations and Future Work
- Architecture Scope: The study focused primarily on ResNet18 and image classification. It remains to be seen how well this stacking approach generalizes to other architectures like Transformers or different domains like Natural Language Processing.
- Hyperparameter Tuning: The "window size" for selecting models and the temperature parameter $\tau$ add new hyperparameters that may require tuning for different datasets.
- Inference Overhead: While training is efficient, the final ensemble still consists of many models (up to 24 in some tests), which increases the memory footprint and computational cost during inference compared to a single model. Future work could explore "distilling" these stacked ensembles back into a single efficient model.
Summary updated