A Comparative Analysis of Attention versus State-Space Models for In-Context Learning
Abstract
Transformers and state-space models (SSMs) are two prominent sequential learning architectures, yet their comparison remains largely empirical and existing theoretical analyses are typically task-specific or architecturally restricted. In this paper, we develop belief geometry, a unified analytical framework for comparing the representational capabilities of broad classes of attention and SSMs. Starting from a generalized formulation of in-context linear regression and using cumulative Bayes regret as our measure, we abstract three capabilities required by many sequential learning problems in our belief geometry: evidence assembly, belief maintenance, and addressing. We then study three cases of our formulation that isolate these capabilities and yield sharp architectural lessons: For belief maintenance, SSMs attain the optimal regret over stationary aggregation kernels; for positional assembly, SSMs have a memory advantage; and for content addressing, softmax attention has an exponential width advantage over sigmoid-selective SSMs. Experiments with LLaMA-type Transformers and Mamba-2 show that these architectural insights extend beyond our analytically tractable classes and linear-regression testbed.
Create a lesson
Related papers
Correct then Forecast: Observer State-Space Models for Time Series Forecasting
Shared title terminologycs.LGAlexis-Raja Brachet, Guillaume Clavier--Frémond, Abdelhakim Ziani et al.
StarBOA: Real-Time Mamba State-Space Unrolling for Sparse Radar Micro-Doppler in ISAC Networks
Shared title terminologycs.LGMustafa Bora Çelik, Ceren Çelik, Orhan Gazi
PickPack: Scaling Context Extension To Millions Of Tokens With Sparse Attention
Shared title terminologycs.LGKumar Krishna Agrawal, Vihaan Thaker, Keshaw Ranjan et al.
FIMOSS: Fair In-Context Learning via Multi-Objective Subset Selection
Shared title terminologycs.LGManish Chandra, Debasis Ganguly, Iadh Ounis
ContextWorld: Benchmarking In-Context Dynamics Adaptation in Latent World Models
Shared title terminologycs.LGGuo An, Yuhao Yan, Zijing Wu et al.
You Only Edit Once: Incentivizing In-Context Capability of LLMs via Local Demonstration Refinement
Shared title terminologycs.LGJiarong Wen, Qi Wang, Yun Qu et al.