Short-Long Convolutions Help Hardware-Efficient Linear Attention to Focus on Long Sequences

Zicheng Liu, Siyuan Li, Li Wang, Zedong Wang, Yunfan Liu, Stan Z. Li

Abstract

CHELA (short-long Convolutions with Hardware-Efficient Linear Attention) is a hybrid architecture designed to bridge the gap between the theoretical efficiency of linear attention and its actual hardware performance. By integrating an optimized tiling approach for attention with a novel hierarchy of short and long convolutions, CHELA achieves state-of-the-art results on long-sequence benchmarks. Experimental results demonstrate that CHELA can run up to 5.8x faster than standard Transformers while maintaining superior accuracy across diverse modalities.

Introduction

Transformers have become the backbone of modern AI, yet they suffer from a quadratic computational complexity ($O(L^2)$) relative to sequence length. This "long-sequence problem" makes processing extensive contexts prohibitively expensive. Existing solutions like Linear Attention and State Space Models (SSMs) offer theoretical $O(L)$ complexity but face practical hurdles. Linear attention often encounters memory I/O bottlenecks on GPUs due to operations like cumulative sums, while SSMs can be unstable and struggle to capture both local high-frequency and global low-frequency patterns.

CHELA addresses this "efficiency-performance dilemma" by optimizing the memory hierarchy for linear attention and introducing a hierarchical convolutional structure to stabilize and enhance feature extraction.

Methodology: The CHELA Architecture

CHELA introduces two primary innovations to the hybrid model landscape:

Hardware-Efficient Linear Attention

Inspired by FlashAttention, CHELA utilizes a tiling and divide-and-conquer strategy. By breaking attention computations into blocks that fit within a GPU's fast SRAM (Static Random-Access Memory), the model minimizes slow HBM (High Bandwidth Memory) access. This optimization effectively doubles the practical throughput of linear attention.

Short-Long Convolutions

Rather than relying on a single convolution kernel, CHELA employs a hierarchical module. Short convolutions are positioned to capture local, high-frequency signals, followed by a long convolution for global, low-frequency context. Through structural reparameterization, these kernels are fused into a single kernel during inference, ensuring no additional runtime overhead.

CHELA Layer architecture and the hardware-efficient tiling strategy for linear attention.

Gated Integration

A gating mechanism, similar to Gated Linear Units (GLU), adaptively combines the outputs of the convolutional and attention modules, allowing the model to prioritize relevant information dynamically.

Experimental Evaluation

The researchers evaluated CHELA across several benchmarks, including the Long Range Arena (LRA), language modeling (WikiText-103, enwik8), speech classification (SC10), and image classification (sCIFAR-10).

Key Results

  • LRA Performance: CHELA achieved an average accuracy of 88.19%, surpassing models like Mega (85.66%) and S4 (80.50%). Notably, it was the only model to achieve high accuracy (98.15%) on the challenging PathX task.
  • Speed and Efficiency: On the LRA Text task (4K length), CHELA demonstrated a 5.8x speedup over standard Transformers.
  • Language and Speech: The model achieved a perplexity of 16.97 on WikiText-103 and a state-of-the-art 97.98% accuracy on raw speech classification.
Comparison of accuracy across LRA datasets and runtime speed vs. input length.

Discussion and Insights

The success of CHELA highlights that "linear complexity" on paper does not guarantee "linear time" on hardware without I/O optimization. By addressing the memory hierarchy, CHELA proves that linear attention can outperform SSMs. Furthermore, the specialization of frequency bands through short-long convolutions provides a structural bias that stabilizes training and allows the model to capture multi-scale temporal dependencies.

Conclusion and Future Work

CHELA successfully bridges the gap between theoretical efficiency and practical hardware performance for long-sequence modeling. Future research will explore automated kernel size search, the integration of time-varying SSM logic (as seen in models like Mamba), and scaling the architecture to multi-billion parameter large language models.

Summary updated

BibTeX
@inproceedings{liu2024short,
  author = {Zicheng Liu and Siyuan Li and Li Wang and Zedong Wang and Yunfan Liu and Stan Z. Li},
  title = {{Short-Long Convolutions Help Hardware-Efficient Linear Attention to Focus on Long Sequences}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=TRrXkVdhwi},
}
Figure