Your Context Is Not an Array: Unveiling Random Access Limitations in Transformers
MohammadReza Ebrahimi, Sunny Panchal, Roland Memisevic

TL;DR
This paper investigates why Transformer models struggle with length generalization, revealing that their inability to perform random memory access within the context window is a key factor, supported by analysis and visualization.
Contribution
It identifies the root cause of length generalization failure as the lack of true random memory access in Transformers and demonstrates methods to circumvent this limitation.
Findings
Length generalization failures are linked to inability for random memory access.
Content-based addressing can mitigate random access limitations.
Attention maps reveal where random access fails in models.
Abstract
Despite their recent successes, Transformer-based large language models show surprising failure modes. A well-known example of such failure modes is their inability to length-generalize: solving problem instances at inference time that are longer than those seen during training. In this work, we further explore the root cause of this failure by performing a detailed analysis of model behaviors on the simple parity task. Our analysis suggests that length generalization failures are intricately related to a model's inability to perform random memory accesses within its context window. We present supporting evidence for this hypothesis by demonstrating the effectiveness of methodologies that circumvent the need for indexing or that enable random token access indirectly, through content-based addressing. We further show where and how the failure to perform random memory access manifests…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Data Storage Technologies · Parallel Computing and Optimization Techniques
MethodsSoftmax · Attention Is All You Need
