Subquadratic Attention with a Hierarchical Tree-Structured Indexer
Leon Lufkin, Cutter Dawes, Alexander Speicher, Kamesh Krishnamurthy, Tomás Figliolia, Beren Millidge
Read on arXiv →Key claim
ZHA enables subquadratic scaling for long-context attention.
In plain English
Imagine you're building a large language model that needs to handle long documents or conversations without losing track of context. Traditional attention mechanisms struggle here because they scale quadratically with the length of the input, making them inefficient for very long sequences. Current alternatives, like linear or sparse attention, either compromise on expressiveness or still face scaling issues, which can lead to performance drops in complex tasks. This is what's called the quadratic scaling problem, and it limits the practical use of LLMs in real-world applications where context length is crucial. To address this, the authors propose a new method called Zyphra Hierarchical Attention (ZHA). The intuition behind ZHA is to create a tree structure that compresses key summaries, allowing the model to traverse this tree to efficiently retrieve relevant information without needing to process every single token. By growing the tree's depth iteratively, ZHA achieves subquadratic scaling, meaning it can handle longer contexts more efficiently than previous methods. This approach can be easily integrated into existing models with minimal retraining, maintaining performance on challenging tasks like reasoning and coding. Compared to prior work, ZHA not only scales better but also shows robustness to different tree structures, potentially allowing models to handle context lengths in the hundreds of millions of tokens. For builders, this means you can create more capable AI systems that retain context over longer interactions, making them more useful in practical applications.
The method introduces a novel hierarchical approach to sparse attention that significantly improves scaling.
The performance model and empirical results demonstrate robustness and effectiveness across various tasks.
Deep reliability assessment
The methodology supports subquadratic scaling of attention through a hierarchical tree-structured indexer, but the claims of extending context windows to billions of tokens are not empirically validated.
Reproducibility
No open source code or dataset is mentioned in the paper.
Key figure
Figure 1 illustrates the structure of naturalistic data and the attention scores over long contexts induced by RoPE.
