Multiscale Aggregated Hierarchical Attention (MAHA): A Constrained and Consensus-Based Approach to Efficient Contextual Modeling in Large Language Models
Organizations: Department of Computer Engineering, Faculty of Technology, Sakarya University of Applied Science, Sakarya, Türkiye
Abstract
The quadratic computational complexity of Multi-Head Self-Attention (MHSA) remains a fundamental bottleneck in scaling Large Language Models (LLMs) for long-context tasks. While sparse and linearized attention mechanisms attempt to mitigate this, they often compromise the representation of global dependencies or fail to capture multiscale semantic granularity effectively. In this paper, we propose Multiscale Aggregated Hierarchical Attention (MAHA), a novel architectural framework that reformulates the attention mechanism through hierarchical decomposition and explicitly constrained aggregation. Unlike conventional approaches that treat token interactions at a single resolution, MAHA dynamically partitions the input sequence into hierarchical scales via learnable downsampling operators. The aligned scale outputs are combined either by softmax-normalized weights on the probability simplex or by a fixed number of differentiable consensus updates based on scale-to-consensus discrepancy. The latter is a game-inspired update and is not claimed to compute a Nash equilibrium. Implemented within a hybrid dilated-convolutional transformer backbone, MAHA enables end-to-end training. With four compressed scales and a compression ratio of two, MAHA requires 66.8% fewer attention-score computations than full-resolution attention at every sequence length (5.57M versus 16.8M per head at N=4096), and single-run benchmark experiments indicate downstream performance competitive with standard attention. This work offers a scalable multiscale solution for next-generation LLMs.
Figures & tables
| Family | Representative methods | Mechanism | Training cost |
|---|---|---|---|
| Exact, IO/distribution-aware | FlashAttention-2 ( Dao, 2024 ) , RingAttention ( Liu et al., 2024 ) | Tiled/blockwise exact softmax | compute, reduced memory |
| Fixed sparse | Longformer ( Beltagy et al., 2020 ) , BigBird ( Zaheer et al., 2020 ) , LongNet ( Ding et al., 2023 ) | Local, global, random or dilated patterns | to |
| Trainable or routed sparse | Landmark ( Mohtashami and Jaggi, 2023 ) , NSA ( Yuan et al., 2025 ) , MoBA ( Lu et al., 2025 ) | Learned block selection and compression | Sub-quadratic in the selected blocks |
| Low-rank/kernel | Linformer ( Wang et al., 2020 ) , Performer ( Choromanski et al., 2020 ) , Linear Transformer ( Katharopoulos et al., 2020 ) , Nyströmformer ( Xiong et al., 2021 ) | Projection, random features, landmarks | |
| Recurrent/state-space | RetNet ( Sun et al., 2023 ) , GLA ( Yang et al., 2024 ) , Mamba ( Gu and Dao, 2023 ) , Mamba-2 ( Dao and Gu, 2024 ) , Hyena ( Poli et al., 2023 ) | Decay/gated recurrence, selective SSM, long convolution | to (chunk-wise ) |
| Memory-augmented | StreamingLLM ( Xiao et al., 2024 ) , Infini-attention ( Munkhdalai et al., 2024 ) | Attention sinks, compressive memory | Bounded per segment |
| Evidence | Data / task | Seq. length | Model size | Protocol | Directly comparable? |
|---|---|---|---|---|---|
| Table 3 : MHA, Longformer, BigBird, Reformer, Performer, MAHA | MNLI, SST-2, PG-19, WMT14 En–De, SQuAD v2.0 | Task-specific, identical across models (512 for MNLI, SST-2, SQuAD; 4096 for PG-19) | Identical backbone for all models | Common protocol, trained by the author, single run | Yes, within each column |
| Table 4 and Figure 5 : MAHA variants | MNLI | 512 | Common backbone | Common protocol, single run | Yes, relative to default MAHA |
| Figure 3 : attention cost | Analytical count | 1K–8K | Per head, independent of | Query–key scores only; overhead excluded | Not a runtime measurement |
| Figure 4 : loss curves | Synthetic random tokens | 64 | 1 layer, , | Released demonstration script, 5 epochs | Illustrative only |
| Recent methods (Table 1 ) | Corpora of the original papers | Varies by paper | Varies by paper | Original authors’ settings and hardware | No; discussed qualitatively |
| Model | MNLI | SST-2 | PG-19 | WMT | SQuAD |
|---|---|---|---|---|---|
| (Acc) | (Acc) | (PPL) | (BLEU) | (F1) | |
| Standard MHA | 86.2 | 93.5 | 24.3 | 28.7 | 88.4 |
| Longformer | 85.7 | 92.8 | 23.8 | 27.9 | 87.6 |
| BigBird | 85.9 | 93.1 | 23.5 | 28.1 | 87.9 |
| Reformer | 84.3 | 91.7 | 25.6 | 26.4 | 85.2 |
| Performer | 85.1 | 92.4 | 24.9 | 27.3 | 86.7 |
| Component | Variant | MNLI (Acc) | |
| Default | Simplex mixing, | 86.0 | – |
| Aggregation rule | Iterative consensus ( , ) | 85.8 | |
| Mean aggregation ( ) | 85.2 | ||
| Hierarchy depth | 84.5 | ||
| 85.4 | |||
| 85.3 |
Efficient Attention
Efficient attention reduces the compute, memory traffic, and cache costs of Transformer attention while preserving useful long-range interactions.
See all 154 papers