Imagine handing a language model a stream of letters: F, Q, F, V, Q. There are no words to define and no story to follow. The letters are being emitted by a hidden process, and the model’s job is to predict what comes next. As the stream lengthens, the pattern becomes less mysterious—but something more interesting happens inside the model. It appears to build a map of what the unseen process might be doing.
That map is not a picture or a private narration. It is a probability distribution over the process’s hidden states: a running estimate of which unseen situation is most likely, given the symbols so far. In a new study, researchers found evidence that large language models construct this kind of internal estimate while learning to predict unfamiliar sequences in context. Then they changed the estimate directly—and watched the models’ predictions change with it.
The experiment centers on a classic idea in statistics: the hidden Markov model, or HMM. Picture a machine with several internal states. It occupies one state, emits a visible token, then moves to another state. You see the tokens, not the state changes. A single symbol may not tell you much. But a whole history of symbols can shift the odds: perhaps the machine is now more likely to be in one state than another.
Because the state is hidden, a good predictor must keep track of those odds. The researchers call that distribution a belief state. Here, “belief” means a mathematical estimate, not confidence, awareness, or a human-like feeling. It is a compact summary of the past that helps predict the next token—even when the clues are spread across a long sequence.
To look for that summary, the team tested six open-source language models on 40 HMMs from four families. Thirty of the processes were newly designed. The researchers turned each process’s emissions into simple, space-separated letter sequences, such as F and Q, or F, Q, and V. Each sequence contained 20,000 tokens. The models had not been specially trained on these particular processes; instead, they had to infer their patterns from the examples in front of them.
First came the practical test: could the models predict well? For Qwen3.5-9B, performance improved over the first 5,000–10,000 tokens and then leveled off. On the main examples, its predictions were as accurate as those of an idealized predictor restricted to roughly 4.2–11.0 recent tokens. Across the ten parameter settings in each HMM family, the median equivalent range was 3.4–4.7 tokens, with a range of 2.2–11.0. That comparison describes prediction accuracy, not proof that the model literally discards everything older. The point is that it could use a long history to reach performance a short-window predictor needed only a few recent symbols to match.
Good guesses alone would not reveal what the model was doing. A system might rely on a shortcut, such as memorizing which short strings tend to follow other short strings. So the researchers looked inside the models’ residual streams—the changing numerical activations passed between layers—and asked whether a simple linear probe could recover the mathematically calculated belief state from them.
Across the models and processes, the best-fitting probes recovered the belief states with R-squared values from 0.83 to 0.99. The signal appeared in early-to-middle layers and often remained strong later. Crucially, control probes trained on shuffled or randomly assigned belief states did not recover comparable structure. Other tests also found belief-state information that could not be explained just by the model’s next-token probabilities or by a limited recent-token shortcut. In other words, the hidden map seemed to contain more than a dressed-up version of the answer it was about to give.
Then came the more adventurous test. If the map is part of the machinery behind prediction, could researchers alter it and redirect the model? They used two kinds of intervention, called steering and patching, to install a different target belief state in selected activations. Some targets were deliberately inconsistent with the sequence the model had actually read.
The edits had a measurable effect. After a target belief was installed, the model’s next-token predictions shifted toward the distribution that the target state implied, and away from the distribution implied by the original history. Injecting an unrelated random belief did not produce the same shift. The result is important because it goes beyond finding information that a probe can read: changing the identified representation changed the model’s behavior in the predicted direction.
The intervention was not magic. A short edit could be partly overwhelmed by the rest of the context, and edits made at some earlier layers were followed by a kind of self-repair: later layers tended to restore the original prediction-related representation. But when the intervention took hold, it could push the model toward a hidden situation that contradicted the sequence it had seen. The researchers also found that belief-state edits could affect internal representations of next-token probabilities downstream, consistent with the belief state playing an upstream role in the prediction process.
This is a shift in scale: the visible action is a model choosing the next letter, while the hidden work involves tracking a changing distribution over unseen causes. The study gives researchers a controlled way to examine that gap. It also offers evidence that in-context learning can involve more than matching a few surface patterns: in these tasks, the tested models behaved as though they inferred an unseen process and tracked its changing state.
But the boundary matters. The researchers chose low-entropy HMMs with distinctive, non-trivial belief-state geometry. They do not establish that the same map appears for every HMM, for ordinary conversations, or for complex reasoning. A probe can also make structure look clearer than it truly is, even with controls; the authors say complementary evidence is still needed. One of the smallest tested models showed weaker or absent findings in some cases, and a few parameter settings did not distinguish the full belief state from simpler alternatives.
So this is not a discovery of an inner observer peering at its own thoughts. It is a carefully bounded result: in unfamiliar streams of symbols, multiple language models formed an internal representation that tracked hidden-state probabilities, and targeted edits to that representation steered their predictions. The next question is whether comparable maps help models navigate the far messier sequences we call language—and what other invisible structures might be guiding their guesses.









