atlas

Research map / Large language models / Language, safety and interpretability

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

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: LLM pruning and scaling data · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows pre-trained LLMs (Qwen2.5, Llama) can predict synthetic HMM sequences via in-context learning, approaching Viterbi-oracle accuracy, with scaling trends tied to entropy and mixing rate, and beats GLM-HMM on IBL mouse decision data.

Problem

Fitting Hidden Markov Models to real-world sequential data is computationally hard and unstable (Baum-Welch non-convexity), and it is unknown whether pre-trained LLMs can implicitly learn HMM dynamics in context.

Approach

Treat HMM-generated observation sequences as text prompts and evaluate pre-trained LLMs' next-observation prediction as the context grows, comparing against Viterbi/oracle, Baum-Welch, spectral learning, n-grams, LSTM and Transformer; relate scaling trends to HMM entropy and mixing rate with a spectral-learning-based theoretical conjecture.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use LLM ICL instead of GLM-HMMIBL mouse decision-making · IBL mouse decision-makingprediction accuracy: 82.2% -> 86.2%Helped
Increase context lengthLLM ICL · Synthetic HMM sequence predictionprediction accuracyHelped
Use higher transition or emission entropyLLM ICL on synthetic HMMs · Synthetic HMM sequence predictionconvergence stepsHurt
Use slower mixing (higher λ₂)LLM ICL on synthetic HMMs · Synthetic HMM sequence predictionconvergence stepsHurt
Vary the number of states while holding entropy constantLLM ICL on synthetic HMMs · Synthetic HMM sequence predictionconvergence rateNo clear effect
Use LLM ICL instead of empirical learning baselinesSynthetic HMM prediction · Synthetic HMM sequence predictionprediction accuracyHelped
Use a Transformer instead of an LSTMTrained neural sequence baselines · Synthetic HMM sequence predictionprediction accuracyHelped
Use a bigram instead of other n-gram baselinesn-gram prediction baselines · Synthetic HMM sequence predictionprediction accuracyHelped
Increase context lengthLLM ICL · Reward-learning ratsprediction accuracyHelped
Use LLM ICL instead of the specialized symbolic-program modelReward-learning rats · Reward-learning ratsprediction accuracyHurt
Use a truncated-history conditional predictor in a fast-mixing regimeOracle conditional predictor · Synthetic HMM sequence predictionprediction accuracyHelped

Surprising findings

Experimental setup

Datasets: Synthetic HMM sequences IBL mice decision-making dataset Reward-learning rats dataset

Benchmarks: synthetic HMM prediction IBL mice decision-making reward-learning rats

Metrics: prediction accuracy Hellinger distance convergence step T accuracy gap to Viterbi

Baselines: Viterbi (oracle) P(O_{t+1}|O_{t-k:t}) oracle Baum-Welch spectral learning n-gram LSTM Transformer GLM-HMM

Builds on: Viterbi algorithm Baum-Welch spectral learning of HMMs GLM-HMM

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy