The Lie Derivative for Measuring Learned Equivariance
Nate Gruver, Marc Finzi, Micah Goldblum, Andrew Gordon Wilson
TL;DR
This work introduces the Lie derivative-based Local Equivariance Error (LEE) to quantify how much neural networks violate continuous symmetries, enabling precise, layerwise attribution of equivariance errors across CNNs, Vision Transformers, and Mixer architectures. By decomposing the Lie derivative through network layers, the authors reveal that aliasing arising from downsampling and pointwise nonlinearities is a major source of equivariance violations, and that larger, better-trained models tend to be more equivariant, sometimes making transformers more equivariant than CNNs after training. The study spans hundreds of pretrained models and multiple transformations (translation, rotation, shear), showing that training scale and data often matter more than architectural changes for learned equivariance, and that there remains an equivariance gap on out-of-distribution data. These findings suggest that while architectural priors for equivariance can help, data-driven learning and anti-aliasing strategies may be more impactful in practice, with ongoing relevance for when exact symmetry properties are critical (e.g., molecular rotation invariance).
Abstract
Equivariance guarantees that a model's predictions capture key symmetries in data. When an image is translated or rotated, an equivariant model's representation of that image will translate or rotate accordingly. The success of convolutional neural networks has historically been tied to translation equivariance directly encoded in their architecture. The rising success of vision transformers, which have no explicit architectural bias towards equivariance, challenges this narrative and suggests that augmentations and training data might also play a significant role in their performance. In order to better understand the role of equivariance in recent vision models, we introduce the Lie derivative, a method for measuring equivariance with strong mathematical foundations and minimal hyperparameters. Using the Lie derivative, we study the equivariance properties of hundreds of pretrained models, spanning CNNs, transformers, and Mixer architectures. The scale of our analysis allows us to separate the impact of architecture from other factors like model size or training method. Surprisingly, we find that many violations of equivariance can be linked to spatial aliasing in ubiquitous network layers, such as pointwise non-linearities, and that as models get larger and more accurate they tend to display more equivariance, regardless of architecture. For example, transformers can be more equivariant than convolutional neural networks after training.
