Pith. sign in

REVIEW 3 cited by

Transformers on Markov Data: Constant Depth Suffices

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 2407.17686 v1 pith:NR3H3PGQ submitted 2024-07-25 cs.LG cs.CLcs.ITmath.ITstat.ML

Transformers on Markov Data: Constant Depth Suffices

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

Attention-based transformers have been remarkably successful at modeling generative processes across various domains and modalities. In this paper, we study the behavior of transformers on data drawn from \kth Markov processes, where the conditional distribution of the next symbol in a sequence depends on the previous $k$ symbols observed. We observe a surprising phenomenon empirically which contradicts previous findings: when trained for sufficiently long, a transformer with a fixed depth and $1$ head per layer is able to achieve low test loss on sequences drawn from \kth Markov sources, even as $k$ grows. Furthermore, this low test loss is achieved by the transformer's ability to represent and learn the in-context conditional empirical distribution. On the theoretical side, our main result is that a transformer with a single head and three layers can represent the in-context conditional empirical distribution for \kth Markov sources, concurring with our empirical observations. Along the way, we prove that \textit{attention-only} transformers with $O(\log_2(k))$ layers can represent the in-context conditional empirical distribution by composing induction heads to track the previous $k$ symbols in the sequence. These results provide more insight into our current understanding of the mechanisms by which transformers learn to capture context, by understanding their behavior on Markov sources.

discussion (0)

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

Forward citations

Cited by 3 Pith papers

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

  1. Transformers Learn Latent Mixture Models In-Context via Mirror Descent

    cs.LG 2026-04 unverdicted novelty 8.0

    A three-layer transformer exactly implements one step of mirror descent on latent mixture weights for next-token prediction, yielding a first-order approximation to the Bayes-optimal estimator.

  2. 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.

  3. 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.