Associative Transformer
Yuwei Sun, Hideya Ochiai, Zhirong Wu, Stephen Lin, Ryota Kanai
TL;DR
The Associative Transformer (AiT) addresses inefficiencies in sparse attention by introducing a Global Workspace Layer that couples a low-rank explicit memory of learnable priors with an associative Hopfield memory for token reconstruction. The method writes token representations into memory via a bottleneck attention with a diversity-promoting balance loss and retrieves refined representations through attractor dynamics, yielding improved parameter efficiency and performance on classification and relational reasoning tasks. Extensive experiments show AiT outperforms state-of-the-art sparse transformers like Coordination while using fewer parameters and layers, with notable gains on CIFAR, ImageNet100, and Sort-of-CLEVR. This approach advances localized contextual learning in vision transformers and suggests broader applicability to other domains with sparse attention constraints.
Abstract
Emerging from the pairwise attention in conventional Transformers, there is a growing interest in sparse attention mechanisms that align more closely with localized, contextual learning in the biological brain. Existing studies such as the Coordination method employ iterative cross-attention mechanisms with a bottleneck to enable the sparse association of inputs. However, these methods are parameter inefficient and fail in more complex relational reasoning tasks. To this end, we propose Associative Transformer (AiT) to enhance the association among sparsely attended input tokens, improving parameter efficiency and performance in various vision tasks such as classification and relational reasoning. AiT leverages a learnable explicit memory comprising specialized priors that guide bottleneck attentions to facilitate the extraction of diverse localized tokens. Moreover, AiT employs an associative memory-based token reconstruction using a Hopfield energy function. The extensive empirical experiments demonstrate that AiT requires significantly fewer parameters and attention layers outperforming a broad range of sparse Transformer models. Additionally, AiT outperforms the SOTA sparse Transformer models including the Coordination method on the Sort-of-CLEVR dataset.
