Approximately Equivariant Neural Processes

Matthew Ashman, Cristiana Diaconu, Adrian Weller, Wessel P Bruinsma, Richard E. Turner

TL;DR

While equivariant neural networks excel by exploiting perfect symmetries (like translation or rotation), real-world data is rarely "perfect." This paper introduces a general, architecture-agnostic framework to build approximately equivariant Neural Processes that can flexibly depart from strict symmetry constraints in a data-driven way, leading to better generalization on complex spatio-temporal tasks.

What Problem Does This Paper Address?

In deep learning, equivariance is a superpower. If a model is translation-equivariant (like a standard CNN), it knows that a cat is still a cat whether it’s in the top-left or bottom-right of an image. This "inductive bias" makes models much more sample-efficient.

However, the real world is full of "almost-symmetries." Consider global weather: while atmospheric physics is generally the same everywhere (suggesting translation equivariance), local features like a massive mountain range or a coastline break that symmetry. A model forced to be strictly equivariant will ignore these local nuances, while a model with no equivariance (like a standard MLP) will struggle to learn the general physics from limited data.

The authors identify a gap: existing methods for "relaxing" these constraints are often tied to specific architectures (like CNNs) or require complex modifications to loss functions. They set out to find a universal way to make any equivariant model "approximately" equivariant.

Methods

The researchers propose a surprisingly simple but mathematically grounded approach: inserting additional fixed inputs into the decoder.

  1. The Theory: They prove that any non-equivariant mapping can be approximated by an equivariant mapping if you provide it with the right set of "fixed" additional inputs. Essentially, if you tell a translation-invariant model where it is in space, it can learn to behave differently at different locations.
  2. The Implementation: For a Neural Process (NP), they take an existing equivariant architecture (like a ConvCNP or a Translation Equivariant Transformer) and add "basis functions" or "fixed inputs" to the decoder.
  3. In a CNN-based model, these are extra channels representing spatial coordinates or Fourier features.
  4. In a Transformer-based model, these act similarly to positional embeddings but are used specifically to break the permutation or translation symmetry.
  5. The "Zeroing Out" Trick: To ensure the model doesn't overfit to local features and fail when moving to new regions (Out-of-Distribution), they occasionally set these additional inputs to zero during training. This forces the model to maintain a strong "base" equivariant component that works everywhere.

Datasets

The authors evaluated their approach across three distinct domains:

  • Synthetic 1-D Regression: Using a Gibbs kernel, where the "lengthscale" (smoothness) of the data changes abruptly at a specific point ($x=0$), breaking translation symmetry.
1-D regression on the Gibbs kernel task. The bottom row shows approximately equivariant models successfully adapting to the abrupt change in smoothness at x=0.
  • 2-D Smoke Plumes: A physics-based simulation of smoke in a box with a fixed obstacle and specific inflow points. The boundaries and obstacles break the natural symmetries of fluid dynamics.
  • Environmental Data (ERA5): Real-world surface air temperature data from 2018–2019. They tested on two regions: Europe (training domain) and the Central US (testing domain). This dataset includes complex topography (mountains, oceans) that breaks simple spatial symmetries.

Key Insights and Ideas

  • Architecture Agnostic: Unlike previous "relaxed" convolution methods, this approach works on CNNs, Transformers, and GNNs alike. You don't have to reinvent the model; you just change the input.
  • The Power of a Few Degrees of Freedom: The experiments showed that you don't need many "symmetry-breaking" inputs. In the 1D task, just one or two basis functions were enough to capture the change-point, after which performance plateaued.
  • Implicit Feature Learning: In the weather experiments, the model wasn't given elevation data. However, the approximately equivariant model was able to "infer" the effect of mountains through its non-equivariant component, effectively learning a proxy for topography to improve its temperature predictions.
  • Better OOD Generalization: By zeroing out the fixed inputs for data outside the training range, the model reverts to its strictly equivariant "physics-based" mode. This allowed the approximately equivariant models to outperform even strictly equivariant ones on the US weather data, despite never seeing that region during training.

Key Results

Log-likelihood results for 1-D GP and 2-D Smoke tasks, demonstrating the superior performance of approximately equivariant models (denoted with tildes).
  • 1-D Gibbs Task: The approximately equivariant Transformer (TNP-$\tilde{T}$) achieved an ID log-likelihood of -0.406, matching the non-equivariant model but vastly outperforming it on OOD data (-0.424 vs -1.373).
  • Smoke Plumes: The approximately equivariant PT-TNP reached a log-likelihood of 4.715, significantly higher than the strictly equivariant version (4.181).
  • Weather Data: On the 2-D spatial regression task for Europe, the approximately equivariant EquivCNP achieved 1.36, outperforming the strictly equivariant version (1.27). Crucially, it also performed better on the unseen US region (0.69 vs 0.64), suggesting that the "approximate" flexibility actually helps regularize the core equivariant part of the model.

Limitations and Future Work

  • Quantifying "Approximate": The authors acknowledge that more work is needed to rigorously control and quantify exactly how much a model departs from symmetry.
  • Scale: The experiments were conducted on relatively small-scale datasets. Testing these principles on global-scale climate models or massive video datasets remains a future challenge.
  • Basis Function Selection: While Fourier features worked well here, the optimal choice of "fixed inputs" for different types of broken symmetries (like warped rotations) isn't yet fully explored.

Paper Citation: Ashman, M., Diaconu, C., Weller, A., Bruinsma, W., & Turner, R. E. (2024). Approximately Equivariant Neural Processes. 38th Conference on Neural Information Processing Systems (NeurIPS 2024).

Summary updated

BibTeX
@inproceedings{ashman2024approximately,
  author = {Matthew Ashman and Cristiana Diaconu and Adrian Weller and Wessel P Bruinsma and Richard E. Turner},
  title = {{Approximately Equivariant Neural Processes}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=dqT9MC5NQl},
}
Figure