Automated Conversion Notice
Warning: This paper was automatically converted from LaTeX. While we strive for accuracy, some formatting or mathematical expressions may not render perfectly. Please refer to the original ArXiv version for the authoritative document.
1 Introduction
Statistical models of sequence distributions form the foundation of our mathematical theories of communication (Shannon, 1948), artificial general intelligence (Hutter, 2005), and natural language. The empirical success of transformer neural networks has brought sequence models once again to the center of both theoretical and practical aspects of artificial intelligence (Vaswani et al., 2017). Recent work has suggested that the geometry of the loss landscape in these networks may be deeply related to the way that the models compute (Chen et al., 2023; Wang et al., 2024; Hoogland et al., 2024), and therefore understanding this geometry and how it relates to structure in the data distribution is a promising path towards interpretability and applications in AI safety (Lehalleur et al., 2025).
Within the framework of singular learning theory (SLT) (Watanabe, 2009) the main way we currently access this geometry empirically is through approximate Bayesian posterior sampling using stochastic gradient Langevin dynamics (SGLD) (Welling & Teh, 2011). This forms the basis for local learning coefficient (LLC) estimation (Lau et al., 2024) and related techniques like susceptibilities (Baker et al., 2025). However there are many open conceptual and technical questions about this SGLD-based approach to studying the geometry of the loss landscape.
In this paper, we lay foundations for understanding the role of modes of the data distribution in shaping our measurements of the geometry of the loss landscape of sequence models like transformers. We do this by developing an effective theory of sequence modelling. Our approach uses function spaces and tensor decompositions to identify the fundamental patterns – which we call modes – in sequence distributions. This framework allows us to perform a principled coarse-graining of the true data distribution by truncating smaller modes while preserving the dominant structures, resulting in what we term the effective true distribution.
Our key insight is that the geometry of learning, as captured by LLC estimation, is inherently limited in its sensitivity to the full spectrum of modes. Due to constraints on the sensitivity of the model’s gradients to the long tail of modes, LLC estimation primarily measures the geometry of the effective true distribution rather than the complete distribution. This has several implications for how we interpret measurements of landscape geometry in deep sequence models.
The contributions we make in this paper:
-
Modal decomposition of sequence distributions: Building on existing work in the mathematical literature on natural language processing, we use tensor decompositions to formulate a Hilbert space of sequence models with a natural basis. We show how patterns in the data distribution correspond to modes, and how tensor truncation provides a principled approach to coarse-graining.
-
LLC estimation measures effective distributions: We prove that under reasonable assumptions, LLC estimation is insensitive to small modes in the distribution. Specifically, the LLC estimates we perform in practice (e.g., on transformer neural networks) effectively measure the geometry of a coarse-grained distribution rather than the complete distribution.
The paper is organized as follows: In Section 2, we review necessary background on tensor algebra and singular value decomposition. Section 3 introduces our formalism for sequence models and their corresponding data distributions. Section 4 develops the Hilbert space framework and modal decomposition. Section 5 makes these abstract definitions concrete with some examples of modes. Then in Section 6 and Section 7 we connect these concepts to Singular Learning Theory and the Local Learning Coefficient and prove our main results.
2 Background
2.1 Tensor Algebra
Throughout all vector spaces are over , and all tensor products are of -vector spaces. Given vector spaces and , let denote the space of all linear transformations from to . There is a canonical isomorphism of vector spaces
| (1) | |||
| (2) |
The free vector space on a finite set is the set
| (3) |
with the usual vector space structure of addition of functions and multiplication of a function by a scalar. We define an injective map sending to the delta function and henceforth use this injection to identify elements of with vectors in .
There is a canonical isomorphism of vector spaces
| (4) | |||
| (5) |
and in particular for we have .
2.2 Singular Value Decomposition
For the reader’s convenience we give a minimal treatment of SVD that makes explicit the fact that SVD is an operation on linear transformations between inner product spaces. Let be finite-dimensional inner product spaces over with pairings denoted and respectively. Given a linear transformation the adjoint is uniquely defined by
Then are self-adjoint operators on respectively and thus we may apply the spectral theorem to obtain an orthonormal basis of eigenvectors for these spaces. Let be an orthonormal basis of consisting of eigenvectors of with eigenvalues . We can divide the indices into those with positive and zero eigenvalues
We write for the complete set of indices, so . Then we define
| (6) |
Lemma 2.1.
The set is an orthonormal basis in for the image of . We have
| (7) |
We call the singular values, the right singular vectors and the left singular vectors.
Proof.
If define . Then
and hence
Moreover by adjointness
If we set then the claims follow.
2.3 Learning Coefficient
In this section we formulate the problem of learning the conditional true distribution of sequences in the context of singular learning theory (SLT) Watanabe (2009). We assume and , . Given a set of independent and identically distributed samples drawn from the true data-generating distribution , we define the sample negative log likelihood associated with a model and its theoretical counterpart as
Under some technical hypotheses the local learning coefficient (LLC) (Watanabe, 2009) (Lau et al., 2024) can be defined at a local minimum of is the volume scaling exponent of the loss near in the following sense. Let be a closed ball centered on such that for all , . For sufficiently small , consider the set , the volume of which we define as for some positive prior . It can be shown that there exist a positive rational number and a positive integer such that asymptotically as . The LLC is defined to be the rational number .
For regular statistical models, , where is the dimension of the parameter space. However, in general can be smaller than . The LLC plays a crucial role in the asymptotic expansion of the local free energy
| (8) |
The asymptotic expansion of the local free energy is given by Watanabe’s free energy formula (Watanabe, 2018, §6.3)
| (9) |
This expansion provides insights into the behavior of the posterior distribution and is the basis for one approach to understanding neural network development (Chen et al., 2023; Hoogland et al., 2024; Wang et al., 2024).
2.4 LLC Estimation
It is technically challenging to derive theoretical values for the LLC even for deep linear neural networks (Aoyagi, 2024). To this end, Lau et al. (2024) introduced an estimator of the LLC and we recall its definition below. Consider the posterior distribution in localized to by a Gaussian prior centered there with scale parameter :
| (10) |
The larger is, the more tightly concentrated this distribution is around . Let denote expectation over (10). The LLC estimator is defined by
| (11) |
We note that in the original work of Lau et al. (2024) we use the inverse temperature derived in Watanabe (2013). However empirically it has been found that other inverse temperatures are more convenient because the SGLD sampler is better behaved (Hoogland et al., 2024; Wang et al., 2024). That this is a valid estimator follows from (Watanabe, 2013, Theorem 4) which holds for with . The effect of this choice of inverse temperature on the estimates is part of the subject of the present work (see Section 8).
We approximate the expectation in this estimator with SGLD Welling & Teh (2011). The SGLD update for sampling from the local posterior distribution is
| (12) |
where and is a randomly sampled minibatch. Here the batch-size can be significantly smaller than . Let be samples of the tempered posterior at inverse temperature using the SGLD update (12). Then the SGLD-based LLC estimator is
| (13) |
Typically we will drop the superscript and write for estimates derived using SGLD samples.
3 Sequence Models
Let be a nonempty finite set which we refer to as the set of symbols or tokens. Elements of are denoted by Greek letters . For , let denote the set of sequences of symbols in , which we refer to as strings, with length . General strings are denoted by . We denote by the maximum length of a string.
3.1 Data Distribution
We consider jointly distributed random variables taking values in . Here elements in are identified as vectors in (see Section 2.1). For each with , the strings of length are distributed according to a joint distribution where we use to stand for the th position in a string over any length. We assume for all . The cross moments of the random vectors are joint probabilities over tokens
For any , let denote the number at the -th coordinate of . Note that
so the cross moments can also be written as
Definition 3.1.
We call the th fundamental tensor.
We will use the linear map
| (14) |
Observe that applying to has the effect of marginalizing over , as
More generally, applying to positions in a fundamental tensor has the effect of producing a tensor in which encodes the appropriate marginal distribution of . We refer to the basis of tensors for as the word basis. Since the fundamental tensors encode probability distributions, their coefficients in the word basis are non-negative, and .
In general the collection of distributions need not have any particular relation to one another, but if we are to imagine these distributions as being the “true” distribution of natural language then we may impose a natural condition which says that is equal to the marginal distribution of sequences of length within sequences of length .
The following definition is a reformulation of (Mumford, 1994, Definition 1.1):
Definition 3.2.
We say that the sequence is a language if the following diagram commutes for any
It follows in turn that marginalizations of yield for . In the rest of the paper we assume we are given a language in this sense, and as a consequence we henceforth drop the subscripts and write for the distribution over sequences of tokens. We also adopt an abbreviated notation for the probability of a sequence of tokens
| (15) |
In this notation
| (16) |
Similarly we write
| (17) |
3.2 Tokenisation
Tokenisation is a fundamental preprocessing step in modern language model training, serving as the interface between raw text and the numerical representations required by neural networks. A tokeniser segments input text into discrete units called tokens, which form the vocabulary that the model operates on (Kudo & Richardson, 2018; Sennrich et al., 2016; Phuong & Hutter, 2022). The choice of tokenisation strategy significantly impacts model performance, training efficiency, and downstream applicability (Mielke et al., 2021).
Several tokenisation approaches have evolved alongside advances in language modelling:
Word-level tokenisation.
Early approaches split text on whitespace and punctuation, treating each word as a distinct token (Mikolov et al., 2013a). While intuitive, this approach suffers from vocabulary explosion in morphologically rich languages and an inability to handle out-of-vocabulary words.
Character-level tokenisation.
Character-based approaches (Kim et al., 2016) use individual characters as tokens, ensuring a small vocabulary size and eliminating out-of-vocabulary issues. However, they create very long sequences and lose direct access to word-level semantics, requiring the model to learn these relationships from scratch.
Subword tokenisation.
Modern language models predominantly use subword tokenisation algorithms (Sennrich et al., 2016; Kudo & Richardson, 2018), which strike a balance between word and character approaches. These methods adaptively split words into subword units based on frequency statistics in the training corpus.
The choice of tokenisation strategy creates implicit biases in how models learn linguistic patterns (Rust et al., 2021). These biases manifest in several ways. For example subword algorithms like BPE create shorter tokens for frequent words or substrings and longer tokens for rare ones. The distributional properties we study, including modes, are shaped by how the continuous stream of text is discretised through tokenisation.
Example 3.3.
In the tokeniser for EleutherAI/pythia-70m
Biderman et al. (2023) which we use for our experiments a sample taken from the Pile subset wikipedia_en
Gao et al. (2020); Devin
Gulliver (2025) is tokenised as follows:
InshiitakemushroomsgrownoutdoorsonwoodinacityintheprefectureIbaraki
.
In this case the set of tokens has around 50k elements. This tokenizer was developed in Black et al. (2022) and is a BPE tokenizer that is trained specifically on the Pile.
3.3 Transformers
Transformer neural networks (Vaswani et al., 2017) have become the dominant architecture for modelling sequential data, particularly in natural language processing. For a formal definition of a transformer-based sequence model see Phuong & Hutter (2022).
For autoregressive modelling, transformers typically employ causal attention masks to ensure that the prediction for position only depends on tokens at positions . Transformers are trained to simultaneously model the conditional distributions for all sequence lengths and thus implicitly to model the joint distribution
We assume is given and does not need to be modelled and . Here is called the maximum context length. The training loss for such language models is usually defined for a sample of contexts which are drawn i.i.d from a large corpus, by
where we write . Here for any sequence and
where denotes the entry in the softmax vector (Phuong & Hutter, 2022) and is the transformer parametrised by weights . Thus the transformer is trained to model the distribution over sequences of length given the distribution over unigrams where we define
Note that then by definition
| (18) |
Of course it is not assumed that is known, but since it does not depend on it does not appear in gradients and so we may ignore it.
Although it is usually stated that transformers do next-token prediction, from a mathematical perspective they just model the distribution of contexts. In particular, given integers with it is just as accurate to describe the training loss of a transformer as
| (19) |
where . That is, we can think of optimising this loss as training the transformer to predict sequences of length given sequences of length for any pair with .
This observation is not an idle one: since the forward pass of the transformer on a token in position produces a latent vector which is used for prediction in all sequence positions it is not surprising that these latent vectors contain information relevant for such prediction Pal et al. (2023); Wu et al. (2024). Indeed Shai et al. (2024) have argued this is optimal based on computational mechanics. This explains why in this paper we consider models which predict given (rather than fixing ) since from a mathematical perspective this is arguably the correct setting for studying transformers as language models.
4 Function Space
4.1 Hilbert space
Definition 4.1.
For we make into Hilbert space where for
| (20) |
Here we use that are functions which we may evaluate on symbols. Recall that we assume for all and .
Definition 4.2.
For let denote the vector space with the inner product
| (21) |
When we sometimes write for .
Remark 4.3.
Given we have
hence the unit vector in the direction of is . Hence the vectors form an orthonormal basis for .
Given a measure space and Hilbert space there is a Hilbert space of square-integrable -valued functions (Reed & Simon, 1980, II.1). In this paper we make into a measure space using and consider the Hilbert space
with pairing for functions in defined by
| (22) | |||
| (23) |
In the case , we take as a Hilbert space with the pairing in (20).
Recall that for a finite set we write
Definition 4.4.
Let denote the subset of functions satisfying
This is the subset of conditional probability distributions.
We note that is a product of probability simplices, and thus a smooth manifold with corners embedded into the affine space viewed as a real manifold. In fact is a statistical manifold in the sense of Amari (2016).
4.2 Converting Between Tensors and Linear Transformations
Since all functions on a finite set are integrable, the underlying set of is just the set of all functions which is in bijection with the vector space of linear transformations . This bijection identifies a function with the linear transformation
| (24) | |||
| (25) |
Note that we used the fact that and are identified with each other via
There is an isomorphism of vector spaces
| (26) | |||
Here if we write for the functional that sends a tensor in to its coefficient in , using the expansion in word basis. While the definition of dual vector makes use of the word basis, the isomorphism (26) nonetheless doesn’t depend on a choice of basis (because appears again in ).
There is no canonical isomorphism between a vector space and its dual. A nondegenerate bilinear form provides such an identification. Using the bilinear forms and we have the isomorphisms of vector spaces
| (27) | ||||
| (28) |
Note that for we have
hence as linear functionals.
Lemma 4.5.
For
Proof.
Lemma 4.6.
The inverse of (28) sends a functional to .
Proof.
It suffices to show . We check it on basis elements
as required.
Lemma 4.7.
The composite isomorphism defined using
| (29) |
is defined on by
Proof.
Lemma 4.8.
The fundamental tensor corresponds under (29) to defined by
| (30) |
Proof.
4.3 Tensor Decomposition
Let . To apply dimensional reduction we start with the fundamental tensor and take the associated linear transformation (Lemma 4.8):
It is natural to apply singular value decomposition (SVD), however, this construction is defined for linear transformations between inner product spaces (Section 2.2) and so we must make a choice of inner product for the domain and codomain. The right and left singular vectors will have different interpretations. The left singular vectors are viewed as elements of the output space of the function space while the right singular vectors are vectors in .
We take the domain to be the inner product space of Definition 4.2 and the codomain to be the inner product space with the dot product (20). That is, we consider and its adjoint
defined uniquely such that for all pairs
| (31) |
The singular value decomposition of with respect to the given inner products on the domain and codomain gives (using the notation of Section 2.2):
-
an index set presented as a disjoint union of subsets ,
-
an orthonormal basis of vectors of , the right singular vectors (orthonormal with respect to the pairing of of ),
-
an orthonormal basis of vectors for the image of in called the left singular vectors (orthonormal with respect to the dot product)
-
singular values with for and for .
These have the property that
By construction
| (32) |
where we interpret as the linear transformation sending to , and . We refer to as the set of modes of .
Definition 4.9.
Let . For we define
| (33) |
which we call the propensity of to follow according to the mode . We adopt the convention that the propensity is zero if . The propensity of a mode is defined to be .
The preceding discussion is summarised by the mode decomposition of the conditional probability:
Lemma 4.10.
For any and ,
Proof.
Note that while these propensities sum to a probability, they do not have a clear interpretation as likelihoods outside of this sum over . This will not cause confusion, because in this paper there are no probabilities that appear conditioned on mode indices, only propensities.
Remark 4.11.
If we define by then
| (35) |
Let denote the adjoint with respect to the dot product on both the domain and codomain, so its matrix is the transpose of the matrix of in the token basis. Then using (31), (35) we have
Hence , so . The singular value decomposition of , viewed as a linear transformation between inner product spaces and , is thus the same as the singular value decomposition of viewed as a linear map from and .
Remark 4.12.
The matrix of is a (column) stochastic matrix since . When the Perron-Frobenius theorem applies to this matrix (noting that we have assumed all probabilities positive) and we can think of this as a Markov chain Seabrook & Wiskott (2023).
4.4 Mode Basis
We make use of the notation established in Section 4.3. Let be given and let , as above. Note that the for may span a proper subspace of . Choose arbitrarily an extension of this to an orthonormal basis for all of where .
Definition 4.13.
Given , we define to be
| (36) |
that is, and so as functions
| (37) |
Hence by (32)
| (38) |
Lemma 4.14.
The vectors form an orthonormal basis of .
Proof.
We compute that
which is by Lemma 4.5 equal to
This shows that the set is orthonormal and thus linearly independent. It is a spanning set since
which completes the proof.
Given a statistical model for and we denote by the corresponding function in
| (39) |
and we write . Pairing an observable like with the function space representation of a probability distribution like gives an expectation in the following sense:
Lemma 4.15.
For any we have
| (40) |
Proof.
We calculate
as claimed.
The modes are modes of variation or “patterns” in the data distribution and we think of as the weighting of in the mode, or more informally, as a measure of the degree to which “follows” the pattern. Note it is immediate from (38) that
| (41) |
4.5 Effective True Distribution
In this section we discuss how to truncate the true distribution using the mode basis. After normalisation we obtain what we refer to as an effective true distribution. Let be fixed and set , and . We have defined above an orthonormal basis for (Lemma 4.14). Suppose that we put a total order on (for example putting the largest singular values first). Then for any we can define
This defines a subspace
Note that this subspace is defined by linear equations in the coordinates of since the are related to these coordinates by a change of basis. We let
denote the orthogonal projection onto this subspace. Recall that denotes the subspace of functions taking values in probability distributions on (Definition 4.4). We define
By construction this is an -flat submanifold in the sense of Amari (2016) since it is cut out by linear equations in the statistical manifold . The true distribution gives a point in (or equivalently does). Hence the following is well-defined:
Definition 4.16.
We define
to be the unique distribution in which minises the KL divergence to the original distribution . We refer to this as the effective true distribution associated to the mode cutoff .
Remark 4.17.
The uniqueness of the is proved in Amari (2009).
Remark 4.18.
There is a more straightforward way to construct a truncation, but it has some subtleties. The truncation of defined by
| (42) |
In the notation of propensities (Lemma 4.10) we have for
| (43) |
Note however that is not necessarily a probability distribution on . Indeed these quantities can be negative. We can remove these negatives and normalise to produce a conditional probability distribution over given by
| (44) |
This has the advantage of being simpler to describe explicitly than but is theoretically less well-justified. We do not consider the distribution further in this paper.
Remark 4.19.
Here we have treated a single pair at a time. But we note that satisfies the language condition (Definition 3.2) which ties the for all to one another. We can define simultaneous truncations of all by a choice of mode cutoff for each since this leads to an -flat submanifold of the statistical manifold of all languages.
5 Examples
The purpose of this section is to briefly argue that the singular values of the SVD of the fundamental tensor, arranged as a linear transformation , is a reasonable notion of “pattern” in sequence models, including tokenised natural language. First we exhibit some simple abstract modes, before giving empirical examples. We note that tensor decompositions are a common technique for representing structure in natural language; see (Anandkumar et al., 2012) and the references therein.
5.1 Theoretical
Definition 5.1.
For , an absolute bigram is a sequence where and with the property that
-
for all with .
-
for all with .
Lemma 5.2.
If is an absolute bigram, then is a right singular vector with corresponding left singular vector and singular value , of .
Proof.
Let be an absolute bigram. Then it follows from the definition of absolute bigrams that . Note that if and only if , and if and only if . Note that by Remark 4.3, is a unit vector in and is a unit vector in which are respectively the domain and codomain (as inner product spaces) of . Then
Hence by Remark 4.11, as claimed in (a).
Remark 5.3.
In the terminology of Definition 4.9, with denoting the mode index corresponding to an absolute bigram , the propensities are and
Lemma 5.4.
If is an absolute bigram with mode index then .
While absolute bigrams may be rare, there is a generalisation which is more common:
Definition 5.5.
A collective bigram is a pair consisting of a nonempty set and satisfying
-
for all .
-
if .
As above we can prove collective bigrams give modes:
Lemma 5.6.
If is a collective bigram then is a right singular vector with corresponding left singular vector and singular value of .
Proof.
5.2 Empirical
For various we collect matrices of empirical conditional probabilities for token sequences in the Pile (Gao et al., 2020), see Appendix B. Note that this is a large sparse matrix, and we do not normalise the columns. Nonetheless the SVD of these matrices is an indication of the kinds of patterns that we can expect to see as right and left singular vectors.
Example 5.7.
For the top singular value is with left singular vector (ordered by absolute value of loading)
| (45) |
and the right singular vector is
where . See Figure 1.
Example 5.8.
For , the seventh top singular value is with left singular vector
| (46) |
and the right singular vector is
where . See Figure 2.
We often observe that the right singular vector has a large number of token sequences with the same largest “loading” (i.e. coefficient in the right singular vector) whereas there is a clear dominating token sequence (and sometimes as in (45) a second) and then a long tail of token sequences with coefficients about an order of magnitude smaller. We can think of these as some perturbation of the collective bigrams of Definition 5.5.
Example 5.9.
For , component has singular value with left singular vector
| (47) |
and the right singular vector is
where . See Figure 3. Closing brackets and other punctuation and structural features are common in the SVD.
Example 5.10.
For , component has singular value with left singular vector
| (48) |
and the right singular vector is
where . See Figure 4.
Example 5.11.
Many modes involve newlines in various combinations with punctuation tokens. For , component has singular value with left singular vector
| (49) |
and the right singular vector is a linear combination of many token sequences. See Figure 5.
For more examples see Appendix C,
Remark 5.12.
In many of these examples we see modes for (such as that in Example 5.11) which are arguably “descended” from modes with or . It would be interesting to develop this idea of hierarchical structure of modes across but we leave that to future work.
6 Mode Insensitivity
We develop two technical hypothesis which express that in a region of parameter space a model is insensitive to the information in higher modes. Consider a parametric model with parameters defining conditional probabilities for and . In this paper we assume is compact and that is continuously differentiable with respect to for all .
We fix and set . We let denote local coordinates at , so that the tangent space is spanned by partial derivatives .
Definition 6.1.
The log probability map is defined by
The Jacobian of at a point is a linear transformation. Since is a (finite-dimensional) affine space we identify it with its tangent map at a given point.
Definition 6.2.
The Jacobian of the log probability map is
which sends each tangent vector to a function representing the corresponding direction of change in log-probabilities:
| (50) |
where we view as a basis vector in .
Any linear transformation from to can be viewed as a -valued cotangent vector and so sometimes we will write the Jacobian of the log probability map simply as
| (51) |
where we assume is given the canonical metric on its tangent space.
The image of characterizes which directions in function space the model can immediately move toward during gradient-based optimisation. If a particular mode in the data distribution lies outside this image, the model will struggle to capture it efficiently during learning.
We think of the conditional distributions of as vectors in as in Section 4.3, and abuse notation by writing for . Given the vector in the pairing with is a linear functional on defined by sending a tangent vector to
| (52) |
using the -norm on the norm of this is the -norm of the vector
Similarly we can pair with
| (53) |
In the following two definitions the model means and implicitly we mean insensitivity to the difference between .
Definition 6.3.
The model is gradient-insensitive for the constant at if
| (54) |
We say this condition hold in some set if it holds at every point.
Definition 6.4.
The model is log-probability-insensitive for the constant at if
| (55) |
We say this condition hold in some set if it holds at every point.
6.1 Motivation for Gradient-Insensitivity
The intuitive content of the gradient-insensitivity condition is quite straightforward, and can be summarised by the phrase “can’t learn”. To say that is small is to say that it is hard to change the model’s log probabilities in directions in the space of predictions of given , which are aligned with the difference between .
For example suppose that is computed by a neural network. This model has a finite capacity to memorize absolute bigrams, so if contains more absolute bigrams than has capacity, and represents truncating the true distribution at some that is past this capacity, it is reasonable to suppose that has no gradient for learning the difference .
More generally we follow Rogers & McClelland (2004) in supposing that before models have learned coarse distinctions between categories it is hard to learn distinctions between finer categories; this hierarchical structure in the data distribution means that is reasonable to suppose the gradient for learning higher modes is small before lower modes are learned.
6.2 Motivation for Log-Probability Insensitivity
The motivation for log-probability-insensitivity is more subtle.
Naively to make small in norm we would have to arrange that is not too large whenever is different from , for example in the case where is obtained by mode truncation, whenever the prediction of from depends non-trivially on higher modes. It is not immediately clear that this is reasonable, and so we need a more careful analysis.
Note that using the basis of and writing for we have
| (56) |
Suppose that is produced by mode truncation as in Section 4.5. Then the idea is that the support of is mostly in the modes . To be more precise, is the closest point of to , and this may be different from the projection which is a vector in but need not be a distribution. However it is reasonable to assume that is not too different from if is large, since both operations should only have a small effect on most sequences.
Notice that for
| (57) |
By Parseval’s identity
and so making this small, which amounts to taking sufficiently large, makes all the terms in (57) simultaneously small. More formally
| (58) |
By Cauchy-Schwartz the first term is bounded by
Let’s suppose this is . To bound the second summand in (58) note that
Now
To give a plausibility argument for bounding this term we now make the assumption that all the ’s are absolute bigrams. Then so
To bound (58) by we need
where is the number of modes . The total number of modes is . Here we make an assumption on our data distribution, namely, that for sufficiently long sequences we have for some entropy rate with high probability (Cover & Thomas, 2006, §3.1). Then since is a sequence of length if the entropy rate is we have . Hence
and so
| (59) |
So to recap, in order to get log-probability-insensitivity for we need to be small enough relative to and in addition it would suffice (if all the modes were absolute bigrams) to have
| (60) |
for all these bigrams. Note that this is trivially true if the model perfectly predicts all the bigrams corresponding to modes since then these log probabilities are zero. However we do not want to rely on this. We would prefer to have (60) be a mild constraint because the right hand side is large, and have most of the pressure of the log-probability-insensitivity be on being small.
Let us substitute some reasonable numbers. If then and we take . Suppose (this is the pessimistic case since it leads to slower decay in probabilities). Then the exponent is . Thus provided
the bound in (60) depends more on than it does on factors to do with the data distribution or . For next-token prediction and modern transformer language models are typically trained with context lengths that are tens or hundreds of thousands of tokens, so this seems reasonable.
7 Modes and LLC estimation
As in Section 4.5 we fix and set , . We consider a parametric model with parameters defining conditional probabilities for and . We assume is compact with coordinates and that is continuously differentiable with respect to for all . In the following denotes a compact set. We assume throughout that is large enough that all SGLD chains lie inside this set.
We consider the effective true distribution associated to truncating at a mode . Associated to the two distributions we have two empirical negative log likelihoods
| (61) | ||||
| (62) |
where and are sampled from the true distribution of sequences of length and the truncated distribution (Definition 4.16), respectively. Their theoretical counterparts are
| (63) | ||||
| (64) |
We first enumerate the hypotheses we require on the model for our main theorem. If is compact then define
for each and which is integrable as and are finite sets. Then the family
of functions on , has a integrable envelope function : for all , , and . Then it follows from Vaart (1998, §19.2) that the family is Glivenko-Cantelli, which, by definition, says that
| (65) |
We further assume that is bounded away from zero for all , , and by a fixed constant. Then it follows that the family
of functions on and is has a constant envelope function: there exists such that for all , , and . Then it follows from Vaart (1998, §19.2) that the family is Glivenko-Cantelli, which, by definition, says that
| (66) |
Lemma 7.1.
Suppose that the model is gradient-insensitive in to the difference between and for some positive constant . Then for any , , there exists a large enough such that
| (67) |
for all .
Proof.
By triangle inequality, we have
So
Since and uniformly as , for and , there exists large enough such that
and
By the hypothesis of gradient-insensitivity we have that
is less than . In particular,
Therefore,
as claimed.
Remark 7.2.
The need to potentially take large in the lemma is a weakness in our technical treatment. The idea of SGLD is that but since we average over many SGLD steps the effect of the mini-batch gradients approaches the effect of Langevin dynamics with .
As above is the length of the SGLD chains, , are the maximum and minimum step-sizes, and are the hyperparameters used for LLC estimation (see Table 1 for a reminder). Recall that is the center of the localization term in the SGLD update; we assume . Let be a SGLD chain contained in with updates given in 12. Let be the same SGLD chain as except that is replaced by . We assume the same random noise is used in both chains for simplicity.
Theorem 7.3.
Suppose that the model is gradient-insensitive in to the difference between and for the constant and that is Lipschitz continuous on with Lipschitz constant for . Provided . Let , , then for large enough
where
-
, where ;
-
.
Proof.
Let be non-negative and . If for
then with given
and, in particular, when is a constant and ,
| (68) |
Set and let be the step-size at time . Let be as in Lemma 7.1 so that
| (69) |
with probability for all . From the update rule