Learning Neural Network Subspaces

Mitchell Wortsman, Maxwell Horton, Carlos Guestrin, Ali Farhadi, Mohammad Rastegari

In the world of deep learning, we usually think of training as a quest to find a single "golden" set of weights—a lone point in a massive, high-dimensional landscape that minimizes our loss function. But what if, instead of finding a single point, we could find an entire region of high-performing models in one go?

In their paper "Learning Neural Network Subspaces," Mitchell Wortsman and colleagues propose a way to do exactly that. By rethinking the optimization process, they show how to learn lines, curves, and even multi-dimensional simplexes of high-accuracy models in a single training run.

The Core Idea: From Points to Subspaces

Traditionally, if you want the benefits of an ensemble (better accuracy and uncertainty estimates), you have to train several models independently from different random initializations. This is computationally expensive. Researchers previously discovered that independently trained models are often connected by "paths" of high accuracy in the weight landscape, but finding these paths usually requires first training two separate models and then finding a bridge between them.

The authors asked: Can we parameterize and learn these high-accuracy regions directly from scratch in a single training run?

Conceptual comparison of standard training versus learning a line subspace.

Instead of training a single neural network, this method learns an entire subspace (like a line or a triangle) of high-accuracy models. The core idea is to stop treating the weights $\theta$ as a fixed vector and start treating them as a function of a subspace.

How It Works

  1. Direct Parameterization: For a line, they define the weights as $P(\alpha) = (1-\alpha)\omega_1 + \alpha\omega_2$, where $\omega_1$ and $\omega_2$ are the endpoints. For a simplex (a higher-dimensional triangle), they use a convex combination of $m$ endpoints.
  2. Stochastic Training: During each training step, they don't just update one model. They randomly sample a point $\alpha$ from the subspace, calculate the loss for the model at that point, and backpropagate the gradients to update the endpoints ($\omega_i$).
  3. Regularization for Diversity: To ensure the endpoints don't just collapse into the same point, they introduce a regularization term that encourages the endpoints to be orthogonal (using a squared cosine similarity penalty). This mimics the natural diversity found in independently trained models.

The "Midpoint" Magic and Key Results

The authors evaluated their method on standard image classification benchmarks (CIFAR-10, Tiny-ImageNet, ImageNet) across various architectures like ResNet20, ResNet18, and ResNet50.

One of the most striking findings is that the model at the midpoint of the learned line (or the center of the simplex) consistently outperforms standard training.

Accuracy of models along the learned subspace parameter alpha.

Why does this happen? Standard training often lands on the "periphery" of a minimum. The subspace training forces the model to find a "wide" minimum. The center of this wide region is less "sharp," which is a known indicator of better generalization.

Furthermore, this approach offers functional diversity in a single run. Models at opposite ends of the learned line make different types of mistakes. This means you can ensemble them (average their outputs) to get a boost in accuracy and better calibration, similar to a traditional ensemble but without the massive training cost multiplier.

The paper highlights a dual benefit:

  • Ensembling in Weight Space: Moving to the midpoint provides a better single model with zero extra cost at inference.
  • Ensembling in Output Space: Averaging the predictions of the endpoints yields even better performance, albeit with higher inference cost.

Beyond raw accuracy, the midpoint of a learned simplex showed significantly better robustness to label noise and produced better-calibrated confidence scores.

Limitations and Future Work

While the computational cost (FLOPs) is similar to training one model, you do need to store $m$ sets of weights (the endpoints) in memory during training. For massive models, this could be a bottleneck. Additionally, the strength of the diversity regularization needs careful tuning to balance diversity and convergence.

In summary, this work shifts our perspective from finding a single "best" model to discovering "best" regions. It’s a clever way to get the benefits of ensembles and flatter minima with minimal extra baggage.

Summary updated

BibTeX
@inproceedings{wortsman2021learning,
  author = {Mitchell Wortsman and Maxwell Horton and Carlos Guestrin and Ali Farhadi and Mohammad Rastegari},
  title = {{Learning Neural Network Subspaces}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=JJycuOv3Bw},
}
Figure