Abstractors: Transformer Modules for Symbolic Message Passing and Relational Reasoning

Awni Altabaa, Taylor Webb, Jonathan D. Cohen, John Lafferty · OpenReview

Abstract

Reasoning in terms of relations, analogies, and abstraction is a hallmark of human intelligence. An active debate is whether this relies on the use of symbolic processing or can be achieved using the same forms of function approximation that have been used for tasks such as image, audio, and, most recently, language processing. We propose an intermediate approach, motivated by principles of cognitive neuroscience, in which abstract symbols can emerge from distributed, neural representations under the influence of an inductive bias for learning that we refer to as a "relational bottleneck." We present a framework that casts this inductive bias in terms of an extension of Transformers, in which specific types of attention mechanisms enforce the relational bottleneck and transform distributed symbols to implement a form of relational reasoning and abstraction. We theoretically analyze the class of relation functions the models can compute and empirically demonstrate superior sample-efficiency on relational tasks compared to standard Transformer architectures.

Introduction: The Challenge of Relational Reasoning

In the world of deep learning, Transformers are the undisputed kings of sequence processing. However, they have a well-known Achilles' heel: they are notoriously "data-hungry" when it comes to learning abstract rules and relations. While a human can see a few examples of a pattern and grasp the underlying logic, a Transformer often needs millions of examples to implicitly learn the same thing.

Standard attention mechanisms in Transformers produce "entangled" representations. When a Transformer looks at two objects, its internal representation mixes what those objects are (their features) with how they relate to each other. This entanglement leads to significant sample inefficiency and poor generalization to out-of-distribution objects.

The Abstractor: Implementing a Relational Bottleneck

A recent paper published at ICLR 2024 introduces the Abstractor, a new Transformer module designed to disentangle relational information from specific object features. The core innovation is Relational Cross-Attention (RCA), which enforces a "relational bottleneck."

Comparison of Self-Attention and Relational Cross-Attention

In standard self-attention, the "Values" ($V$) are the object features themselves. In RCA, these are replaced with symbols ($S$)—abstract pointers that identify an object's position or role but contain no information about its actual content. The model computes a "relation tensor" by taking the inner products of learned "query" and "key" encoders, ensuring the output represents a comparison between objects rather than just a mixture of their features.

The authors propose three primary ways to assign these abstract symbols:

  1. Positional: Symbols based on the order in the sequence.
  2. Position-relative: Symbols based on the distance between objects.
  3. Symbolic Attention: A "library" of symbols bound to objects based on their syntactic role (e.g., "the variable," "the operator").

Experimental Results and Sample Efficiency

The researchers evaluated the Abstractor across diverse tasks, including synthetic discriminative tasks like the cognitive game SET, object-sorting, and complex mathematical problem-solving.

SET Classification performance comparison

The results across all benchmarks were striking. On the object-sorting task, the Abstractor reached near-perfect accuracy with roughly 1,000 training samples, while standard Transformers struggled even at 3,000 samples. In the SET classification task (shown above), the Abstractor significantly outperformed baselines like PrediNet and MLP, maintaining high accuracy even with very small training sets.

Furthermore, the Abstractor demonstrated superior generalization. When pre-trained on one sorting rule and tested on another, the model adapted significantly faster than baselines, suggesting it had learned a general "sorting" capability rather than memorizing specific sequences. In mathematical tasks, the "Symbolic Attention" mechanism showed the strongest results, outperforming parameter-matched "Transformer+" baselines across calculus, algebra, and arithmetic.

Conclusion

By formalizing the "relational bottleneck," this work provides a concrete path toward more human-like, symbolic reasoning in neural networks. By separating the "relational" branch from the "feature" branch, the model can focus purely on the logic of the task, leading to dramatic gains in sample efficiency and robustness to content transformations. Future work will involve scaling these modules to massive natural language processing tasks and further optimizing architectural configurations.

Summary updated

BibTeX
@inproceedings{altabaa2024abstractors,
  author = {Awni Altabaa and Taylor Webb and Jonathan D. Cohen and John Lafferty},
  title = {{Abstractors: Transformer Modules for Symbolic Message Passing and Relational Reasoning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=XNa6r6ZjoB},
}
Figure