Learning in temporally structured environments

Matt Jones, Tyler R. Scott, Mengye Ren, Gamaleldin Fathy Elsayed, Katherine Hermann, David Mayo, Michael Curtis MozerICLR 2023

Introduction

Most machine learning models are built on the "i.i.d. assumption"—the idea that data points are independent and identically distributed. However, the real world is rarely i.i.d. Natural environments exhibit temporal structure where changes happen at multiple speeds simultaneously: some things change by the second, others by the decade. This is often characterized as $1/f$ noise (or power-law noise), where correlations persist over very long durations.

Standard Stochastic Gradient Descent (SGD) struggles in these environments. If the learning rate is high, the model adapts quickly but suffers from "catastrophic interference" (forgetting old knowledge). If the learning rate is low, it preserves old knowledge but fails to adapt to sudden shifts.

To bridge this gap, this paper introduces a computationally efficient, Bayesian-inspired "multiscale" optimizer. By decomposing neural network weights into sums of subweights that learn and decay at different timescales, the system mimics biological memory—enabling rapid adaptation to new data while preserving long-term knowledge.

The Multiscale Learning Framework

The researchers propose replacing a single weight $w$ with a sum of subweights $\omega_i$. Each subweight is assigned its own learning rate and decay rate. This means the model does not have to choose between "fast" and "slow" learning; it does both simultaneously. The fast subweights catch the latest trends, while the slow subweights act as a permanent store of long-term statistics.

Multiscale weight adaptation over time. The model tracks a target (black) that undergoes a sudden, brief shift, demonstrating how different subweights capture both rapid changes and long-term stability.

The paper grounds this approach through three main methodological pillars:

  1. Equivalence Proofs: The authors mathematically prove that several existing models—including the complex "Benna-Fusi" synapse from neuroscience and standard momentum learning—are equivalent to specific versions of this multiscale optimizer. Notably, they show that momentum can be viewed as a "fast weight" with a negative learning rate, designed to cancel out short-term oscillations.
  2. Bayesian Grounding: They model $1/f$ noise as a superposition of independent diffusion processes (Ornstein-Uhlenbeck processes). They then use a Kalman Filter (KF) to perform optimal Bayesian inference on this signal.
  3. The Variational EKF Optimizer: To make this practical for deep learning, they derive a variational approximation of the Extended Kalman Filter (EKF). This version constrains the covariance matrix to be diagonal, resulting in an optimizer that requires only linear memory (proportional to the number of weights) and acts as a drop-in replacement for SGD or Adam.

Experimental Validation

The authors evaluated their methods on three increasingly difficult non-stationary tasks:

  • Synthetic Regression: A linear regression task where the "true" weights fluctuate over time according to $1/f$ noise.
  • Linear Classification: A 10-way classification task where class probabilities and feature means shift over time.
  • Non-stationary MNIST: A stream of MNIST digits where the frequency of different classes changes according to $1/f$ dynamics, testing the optimizer's ability to handle high-dimensional image data in a shifting environment.

Key Results

  • Superior Adaptation: In the regression task, the exact Bayesian solution explained 54% more variance than the best batch learner and 25.7% more than optimized SGD.
  • MNIST Performance: On the non-stationary MNIST task, the variational EKF outperformed SGD by 2.4%. Even in a standard i.i.d. environment, it outperformed SGD by 1.4%, suggesting that tracking uncertainty makes for more effective gradient steps.
  • Computational Speed: Surprisingly, the JAX implementation of the multiscale optimizer (using 8 timescales) was 1.6% faster in compute time per example than standard SGD, proving that multiscale learning adds negligible computational overhead.

Limitations and Future Work

While highly effective, the current variational approximation assumes a diagonal covariance matrix, treating every weight as independent. The authors suggest that a "block-diagonal" approach—tracking correlations between subweights within the same weight—might yield further improvements.

Additionally, while the model is robust, it requires choosing the range of timescales ($\tau$) as a hyperparameter. Future work could involve the model automatically "discovering" the relevant timescales of its environment. Finally, the framework could be extended to other power laws ($1/f^\beta$) by adjusting the distribution of noise variances across the different timescales.

Summary updated

BibTeX
@inproceedings{jones2023learning,
  author = {Matt Jones and Tyler R. Scott and Mengye Ren and Gamaleldin Fathy Elsayed and Katherine Hermann and David Mayo and Michael Curtis Mozer},
  title = {{Learning in temporally structured environments}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=z0_V5O9cmNw},
}
Figure