SMat-Attention: Structured Long-Context Sequence Modeling
cs.AI
Submitted: 2026-09-28
Updated: 2026-09-28
License: http://creativecommons.org/licenses/by/4.0/
The gist: Long-context sequence models face a fundamental tradeoff: softmax attention uses flexible token-level interactions at quadratic cost, whereas linear attention obtains linear-time training and
Abstract
Long-context sequence models face a fundamental tradeoff: softmax attention uses flexible token-level interactions at quadratic cost, whereas linear attention obtains linear-time training and constant-time decoding by compressing history into a fixed-size state. In this work, we ask whether we can connect these regimes through a tunable notion of structure. To this end, we introduce Structured Matrix Attention (SMat-Attention) via a family of causal masks with structured long-range routing whose row supports have VC-dimension d. In our construction, d=1 recovers the standard causal mask, and increasing d permits richer subset-routing patterns. We give chunkwise forward and backward algorithms to enable hardware-efficiency. For sequences of length T, the hard-routing construction takes O(T 2-3/d+T) work, despite the mask being dense, for our prescribed family. In fixed-horizon streaming, decoding after the distant prefix takes constant time per token using O(T 1-1/d) cached states. SMat-Attention therefore makes VC-dimension an explicit knob governing access-pattern complexity, prefill cost, and decoding memory. Empirically, subset-routing and rule-assisted multi-key retrieval experiments illustrate the masks' routing expressiveness. Extensions to Mamba-2 and Gated DeltaNet using learned routing with top- k query reads retain subquadratic prefill, improve recall accuracy over the backbones in several settings, and achieve comparable small-scale language-modeling performance.
Sources
- The Structural Complexity of Matrix-Vector Multiplication
- Zoology: Measuring and Improving Recall in Efficient Language Models
- Neural Machine Translation by Jointly Learning to Align and Translate
- Memory Caching: RNNs with Growing Memory
- Longformer: The Long-Document Transformer
- Rethinking Attention with Performers
- From block-Toeplitz matrices to differential equations on graphs: towards a general theory for scalable masked Transformers
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Hungry Hungry Hippos: Towards Language Modeling with State Space Models
- Key-Value Means: Transformers with Expandable Block-Recurrent Compressed Memory
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces
- Efficiently Modeling Long Sequences with Structured State Spaces
- Log-Linear Attention
- Transformer Quality in Linear Time
- PolySketchFormer: Fast Transformers via Sketching Polynomial Kernels
- GateLoop: Fully Data-Controlled Linear Recurrence for Sequence Modeling
- Reformer: The Efficient Transformer
- MoBA: Mixture of Block Attention for Long-Context LLMs
- Laughing Hyena Distillery: Extracting Compact Recurrences From Convolutions
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems