← Home

LLMs Encode Bayesian Priors as a Single Geometric Direction

By James Trappett · 5 September 2026

4 min read

A persistent question in language model interpretability is what a model actually does when it has nothing useful to go on. The answer, according to this paper, is geometrically precise: the model falls back on a single direction in its unembedding space that encodes the unigram distribution of its training corpus. The paper, available on arXiv, identifies this direction, derives a scalar measure of how heavily any given prediction relies on it, and demonstrates causal control over that reliance. It is a clean mechanistic result with genuine implications for interpretability, hallucination research, and training diagnostics.

The background motivation is well-established: LLMs are known to be biased toward high-frequency tokens, particularly when context is weak or ambiguous. Prior work has documented this empirically, but the internal mechanism has remained opaque. This paper closes that gap at the output layer, at least, by showing the mechanism is about as simple as it could possibly be.

Key Contributions

The authors identify what they call the direction of ignorance, a vector dprior in the model's hidden space such that passing it through the unembedding matrix and applying softmax recovers the empirical unigram distribution of the training corpus. This direction is found via linear least-squares on the unembedding matrix alone, requiring no forward passes through the model. Four contributions follow from this:

Methodology

The approach is admirably parsimonious. The direction of ignorance is recovered by solving a least-squares problem: find dprior such that softmax(Wdprior) approximates the empirical unigram distribution, where W is the unembedding matrix. No fine-tuning, no probing classifiers, no auxiliary networks. The quality of the fit is assessed via normalised KL divergence, and the paper reports low KL across all model families, supporting the identification of the fitted direction with the true prior direction.

Context dynamics are studied by varying prompts systematically, from highly specific geographic queries to vague or shuffled inputs, and tracking how λ changes across token positions. The causal claim is established by directly editing the projection of the prediction state onto dprior and measuring the resulting shift in output distribution, with random-direction controls to rule out generic perturbation effects.

One methodological choice worth scrutiny is the corpus used to estimate the unigram distribution: the authors use a streamed subset of the uncopyrighted Pile under each model's tokenizer, which is not the actual pretraining data for any of the models tested. The authors acknowledge this and argue the recovered direction is robust across families trained on different data, which is plausible given the low KL values reported, but it introduces an approximation that cannot be fully quantified without access to the true training corpora.

Results and Scaling Observations

The empirical picture is consistent across families. λ declines as context becomes more informative and rises under degraded input. Larger models within a family tend to exhibit lower late-context λ, suggesting they extract more from context and rely less on the prior. Llama-3.1-70B actually settles at negative λ in the high-context limit, meaning it actively suppresses high-frequency tokens relative to the unigram distribution. The authors note this is a mechanistic analogue of contrastive decoding and PMI-based methods that subtract a prior externally at inference time; here the suppression is learned and internal.

The scaling trend across families is presented carefully as an observation rather than a law. Latent dimensionality is confounded with architecture, data volume, and compute, so the apparent decrease in |λ| with model size cannot be cleanly attributed to any single factor. Gemma-3-1B is a clear outlier. The authors are appropriately cautious here, which is the right call given the confounds.

A speculative but interesting extension concerns higher-order priors. Preliminary results suggest that full-word and sub-word tokens form distinct frequency-aligned clusters in the unembedding, each associated with its own prior direction. This raises the possibility that the unigram prior is just the coarsest level of a hierarchy of priors, with finer-grained directions encoding category-level statistics. That is not demonstrated in this paper, but it is a natural and testable hypothesis.

Implications and Open Questions

The practical implications span several areas. For hallucination research, λ provides a per-token signal of how much a prediction is driven by statistical frequency rather than contextual evidence, which is precisely the condition associated with confabulation. Whether λ is a useful hallucination detector in practice remains to be shown, but the theoretical motivation is sound.

For training diagnostics, the direction of ignorance is computable from model weights alone, without any forward passes. Tracking the normalised KL of the prior fit across checkpoints could indicate when the unembedding begins encoding corpus statistics, and tracking late-context λ could signal the transition from unigram matching to genuine context-driven inference. These are lightweight diagnostics with potentially high signal value.

The most significant limitation is that the analysis is confined to the output layer. The upstream computation that writes into dprior across the residual stream is not investigated. Understanding how earlier layers contribute to or modulate the prior loading factor is the obvious next step, and connecting this to attention head-level mechanisms would substantially deepen the mechanistic account. The paper is explicit about this gap.

There is also a question about generality beyond English-dominant models. All models tested are trained primarily on English text, and it is not obvious that the same geometric structure would appear, or appear with the same properties, in models trained on multilingual corpora where the unigram distribution is more complex.

Overall, this is a well-executed piece of mechanistic interpretability work. The central finding is clean, the causal claim is properly tested, and the Bayesian framing adds genuine analytical value beyond a purely geometric description. The direction of ignorance is a simple structure, and that simplicity is exactly what makes it interesting.

Read the full paper on arXiv.

Mechanistic InterpretabilityLanguage ModelsBayesian InferenceEmbeddingsScaling Laws

Related Articles

AI-Driven English Textbooks: A Five-Layer Adaptive ArchitectureWhere Does Harness Value Live? Credit Assignment in LLM AgentsEvalDetectBench: Measuring Evaluation Awareness in LLMs