Learning Representations that Support Extrapolation

Taylor W. Webb, Zachary Dulberg, Steven Frankland, Alexander A. Petrov, Randall C. O'Reilly, Jonathan Cohen

While neural networks excel at interpolating within their training data, they often fail to extrapolate to values outside that range. Standard deep learning operates on the assumption that training and test data are drawn from the same distribution. Consequently, models are excellent at making sense of data points that fall within the boundaries of their training set, but notoriously struggle with reasoning about values or scales they have never seen before (e.g., a model trained on small squares failing to recognize a very large square).

Human intelligence, by contrast, is defined by the ability to extrapolate through analogical reasoning. We understand the relationship between objects regardless of their absolute size or position. This paper seeks to bridge this gap by introducing Temporal Context Normalization (TCN), a simple yet powerful inductive bias that encourages neural networks to learn abstract, relational representations reflecting the underlying symmetries of a task.

The Temporal Context Normalization (TCN) Method

TCN is mathematically similar to standard Batch Normalization, but with a crucial difference in its application. Instead of normalizing across a batch of different samples, TCN normalizes across the temporal dimension (or sequence length) of a single task-relevant window.

By calculating the mean and variance over a sequence—such as the four images in an $A:B :: C:D$ analogy problem—TCN effectively "zeros out" the absolute magnitude of features like brightness or size. This forces the model to focus on how those features change relative to one another, discarding absolute magnitude in favor of local context.

In practice, for an analogy model, TCN is applied to the vector embeddings of the images before they are passed to a reasoning module (like an LSTM). For prediction tasks, the model uses an autoencoder where TCN is applied to the bottleneck, and the transformation is inverted at the decoder to reconstruct the image.

Datasets and Extrapolation Challenges

The authors evaluate TCN across three distinct domains designed to test extrapolation:

  1. Visual Analogy Extrapolation Challenge (VAEC): A newly introduced benchmark where models must solve visual analogies. It features two distinct extrapolation regimes:
  2. Translation: Moving through a feature space (e.g., training on dim objects, testing on bright ones).
  3. Scale: Multiplying feature values (e.g., testing on objects 6x larger than those in training).
  4. Visual Analogy Dataset (Hill et al., 2019): A complex dataset inspired by Raven’s Progressive Matrices, involving distracting variations and cross-domain analogies.
  5. Dynamic Object Prediction: A task requiring the model to predict the next frame of a smoothly changing square, specifically testing extrapolation to larger sizes.
Visual Analogy Extrapolation Challenge (VAEC) regimes for Translation and Scale.

Key Results and Insights

TCN consistently outperformed competitive baselines—including Batch Norm, Layer Norm, and Dropout—in every extrapolation task.

  • VAEC Translation: In the most difficult test region (Region 6), TCN achieved 61.6% accuracy. By comparison, Batch Normalization plummeted to 30.8%, and models without normalization hit near-chance levels at 16.7%.
  • VAEC Scale: TCN maintained 48.7% accuracy at the largest scale, whereas all other methods dropped to ~20% or lower.
  • Complex Analogies: On the Hill et al. dataset, TCN reduced the test error by 32% compared to previous state-of-the-art baselines.
  • Dynamic Prediction: TCN achieved a Mean Squared Error (MSE) of 0.0056, nearly 10x lower than Batch Normalization (0.0507) when predicting objects much larger than those seen during training.
Accuracy across increasingly distant test regions on the VAEC Translation task.

The success of TCN highlights the importance of symmetry and alignment. Taking inspiration from theoretical physics, the authors argue that extrapolation is possible when a model exploits symmetries. TCN acts as an inductive bias that forces the network to be invariant to absolute scale and translation. However, this works best when the normalization window is perfectly "aligned" with the structure of the problem. If the window is misaligned or sliding, the performance gains diminish.

Interestingly, the experiments also revealed a form of implicit regularization: "sub-batch normalization" (normalizing over very small batches) performed better than standard Batch Norm, suggesting that the noise introduced by small-sample statistics might actually help models learn to extrapolate.

Limitations and Future Work

While TCN shows immense promise, the current evaluation relies on visually simple 2D shapes on plain backgrounds. Real-world data involving 3D objects, clutter, and complex lighting remains a hurdle.

Furthermore, TCN currently requires knowing exactly where a "task window" begins and ends to ensure temporal alignment. Because real-world events aren't always clearly demarcated, future work will need to integrate TCN with event segmentation algorithms—models that can automatically detect boundaries in a stream of data—to make this powerful inductive bias generalizable to unstructured environments.

Summary updated

BibTeX
@inproceedings{webb2020learning,
  author = {Taylor W. Webb and Zachary Dulberg and Steven Frankland and Alexander A. Petrov and Randall C. O'Reilly and Jonathan Cohen},
  title = {{Learning Representations that Support Extrapolation}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=oaYgZ66SEt},
}
Figure