cs.LGFeb 14, 2025

From Markov to Laplace: How Mamba In-Context Learns Markov Chains

Authors: Marco BondaschiNived RajaramanXiuying WeiKannan RamchandranRazvan PascanuCaglar GulcehreMichael GastparAshok Vardhan Makkuva

Organizations: EPFL · UC Berkeley · Google DeepMind · Télécom Paris

Abstract

While transformer-based language models have driven the AI revolution thus far, their computational complexity has spurred growing interest in viable alternatives, such as structured state space sequence models (SSMs) and Selective SSMs. Among these, Mamba (S6) and its variant Mamba-2 have shown remarkable inference speed-ups over transformers while achieving comparable or superior performance on complex language modeling tasks. However, despite these architectural innovations and empirical successes, the fundamental learning capabilities of Mamba remain poorly understood. In this paper, we address this gap by studying in-context learning (ICL) on Markov chains and uncovering an interesting phenomenon: even a single-layer Mamba efficiently learns the in-context Laplacian smoothing estimator, which is both Bayes and minimax optimal. To explain this, we theoretically characterize the representation capacity of Mamba and reveal the fundamental role of convolution in enabling it to represent the optimal Laplacian smoothing. These theoretical insights align strongly with empirical results and, to the best of our knowledge, represent the first formal connection between Mamba and optimal statistical estimators. Finally, we outline promising research directions inspired by these findings.

Explore similar work

CardsList
  1. CHASE: Cache-Hole-Adapted Skip Exit for Looped State-Space Language Models

    Jul 11, 2026Zhenxuan Yu, Takeshi Kojima, Yutaka Matsuo +1Recurrence

  2. Large Language Models Develop Belief State Geometry In-Context

    Sep 15, 2026Daniel Balcells, Andrew Jun Lee, Chirag Rastogi +3In-Context LearningIn-Context