A novel algorithm called Lighthouse Attention aims to make training long-context transformer models faster and more memory-efficient. The approach uses a symmetric, hierarchical pooling of queries, keys, and values to build a multi-level pyramid, which scores and selects only the most relevant data for attention. This selection happens outside the main attention kernel, allowing models to use standard FlashAttention on a compressed sub-sequence, achieving sub-quadratic time and memory complexity.
A key innovation is a two-stage training strategy: models are pre-trained with Lighthouse Attention, then briefly fine-tuned with full attention to recover any lost performance. Experiments show the method improves training throughput and reduces latency by up to 21 times at extreme context lengths, while matching or exceeding the performance of dense-attention baselines. The results demonstrate significant wall-clock speedups on modern GPU hardware.
This work, described in the paper "Lighthouse Attention: Symmetric Hierarchical Pre-Training for Long Context Transformer Models," offers a practical solution for scaling transformers to longer sequences without sacrificing quality.