Pith. sign in

REVIEW 4 cited by

Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chains

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2402.04161 v2 pith:UUMEE3WL submitted 2024-02-06 cs.LG cs.CLcs.ITmath.ITstat.ML

Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chains

classification cs.LG cs.CLcs.ITmath.ITstat.ML
keywords markovtransformerschainssingle-layerbigramframeworklocalminima
verification ladder T0 review T1 audit T2 compute T3 formal T4 reserved
0 comments
read the original abstract

Attention-based transformers have achieved tremendous success across a variety of disciplines including natural languages. To deepen our understanding of their sequential modeling capabilities, there is a growing interest in using Markov input processes to study them. A key finding is that when trained on first-order Markov chains, transformers with two or more layers consistently develop an induction head mechanism to estimate the in-context bigram conditional distribution. In contrast, single-layer transformers, unable to form an induction head, directly learn the Markov kernel but often face a surprising challenge: they become trapped in local minima representing the unigram distribution, whereas deeper models reliably converge to the ground-truth bigram. While single-layer transformers can theoretically model first-order Markov chains, their empirical failure to learn this simple kernel in practice remains a curious phenomenon. To explain this contrasting behavior of single-layer models, in this paper we introduce a new framework for a principled analysis of transformers via Markov chains. Leveraging our framework, we theoretically characterize the loss landscape of single-layer transformers and show the existence of global minima (bigram) and bad local minima (unigram) contingent on data properties and model architecture. We precisely delineate the regimes under which these local optima occur. Backed by experiments, we demonstrate that our theoretical findings are in congruence with the empirical results. Finally, we outline several open problems in this arena. Code is available at https://github.com/Bond1995/Markov .

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 4 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Induction Heads Interpolate N-Grams

    cs.LG 2026-07 accept novelty 7.0

    Induction-head circuits implement soft context-matching (Jelinek–Mercer-style interpolation over partial matches) plus BOS-induced Dirichlet pseudo-counts, and trained transformers recover both mechanisms.

  2. Structure Before Collapse: Transient semantic geometry in next-token prediction

    cs.LG 2026-06 unverdicted novelty 7.0

    Semantic geometry emerges transiently early in next-token prediction training before collapsing to Neural Collapse symmetry in synthetic settings with latent semantic factors.

  3. Pre-trained Large Language Models Learn Hidden Markov Models In-context

    cs.LG 2025-06 unverdicted novelty 7.0

    Pre-trained LLMs learn to predict HMM-generated sequences via in-context learning, approaching theoretical optimum on synthetic HMMs and matching expert models on real animal decision data.

  4. The LZ78 Source

    cs.IT 2025-03 unverdicted novelty 6.0

    LZ78 sources are almost stationary ergodic processes satisfying a Shannon-McMillan-Breiman property and local i.i.d. convergence, yet their finite-state compressibility exceeds the entropy rate by a Jensen gap.