GenVP: Generating Visual Puzzles with Contrastive Hierarchical VAEs

Kalliopi Basioti, Pritish Sahu, Qingze Tony Liu, Zihao Xu, Hao Wang, Vladimir Pavlovic

TL;DR

GenVP (Generative Visual Puzzles) is a novel framework that masters abstract visual reasoning by learning to both solve and create complex puzzles from scratch. By combining a hierarchical Variational Autoencoder (VAE) with a robust Mixture of Experts rule predictor, GenVP achieves state-of-the-art performance across five major benchmarks and demonstrates remarkable generalization to unseen rules and attributes.

What Problem Does This Paper Address?

Abstract visual reasoning—the ability to discern patterns and rules from visual data—is a hallmark of human intelligence, often tested via Raven’s Progressive Matrices (RPMs). While AI has become proficient at "solving" these puzzles by picking the correct answer from a small list of choices, this approach is often brittle. Machines frequently rely on "shortcuts" (statistical quirks in the choice list) rather than true logical understanding.

Furthermore, existing generative models typically only "fill in the blank" for a missing panel. They lack the human-like ability to generalize a rule and synthesize an entirely new, coherent puzzle. The authors argue that true understanding requires a model to handle the entire generation process: moving from abstract rules to complete visual instances.

Methods

GenVP utilizes a Hierarchical VAE (HVAE) architecture designed to bridge the gap between low-level pixels and high-level abstract rules. Its core innovations include:

  1. Latent Variable Decoupling: The model splits image-level latent variables into two parts: $Z_o$ for rule-relevant attributes (like shape or color) and $Z_{\bar{o}}$ for irrelevant distractors (like orientation or noise).
  2. Mixture of Experts (MoE) Rule Prediction: Instead of a single rule classifier, GenVP uses an ensemble of "experts" that look at different views of the puzzle—such as the full matrix, the context matrix (missing one image), or partial rows. This prevents the model from over-relying on any single part of the puzzle and forces it to learn more robust representations.
  3. Dual-Level Contrastive Learning: The authors introduce a novel training scheme that compares puzzles globally (cross-puzzle) and locally (comparing the correct answer against incorrect candidates). This significantly boosts the model's ability to distinguish valid logical structures from "imposter" puzzles.
  4. Generative Pipeline: Unlike discriminative solvers, GenVP can be sampled in reverse. Given a set of abstract rules (e.g., "Size: Progression" and "Color: Constant"), the model generates row-level latents, then image-level latents, and finally renders a complete $3 \times 3$ grid of images.
Figure 1: Generative and Inference Graphical Models of GenVP. During inference, we are given a complete, valid puzzle X and our task is to infer all intermediate random variables Z, Zo, Z¯o, Zr and predict its rules R using our Mixture of Experts (MoE) strategy. During generation, given an abstract set of rules R, we generate a complete puzzle X following the desired rules. We note that during generation, we don’t need the MoE module, but we directly generate Zr from the given set of rules.

Datasets

The model was evaluated on five diverse and challenging datasets:

  • RAVEN, I-RAVEN, and RAVEN-FAIR: Standard benchmarks for abstract reasoning.
  • PGM (Procedurally Generated Matrices): A dataset with a much larger solution space and more complex rules.
  • VAD (Visual Analogy Dataset): Focused on analogical reasoning between rows.

The researchers also tested Out-of-Distribution (OOD) generalization by creating scenarios with unseen attribute values (e.g., new colors or sizes) and excluded rules during training.

Key Insights and Ideas

  • Creativity as Validation: The ability to generate a new puzzle from a rule serves as a "visual explanation" of what the model has learned. If the generated puzzle is coherent, it proves the model understands the underlying logic.
  • The Power of Contrast: The addition of contrastive loss was a turning point. On the RAVEN dataset, accuracy jumped from 50.5% (ELBO only) to 94.7% when contrastive terms were included.
  • Robustness through Partial Information: By training experts to predict rules from incomplete puzzles, the model becomes resilient to noise and less likely to fall for the "shortcut" features that plague simpler models.

Key Results

  • State-of-the-Art Accuracy: GenVP outperformed all previous generative models on RAVEN and I-RAVEN, reaching up to 96.1% average accuracy.
  • Handling Large Solution Spaces: In the challenging PGM and VAD datasets—where previous generative models like RAISE often failed—GenVP demonstrated efficient generalization, significantly outperforming baselines (e.g., 85.5% vs 22.4% on PGM Neutral).
  • OOD Dominance: GenVP surpassed SOTA models in 22 out of 24 examined OOD scenarios, showing a superior ability to handle "unseen" visual properties.
  • Coherent Generation: Qualitative results show the model successfully creating novel puzzles that follow complex rules across different layouts.
Figure 2: Examples of original RPM puzzles (top) vs. new puzzles generated by GenVP (middle) following the same rules (bottom).

Limitations and Future Work

Despite its success, GenVP still faces hurdles:

  • Complex Grids: Performance dips on the most complex configurations (like $3 \times 3$ grids with many small objects) where feature extraction becomes difficult.
  • Numerical Reasoning: While it handles basic arithmetic rules, deep visual comprehension of complex numerical relationships remains an ongoing challenge.
  • Image Quality: While logically sound, the generated images can sometimes struggle with high-fidelity rendering of very small shapes.

The authors suggest that improving the visual comprehension of numerical relationships is a primary direction for future research.

Summary updated

BibTeX
@inproceedings{basioti2025genvp,
  author = {Kalliopi Basioti and Pritish Sahu and Qingze Tony Liu and Zihao Xu and Hao Wang and Vladimir Pavlovic},
  title = {{GenVP: Generating Visual Puzzles with Contrastive Hierarchical VAEs}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Pd7IOswRUZ},
}
Figure