MAGANet: Achieving Combinatorial Generalization by Modeling a Group Action

Geonho Hwang, Jaewoong Choi, Hyunsoo Cho, Myungjoo KangICML 2023

The Challenge of Combinatorial Generalization

A hallmark of human intelligence is the ability to combine known concepts in novel ways—like imagining a "bearded woman" even if you've only ever seen bearded men and clean-shaven women. In machine learning, this is known as combinatorial generalization.

For years, researchers believed that "disentangled representations" (where one latent variable controls one attribute, like color or shape) were the key to this ability. However, recent studies have shown a surprising lack of correlation between disentanglement scores and actual generalization performance. Standard models like Variational Autoencoders (VAEs) often overfit the training distribution. When asked to generate data from "unseen" attribute combinations, they frequently fail, producing blurry, unrecognizable outputs.

MAGANet: Modeling Change, Not State

To overcome these limitations, the authors propose MAGANet (Modeling A Group Action Network). MAGANet shifts the focus of generative modeling from representing individual data points to modeling the mathematical transformations (group actions) between them.

Comparison of standard VAE and MAGANet architectures

Instead of the standard approach of mapping a single image $x$ to a latent code $z$, MAGANet learns the transformation between a pair of images through the following mechanisms:

  1. Transformation Encoding: The encoder takes a pair of images $(x_1, x_2)$ and outputs a latent variable $z$ that represents the "difference" or transformation required to turn $x_1$ into $x_2$.
  2. Group Action Simulation: The model treats the latent space as a mathematical group. The decoder $D(z, x_1)$ is designed to simulate a group action, applying the transformation $z$ to the input image $x_1$ to produce the target image $x_2$.
  3. Invertible Architecture: To ensure the model respects the properties of group theory (like identity and transitivity), the authors use an invertible neural network based on the Glow architecture. This places a hard constraint on the network to be equivariant to group actions.
  4. Latent Reconstruction Loss: Beyond standard reconstruction loss, a "latent reconstruction loss" ($\mathcal{L}_{recon\_latent}$) forces the model to ensure that if it transforms $x$ to $x'$ using $z$, the encoder can recover that exact same $z$ from the pair $(x, x')$.

Rigorous Evaluation Protocols

The model was evaluated on two standard benchmarks for representation learning: dSprites (2D shapes with varying scale, rotation, and position) and 3D Shapes (objects with varying floor/wall/object colors, shape, scale, and orientation).

Crucially, the researchers used two highly difficult evaluation protocols to test true combinatorial generalization:

  • Recombination-to-Element: The model is trained on all data except one specific combination of all attributes.
  • Recombination-to-Range: A much harder task where the model is never shown an entire range of combinations during training (e.g., it never sees a square in the right half of the screen).
Illustration of the Recombination-to-Range evaluation setting

Key Results and Insights

By enforcing group axioms (Identity, Inverse, Associativity) through its architecture and loss functions, MAGANet is mathematically discouraged from overfitting to specific training examples. This approach yielded significant improvements:

  • Quantitative Superiority: On the dSprites Recombination-to-Range task, MAGANet achieved a Binary Cross Entropy (BCE) reconstruction error of 49.74, drastically outperforming the best VAE-based model, which lagged at 100.60.
  • Qualitative Clarity: When generating unseen combinations, VAEs typically produced blurry "blobs" that lost shape and orientation. In contrast, MAGANet generated sharp, accurate images that perfectly captured the intended novel attributes.
  • Encoder Validity: The authors proved the latent variables truly represent transformations. The cosine similarity between latent vectors representing the same transformation (starting from different images) was 0.921, compared to nearly zero for different transformations.

Limitations and Future Work

The primary limitation of this study is its reliance on toy datasets (dSprites and 3D Shapes). While standard for testing disentanglement, they lack the complexity of real-world natural images. Future work will focus on scaling this group-action approach to higher-dimensional datasets and exploring how these learned transformations can benefit downstream tasks like reinforcement learning or robotic manipulation, where understanding "how things change" is essential.

Summary updated

BibTeX
@inproceedings{hwang2023maganet,
  author = {Geonho Hwang and Jaewoong Choi and Hyunsoo Cho and Myungjoo Kang},
  title = {{MAGANet: Achieving Combinatorial Generalization by Modeling a Group Action}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=0GyMsLGpsj},
}
Figure