mlsanityData to 14 Oct 2026

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

arXiv 2506.07298 ↗First posted 8 Jun 2025cs.LG cs.AIcited by 4

Not on the map. Why?

Abstract (arXiv)

Hidden Markov Models (HMMs) are foundational tools for modeling sequential data with latent Markovian structure, yet fitting them to real-world data remains computationally challenging. In this work, we show that pre-trained large language models (LLMs) can effectively model data generated by HMMs via in-context learning (ICL)unicodex2013their ability to infer patterns from examples within a prompt. On a diverse set of synthetic HMMs, LLMs achieve predictive accuracy approaching the theoretical optimum. We uncover novel scaling trends influenced by HMM properties, and offer theoretical conjectures for these empirical observations. We also provide practical guidelines for scientists on using ICL as a diagnostic tool for complex data. On real-world animal decision-making tasks, ICL achieves competitive performance with models designed by human experts. To our knowledge, this is the first demonstration that ICL can learn and predict HMM-generated sequencesunicodex2013an advance that deepens our understanding of in-context learning in LLMs and establishes its potential as a powerful tool for uncovering hidden structure in complex scientific data.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 23 of its 57 references that are in the map. First posted on arXiv 8 Jun 2025.

Builds on

23 of 57 references.

References · 23

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2020Scaling Laws for Neural Language Modelscited by 6,586
  5. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  6. 2023Larger language models do in-context learning differentlycited by 394
  7. 20242 OLMo 2 Furiouscited by 340
  8. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
  9. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  10. 2024Are Language Models Actually Useful for Time Series Forecasting?cited by 168
  11. 2023Birth of a Transformer: A Memory Viewpointcited by 161
  12. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 118
11 more
  1. 2020Optimal Regularization Can Mitigate Double Descentcited by 109
  2. 2020Improper Learning for Non-Stochastic Controlcited by 83
  3. 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 40
  4. 2024LLMs learn governing principles of dynamical systems, revealing an in-context neural scaling lawcited by 32
  5. 2020Task Programming: Learning Data Efficient Behavior Representationscited by 27
  6. 2024Transformers on Markov Data: Constant Depth Sufficescited by 27
  7. 2025Enough Coin Flips Can Make LLMs Act Bayesiancited by 22
  8. 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 15
  9. 2015Statistical and Computational Guarantees for the Baum-Welch Algorithmcited by 11
  10. 2024Density estimation with LLMs: a geometric investigation of in-context learning trajectoriescited by 6
  11. 2023Bridging the Usability Gap: Theoretical and Methodological Advances for Spectral Learning of Hidden Markov Modelscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 2.

4 papers.