Enhanced Computationally Efficient Long LoRA Inspired Perceiver Architectures for Auto-Regressive Language Modeling

Kaleel Mahmood, Shaoyi HuangarXiv 2024 · DOI

Introduction

The standard Transformer architecture, while revolutionary, suffers from a quadratic computational complexity $O(n^2)$ relative to sequence length. This "quadratic tax" makes processing long-context sequences—such as entire books or long-form documents—prohibitively expensive. While previous architectures like PerceiverAR attempted to mitigate this by compressing context into latent representations, they often suffered from lossy history and training inefficiencies. This paper introduces the Efficient Context Propagating Perceiver (ECP), a novel architecture designed to maintain computational efficiency while allowing context to be refined and propagated throughout the entire network.

The ECP Architecture

The ECP architecture addresses the limitations of the Perceiver family by introducing a "Double Attention" paradigm centered around PAR (Pairwise Attention Receptive) blocks. Instead of performing a single global attention operation, ECP divides the input sequence into disjoint segments, which are further subdivided into halves.

Overview of the ECP architecture and its attention patterns.

In each layer, a PAR block computes attention for a specific half-segment (the query) by attending to itself and the immediately preceding half-segment (the key/values). This local, overlapping pairwise attention ensures that the computational cost remains linear with respect to the number of segments, significantly reducing the bottleneck compared to standard full attention. While ECP shares some conceptual similarities with LongLoRA’s shifted sparse attention, it utilizes a Perceiver-style pairwise extraction that is more flexible and computationally leaner.

Context Propagation Mechanism

The defining feature of ECP is its ability to propagate information across segments through successive layers. Because the PAR blocks operate on overlapping halves, information from early segments "hops" forward as the network deepens.

Evolution of attention masks through successive layers, demonstrating context propagation.

As illustrated in the attention patterns above, the effective receptive field of a token expands layer by layer. By the final layers, a token's representation implicitly incorporates information from the entire preceding history. This mechanism mimics a sliding window that accumulates context, allowing the model to handle long-range dependencies without the $O(n^2)$ cost in any single layer. Furthermore, the authors suggest that the partial context visible in early layers acts as a form of "implicit dropout," regularizing the model and potentially contributing to its superior performance.

Experimental Results

The ECP architecture was evaluated on several benchmarks, including Wikitext-103, PG-19 (books), and sCIFAR-10 (structural sequence data), demonstrating state-of-the-art (SOTA) performance with a fraction of the computational requirements:

  • Wikitext-103: A 24-layer ECP model achieved a perplexity of 17.43, outperforming larger models like the 60-layer PerceiverAR (18.35) and modern alternatives like Mamba (22.49).
  • PG-19: On this long-context book dataset, ECP reached a perplexity of 18.83, a massive improvement over the Compressive Transformer (33.6) and Transformer-XL (36.3).
  • Computational Efficiency: For a sequence length of 4096, ECP required only 2,452 million calculation steps, compared to 19,327 million for a standard Transformer—a nearly 8x reduction in attention-related computation.

Conclusion

The Efficient Context Propagating Perceiver (ECP) represents a significant step forward in scaling Transformers for long-context tasks. By replacing global attention with a structured, layer-wise propagation mechanism, ECP achieves better perplexity than full-attention models while using only ~12% of the computation. Future work will involve scaling these models to the multi-billion parameter range and developing hardware-optimized kernels to fully realize these theoretical speedups in production environments.

Summary updated

BibTeX
@misc{mahmood2024enhanced,
  author = {Kaleel Mahmood and Shaoyi Huang},
  title = {{Enhanced Computationally Efficient Long LoRA Inspired Perceiver Architectures for Auto-Regressive Language Modeling}},
  year = {2024},
  eprint = {2412.06106},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.06106},
}
Figure