Inverted-Attention Transformers can Learn Object Representations: Insights from Slot Attention

Yi-Fu Wu, Klaus Greff, Gamaleldin Fathy Elsayed, Michael Curtis Mozer, Thomas Kipf, Sjoerd van SteenkisteUniReps @ NeurIPS 2023

TL;DR

This paper reveals that a simple modification to the standard Transformer architecture – inverting its attention mechanism – can achieve performance comparable to specialized Slot Attention models for object-centric learning. This finding simplifies the pursuit of object discovery and suggests that Transformers can be more readily adapted for this task.

What Problem Does This Paper Address?

Understanding the visual world relies on recognizing individual objects as fundamental building blocks for reasoning. While standard neural networks struggle to disentangle object information, a class of methods called "Slot Attention" has emerged to learn object-centric representations in a self-supervised manner. However, the core assumptions that make Slot Attention effective remain unclear, leading to numerous complex variants. This paper aims to demystify Slot Attention by identifying its essential components and demonstrating that a simpler, more general architecture can achieve similar results.

Methods

The authors propose "Inverted-Attention Transformers" (TF-Inv) as a simplified alternative to Slot Attention. The key innovation lies in modifying the standard Transformer's cross-attention mechanism. Instead of attending to the "keys" (input tokens) using "queries" (slots), TF-Inv inverts this, attending to the "queries" (slots) using the "keys" (input tokens). This "inverted attention" is then followed by a renormalization step, mirroring a technique used in Slot Attention. The authors systematically evaluate this TF-Inv architecture, along with other intermediate variations between standard Transformers and Slot Attention, across various datasets. They also explore the impact of using a GRU for slot updates instead of a residual connection, a common practice in Slot Attention.

Datasets

The paper evaluates its methods on several established datasets for object discovery and related tasks:

  • CLEVR and CLEVRTex: Synthetic datasets for object discovery.
  • COCO: A real-world dataset for object discovery.
  • MOVi-A, MOVi-C, MOVi-E: Video datasets used for object discovery and tracking.
  • MultiShapeNet-Hard (MSN-Hard): A dataset for novel view synthesis of 3D scenes.

The authors do not introduce new datasets but leverage existing ones to benchmark their proposed architecture against prior work.

Key Insights and Ideas

  • Inverted Attention is Key: The most significant finding is that simply inverting the attention mechanism in a Transformer is sufficient to achieve competitive object discovery performance, rivaling specialized Slot Attention models. This suggests that the "slot-centric" nature of Slot Attention might be more about how attention is applied than a fundamentally different architectural paradigm.
  • Transformers are More Flexible Than Assumed: This work demonstrates that standard Transformer architectures, with a minimal modification, can be effectively repurposed for object-centric learning, a task previously dominated by more specialized models.
  • GRU Gating's Role: While inverted attention is crucial, the GRU gating mechanism, often used in Slot Attention for slot updates, appears to be important for performance in certain complex scenarios, particularly in video tasks and when using more powerful decoders.
  • Scaling Behavior: The Inverted-Attention Transformer (TF-Inv) shows better scaling behavior with increased model depth (more layers) compared to standard Slot Attention, suggesting potential for larger and more capable models.

Key Results

  • Competitive Performance: TF-Inv achieves FG-ARI scores comparable to Slot Attention on several image and video datasets, including CLEVR, CLEVRTex, COCO, and MOVi.
  • Improved Scaling: TF-Inv demonstrates improved or maintained performance as the number of layers (iterations) increases, whereas Slot Attention's performance can degrade.
  • Transferability: TF-Inv can be successfully substituted for Slot Attention in existing frameworks like SAVi (for video object discovery) and OSRT (for 3D scene representation), often yielding comparable or even improved results. For instance, in OSRT, TF-Inv with more layers outperformed Slot Attention.
  • GRU's Impact: While TF-Inv performs well, adding back the GRU gating mechanism (TF-Inv w/ GRU) further improves performance in some video and complex scene settings.

Limitations and Future Work

  • Inconsistent Performance of SA-ID: The paper notes that "Slot Attention with 'Implicit Differentiation'" (SA-ID) shows promising results in some conditions but not consistently, and further research is needed to understand these discrepancies and apply any insights to TF-Inv.
  • GRU's Importance in Specific Settings: While TF-Inv is a strong baseline, the GRU gating mechanism still shows benefits in certain complex scenarios, suggesting that a hybrid approach might be optimal.
  • Broader Transformer Applications: The authors suggest that the insights gained from this work could be applied to other Transformer-based applications beyond object-centric learning, such as object detection.
  • Further Investigation of Factors: The paper acknowledges that other factors beyond inverted attention influence performance and calls for more thorough study of these aspects.

Summary updated

BibTeX
@inproceedings{wu2023inverted,
  author = {Yi-Fu Wu and Klaus Greff and Gamaleldin Fathy Elsayed and Michael Curtis Mozer and Thomas Kipf and Sjoerd van Steenkiste},
  title = {{Inverted-Attention Transformers can Learn Object Representations: Insights from Slot Attention}},
  booktitle = {UniReps @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=WgQZNoQ5AB},
}
Figure