Introduction
The Transformer architecture has revolutionized natural language processing, yet it faces a significant bottleneck: the quadratic complexity of its attention mechanism. As sequence length $N$ increases, both time and memory requirements grow by $O(N^2)$, making the processing of long documents or books computationally prohibitive. While various "efficient" Transformers have been proposed, they often rely on context-agnostic heuristics that fail to adapt to the specific content of the input.
The ABC Framework
The authors introduce Attention with Bounded-memory Control (ABC), a unified framework that reformulates attention as a process of reading from and writing to a fixed-size memory. By bounding the memory size to $n$ slots (where $n \ll N$), the ABC framework achieves linear complexity with respect to the sequence length.
As shown in Table 1, ABC reduces the overall time and space complexity from $O(N^2)$ to $O(nN)$. This transition is achieved by viewing attention through an "outer-product" lens, where a sequence of control vectors $\phi_i$ determines how input information is distributed across the fixed memory slots. This abstraction is powerful enough to encompass several existing efficient models, such as Linformer and sliding-window attention, by varying the definition of the control vectors.
$ABC_{MLP}$: Learning to Remember
The primary contribution of this work is $ABC_{MLP}$, an instance of the framework that employs a learned, contextualized strategy for memory management. Instead of using fixed patterns, $ABC_{MLP}$ uses a single-layer MLP to compute the control vectors $\phi_i$ based on the current token. This allows the model to dynamically "decide" which information is critical to store in its limited memory slots.
Furthermore, because the memory size is fixed, ABC models can be implemented using a recurrent formulation. This makes them highly efficient for causal decoding tasks, as the state update remains constant regardless of the number of previously generated tokens.
Experimental Results
The researchers evaluated $ABC_{MLP}$ across language modeling (WikiText-103), machine translation (WMT14, IWSLT14), and GLUE benchmark tasks.
Efficiency Gains
One of the most striking results is the reduction in memory overhead. While standard Softmax attention requires memory that grows quadratically with sequence length, $ABC_{MLP}$ maintains a near-constant memory footprint.
As illustrated in Figure 1, the memory overhead for Softmax attention explodes as sequences reach $2^{11}$ tokens, whereas $ABC_{MLP}$ remains flat. In terms of speed, $ABC_{MLP}$ was found to be approximately 1.25x faster than other competitive linear models like RFA during decoding.
Accuracy and Performance
Despite the drastic reduction in memory, $ABC_{MLP}$ maintains high accuracy. On WikiText-103, it achieved a test perplexity of 19.5, closely trailing the standard Transformer's 19.0 and significantly outperforming Linformer (30.7). In WMT14 English-German translation, $ABC_{MLP}$ with only 32 memory slots slightly outperformed the baseline Transformer (27.3 vs 27.2 BLEU).
Conclusion and Future Work
The ABC framework demonstrates that learning how to manage a small, fixed memory can be as effective as maintaining a full, growing history. $ABC_{MLP}$ provides a scalable solution for long-sequence modeling without the typical performance trade-offs of context-agnostic efficient Transformers. Future research directions include pretraining ABC models from scratch and exploring learned shift matrices to further optimize memory "forgetting" mechanisms.
Summary updated