Relearning Mathematics: Three Languages for Reading AI
Prerequisite:LLMs and Programming: The Break-Even Point of Delegation and How to Spot Plausible Errors
0. Key points
Section titled “0. Key points”- The inside of an LLM can be described almost completely in three languages: linear algebra (embeddings, attention, low-rank approximation), calculus (gradients, the chain rule, optimisation) and probability and statistics (likelihood, cross-entropy, Bayesian updating). These three are the common language.
- The point of relearning mathematics is not to build models of your own. It is to predict behaviour, explain failures and design experiments. The learning rate was raised and training diverged; every pair of embeddings has similarity around ; the detector reports 99% accuracy and the operators say almost every alert is false. All of these can be explained by formulas, and estimated in advance.
- In high dimensions, two unrelated directions are almost orthogonal (Proposition 3.2, Corollary 3.5). “Why can billions of concepts be packed into a vector of a few thousand dimensions?” is a consequence of this fact.
- Whether gradient descent converges is decided almost entirely by the relation between the learning rate and the smoothness constant of the function (Lemma 4.2, Example 4.4). Tuning hyperparameters is not guesswork; it is a search around this inequality.
- The cross-entropy that training minimises is the same thing as the KL divergence being minimised (Proposition 5.2). The reading of perplexity as “the effective number of choices” also falls out of that formula.
- As a by-product of studying mathematics one acquires fluency with quantifiers (telling from ) and the habit of constructing counterexamples. Both transfer directly to writing specifications, analysing incidents and designing evaluations.
1. Motivation: why “being able to use it” is not enough
Section titled “1. Motivation: why “being able to use it” is not enough”As we saw in the previous chapter, LLMs and Programming, a substantial part of the work of writing code can already be handed over to a model. The condition under which handing it over pays off was formulated in when delegation pays(Proposition 3.1)[LLMs and Programming]. Call the API, shape the prompt, inspect the output. Within that range almost no mathematics is needed, and there are many situations in which that is quite enough to deliver results.
The trouble starts when things do not work.
- You build search over internal documents with embedding vectors, and the same document comes out on top for every query.
- You try fine-tuning, and the loss becomes
NaNwithin a few steps. - The anomaly detection model is reported at 99% accuracy, yet the operators say “nine out of ten alerts are false”.
- The evaluation set improves while production gets worse.
None of these is a problem of how the tool is used. Each has its own mathematical cause: the geometry of the space, the dynamics of optimisation, the rule for updating probabilities. If you do not know the name of the cause, the only remedy left is to vary parameters and pray. If you do know the name, isolating the cause can take a single formula. Should the learning rate be halved, should more data be collected, or is the metric itself wrong? You gain grounds on which to decide.
Historically, this pattern is nothing new. Nineteenth-century engineers built steam engines without thermodynamics. Improving efficiency meant relying on experience and intuition, and progress came by trial and error. Only once Carnot and Clausius had formulated the second law could one say “this engine has a theoretical upper bound on its efficiency” and “that bound depends only on a ratio of temperatures”. Being able to build something and being able to state its limits are different abilities.
Those of us now working with LLMs resemble engineers who can build a steam engine but have no thermodynamics. Fortunately, the “thermodynamics” of AI already exists, and most of it is first- and second-year university mathematics. There is no new mathematics to invent; it suffices to recover what many people once learned and forgot. In this chapter we set out the contents of those three languages in a form you can work through by hand.
2. A map of the three languages
Section titled “2. A map of the three languages”Let us first fix the overall picture. The path from a piece of text to an update of the parameters decomposes as in the following diagram, with the corresponding branch of mathematics attached to each stage.
flowchart TB A["Text"] --> B["Token sequence"] B --> C["Embedding vectors: linear algebra"] C --> D["Attention = inner products and matrix products: linear algebra"] D --> E["Next-token probability distribution: probability"] E --> F["Cross-entropy loss: probability"] F --> G["Gradients, chain rule, backpropagation: calculus"] G --> H["Parameter update = optimisation"] H --> C
The roles of the three fields can be separated in one line each.
| Field | What it handles | How it appears in an LLM |
|---|---|---|
| Linear algebra | Represents “meaning” as coordinates and transforms it | Embeddings, attention, low-rank approximation (LoRA), dimensionality reduction |
| Calculus | Measures “how things change under a small perturbation” | Gradients, chain rule, backpropagation, learning rate, convergence and divergence |
| Probability and statistics | Measures “plausibility” and “confidence” | Cross-entropy, perplexity, temperature, evaluation metrics, Bayesian updating |
We now take them in turn. Theorems are stated in full, proofs fill in the gaps, and wherever the computation can be done by hand we carry the numbers to the end.
3. Linear algebra: putting meaning on coordinates
Section titled “3. Linear algebra: putting meaning on coordinates”3.1. How an inner product becomes “closeness of meaning”
Section titled “3.1. How an inner product becomes “closeness of meaning””An embedding is a map sending words or documents to real vectors in dimensions. The reason this is useful is that the inner product between vectors serves as a proxy for closeness of meaning.
Definition 3.1(Inner product and cosine similarity)
For , define the inner product by and the norm by . When and , the quantity
is called the cosine similarity. By the Cauchy–Schwarz inequality, .
What attention computes is, in essence, this same inner product. One lines up the inner products of a query vector with each key vector , divides by and passes the result through a softmax. In other words, “which token to attend to” has been reduced to a computation of angles in -dimensional space.
3.2. In high dimensions, unrelated things are almost orthogonal
Section titled “3.2. In high dimensions, unrelated things are almost orthogonal”A naive question arises here. Dimensions such as or are far smaller than the number of human words and concepts, which runs from hundreds of thousands to tens of millions. Why can so many concepts be packed into so few dimensions without blurring into one another?
The answer lies in the geometry of high-dimensional space. In one can find only six directions pairwise at least 60 degrees apart, but in the situation is transformed.
Proposition 3.2(Inner product of two random directions)
Let . Let be independent random vectors distributed uniformly on the unit sphere . Then
holds.
Proof(Proposition 3.2)
The uniform distribution on the sphere is rotation invariant: for any orthogonal matrix , the vector has the same distribution as . Since and are independent, condition on and hold it fixed; taking an orthogonal matrix carrying to the first coordinate axis , the quantities and have the same distribution. Hence is distributed like the first component of a uniformly random unit vector on the sphere.
For the mean: and have the same distribution (because is orthogonal), so and have the same distribution; the expectation exists since is bounded, and therefore .
For the variance: from we get with probability 1. Taking expectations on both sides gives . Permuting coordinates is also an orthogonal transformation, so , whence . As the mean is , the variance is as well.
The standard deviation is . For this is about : the cosine similarity of two unrelated vectors is typically no larger than about . Moreover this concentration has Gaussian tails.
Theorem 3.3(Concentration of measure on the sphere)
Let and let be a random vector distributed uniformly on . For every ,
holds.
Theorem 3.3 is exactly an area estimate for a spherical cap. An elementary proof can be found in K. Ball’s lecture notes An Elementary Introduction to Modern Convex Geometry (Lemma 2.2). For a treatment inside the more general framework of concentration of measure, see Chapter 3 of Vershynin, High-Dimensional Probability. Here we simply use the result.
Corollary 3.5(How many almost orthogonal directions fit)
Let and . If satisfies
then there exist unit vectors in with for all .
Proof(Corollary 3.5)
Choose independently from the uniform distribution on . For a fixed pair , the inner product is distributed like , as we saw in the proof of Proposition 3.2, so Theorem 3.3 gives
The probability of the event “some pair reaches or more” is, by the union bound, at most
The hypothesis gives , so this upper bound is less than . Therefore the event ” for every pair” has positive probability, and at least one such configuration exists. Since the vectors are unit vectors, the cosine similarity is the inner product itself.
Example 3.6(How many concept axes fit into 1024 dimensions)
Substituting into Corollary 3.5 and varying the threshold :
- : , so about 12 directions.
- : , about 28 thousand.
- : , about 10 billion.
Merely allowing the loose criterion “cosine similarity below counts as effectively unrelated” already lets 10 billion directions coexist in 1024 dimensions. This is why embeddings of a comparatively modest dimension can hold an enormous number of concepts.
At the same time this computation is a practical warning. Because enters the exponent squared, the count drops precipitously as is tightened. A fixed threshold such as “similarity above 0.8 means the document is relevant” therefore depends strongly on the dimension and on the data distribution, and does not transfer as it stands. Set thresholds only after looking at the actual distribution, that is, a histogram of cosine similarities over unrelated pairs.
3.3. Low-rank approximation: shrinking without discarding information
Section titled “3.3. Low-rank approximation: shrinking without discarding information”Here is a second theorem with immediate practical consequences: the best-approximation theorem based on the singular value decomposition (SVD).
Theorem 3.7(Eckart–Young–Mirsky theorem (Frobenius norm version))
Let have rank , with singular value decomposition
where and are orthonormal systems. For an integer with , put . Then for every matrix of rank at most ,
holds, where is the Frobenius norm.
A proof can be found in Chapter 2 of Golub & Van Loan, Matrix Computations, or Chapter 7 of Strang, Introduction to Linear Algebra. The original paper is C. Eckart and G. Young, “The approximation of one matrix by another of lower rank”, Psychometrika 1 (1936), 211–218. In this article we concentrate on how the result is used.
What the theorem says is that the naive operation of “keep the largest singular values and truncate the rest” is in fact optimal among all matrices of rank at most . The approximation error is measured exactly by the square root of the sum of squares of the discarded singular values. Dimensionality reduction, recommender systems, denoising and parameter-efficient fine-tuning via LoRA are all applications of this single fact.
Example 3.9(Computing the best rank-1 approximation of a 3×2 matrix by hand)
We find its best rank-1 approximation. First,
(the top-left entry is , and the off-diagonal entry is ). The characteristic equation gives eigenvalues , with corresponding eigenvectors and . Hence the singular values are and .
The left singular vector is obtained from :
Therefore
Let us check the error:
Just as Theorem 3.7 asserts, the error equals the discarded singular value . Moreover , so rank 1 retains of the total “energy”.
LoRA freezes a weight matrix and restricts the update alone to the rank- form with and . Taking and , ordinary full-parameter updating handles values, whereas LoRA needs only . The ratio is . The premise that makes the method work is the hypothesis that the update required for fine-tuning is essentially low rank, and the yardstick for judging that hypothesis is the error estimate of Theorem 3.7. Details are in the original paper of Hu et al. (2021).
4. Calculus: learning is walking downhill
Section titled “4. Calculus: learning is walking downhill”4.1. Smoothness and the descent lemma
Section titled “4.1. Smoothness and the descent lemma”Learning means searching for parameters that make a loss function small. The most basic method is gradient descent, , of which the SGD and Adam used in practice are variants. The question “what should the learning rate be?” is quantified by the following definition.
Definition 4.1(L-smoothness)
Let be differentiable. If there is a constant such that for all
holds, then is said to be -smooth (its gradient is -Lipschitz).
Here is an upper bound on “how abruptly the gradient can change”. If is twice differentiable, corresponds to an upper bound on the absolute values of the eigenvalues of the Hessian.
Lemma 4.2(Descent lemma and the decrease in one step)
Let be differentiable and -smooth. Then for all ,
holds. In particular, setting gives
Consequently, if and then , and at the coefficient of the decrease on the right-hand side attains its maximum value .
Proof(Lemma 4.2)
Put . Then is differentiable on and, by the chain rule, . By the fundamental theorem of calculus,
Subtracting from both sides,
Apply the Cauchy–Schwarz inequality to the integrand, then the -smoothness of Definition 4.1 to the pair and , whose distance is :
This proves the first inequality.
Next substitute . Since and , we get
The coefficient is a quadratic in with . Moreover gives the maximum at , where .
The condition is the true identity of the phenomenon known in practice as “raise the learning rate too far and everything breaks”. The threshold is determined by the curvature of the function, so it shifts whenever the model or the data changes.
4.2. Rate of convergence in the convex case
Section titled “4.2. Rate of convergence in the convex case”Merely decreasing is not enough. The next theorem tells us how fast we approach the minimum.
Theorem 4.3(Convergence of gradient descent (convex, L-smooth case))
Let be a differentiable convex function that is -smooth, and suppose there is a point attaining the minimum value . Define with learning rate . Then for every ,
holds.
Proof(Theorem 4.3)
Write .
Step 1 (decrease in one step). Putting in Lemma 4.2 gives
In particular the sequence is monotonically non-increasing: .
Step 2 (convexity). Since is convex and differentiable, its tangent planes support it from below. Substituting ,
Step 3 (combining the two). Applying Step 2 to the term on the right-hand side of Step 1,
Step 4 (turning it into a telescoping sum). Using , expand the difference of distances:
Multiplying both sides by , the right-hand side is exactly the right-hand side of Step 3. That is,
Step 5 (summing, and monotonicity). Summing over , the right-hand side telescopes and
By the monotonicity of Step 1, each term on the left is at least the final term . Hence the left-hand side is , and dividing by gives the claim.
The conclusion that the error decreases as is worth remembering, because it says that reducing the error by a factor of ten requires ten times as many iterations. In this regime, “just train a bit longer and it will suddenly get better” does not happen. To improve matters you must change the conditioning of the problem (preconditioning, normalisation, momentum) rather than the iteration count.
Example 4.4(Checking the learning-rate threshold on a one-dimensional quadratic)
Consider with . Since we have , so this is -smooth with (Definition 4.1). Gradient descent reads
so . Now , which agrees with the condition in Lemma 4.2.
Concretely, take (so and the threshold is ) and :
- : for (the minimum is reached in one step).
- : ; after 10 steps .
- : ; the sign flips each step and . Slow, but convergent.
- : ; and . Divergent.
For the loss grows exponentially, so in finite-precision arithmetic it eventually becomes inf, and NaN propagates from there. Most incidents of the form “the loss became NaN right after training started” are explained by this simple piece of dynamics. The first remedy is to lower the learning rate; the second is gradient clipping, which caps the effective value of .
4.3. The chain rule becomes backpropagation
Section titled “4.3. The chain rule becomes backpropagation”The other pillar is the chain rule. The derivative of a composite is a product of Jacobian matrices,
Whether this product is evaluated from the right or from the left makes a large difference to the amount of computation required. Since the loss is a scalar, multiplying from the output side (the left) keeps every operation a “row vector times matrix” product. That is backpropagation, and it is why the cost of computing gradients stays within a constant factor of one forward pass even when there are hundreds of millions of parameters.
Viewing the derivative as a product of Jacobians also leads directly to an understanding of vanishing and exploding gradients. If the singular values of each layer’s are on average below 1, the product decays exponentially to 0; if above 1, it blows up exponentially. Residual connections (, with Jacobian ) and normalisation layers can be read as devices for keeping this product near 1.
5. Probability and statistics: measuring plausibility and confidence
Section titled “5. Probability and statistics: measuring plausibility and confidence”5.1. What cross-entropy measures
Section titled “5.1. What cross-entropy measures”The output of an LLM is a probability distribution over the next token. What training minimises is the cross-entropy against the target distribution.
Definition 5.1(Cross-entropy and KL divergence)
For probability distributions and on a finite set , the quantities
are called the entropy, the cross-entropy and the KL divergence respectively. Terms with are taken to be , and if while we set . Logarithms are to base (units: nats). Directly from the definitions, .
Proposition 5.2(Gibbs' inequality)
With the notation above, . Equality holds if and only if for every with . In particular .
Proof(Proposition 5.2)
If there is an with and then , so assume from now on that . Put .
We use the inequality for . (This follows because has , hence attains its minimum at ; equality holds only at .) Setting ,
The last inequality uses together with . Hence .
Now examine equality. It requires both inequalities to be equalities simultaneously. The first is an equality precisely when for each , the second precisely when . The former yields on ; conversely, if that holds then , so the latter is automatic and . Finally, the identity from Definition 5.1 gives .
In practice this proposition means the following: minimising the cross-entropy is the same as minimising the KL divergence. Since is a constant determined by the data, the only part training can move is . The attainable loss therefore has a lower bound , which is the intrinsic ambiguity of the data itself, namely the fact that the same context admits several continuations. When the loss refuses to fall further, this gives a way to tell whether the model lacks capacity or the data is intrinsically ambiguous.
Example 5.3(Computing perplexity by hand)
Perplexity is , the exponential of the average cross-entropy. Suppose the model assigns probabilities to four tokens. Then
The sum is and the average is nats, so .
This reads as “hesitating among roughly 6.3 options each time”. Indeed, for a uniform distribution over a vocabulary of items we always have , so : perplexity is a measure of the effective number of choices. The meaning of a drop of in the loss can be translated the same way: since , the effective number of choices has fallen by about 10%.
5.2. Bayes’ theorem: when 99% accuracy is useless
Section titled “5.2. Bayes’ theorem: when 99% accuracy is useless”One further tool is indispensable when evaluating AI systems: the Bayesian update rule.
Example 5.4(How trustworthy is an alert from a model with 99% detection and 1% false-alarm rate)
Consider a model for detecting fraudulent transactions. Let the prior probability (the fraction that really are fraudulent) be , the detection rate (the probability of correctly alerting on fraud) , and the false-alarm rate (the probability of wrongly alerting on a legitimate transaction) . When an alert fires, what is the probability that it really is fraud?
By Bayes’ theorem,
The numerator is and the second term of the denominator is , so
That is about 9%: one alert in eleven is genuine. The operators’ impression that “nine out of ten are false” is correct, and the report of “99% accuracy” is also correct (in a different sense). The two disagree because the prior of dominates.
The formula also tells us where to improve. The denominator is dominated by the term , so raising the detection rate from to changes almost nothing (it reaches only ). What matters is the false-alarm rate: lowering to gives , about 50%. Which number to improve is settled by this computation alone. A comparison of the same shape, carried out in the context of delegating work to an LLM, is which to improve: false positive rate or success rate(Example 7.3)[LLMs and Programming].
6. Abstraction and logic: the order of quantifiers decides the specification
Section titled “6. Abstraction and logic: the order of quantifiers decides the specification”So far we have discussed “mathematics for understanding AI”. But the benefit of relearning mathematics is not only its content. Training in stating claims precisely is itself the ability to write specifications and analyse incidents. (The view that stating a specification necessarily carries an irreducible amount of information is summarised in a lower bound on specification length(Proposition 6.2)[A Survival Strategy for Software Engineers in the AI Era].)
The training with the greatest practical payoff is attending to the order of quantifiers, (“for all”) and (“there exists”). Compare the following two definitions.
Definition 6.1(Continuity and uniform continuity)
Let be an interval and .
We say is continuous on if
holds.
We say is uniformly continuous on if
holds.
The two formulas differ only in the order of and . For continuity, may be chosen afresh for each ; for uniform continuity, a single must work independently of . The difference is essential.
Example 6.2(A continuous function that is not uniformly continuous)
Take and . Then is continuous on , since the denominator never vanishes at any point . It is not uniformly continuous, however.
Here is the proof. Put . For an arbitrary , choose a natural number large enough that (possible since ), and set and . Then
whereas
Thus “for , whatever is chosen there is a counterexample pair”, and the definition of uniform continuity fails. Because the slope grows steeper as one approaches the origin, cannot be respected unless is allowed to depend on .
This structure appears verbatim in system specifications.
- “For every request there is some server that responds within 200ms” — the responding server may differ from request to request.
- “There is some server that responds to every request within 200ms” — a single server can carry the entire load.
The second is a far stronger claim than the first. SLAs, permission design (“every user is assigned some role” versus “some role is assigned to every user”), retry design: there is no end to the places where mistaking the order of quantifiers breaks the design. Natural language has loose word order and can express both with the same sentence. That is exactly why the habit of rewriting into logical formulas and checking pays off.
The other thing mathematics trains is the habit of constructing counterexamples. What we did in Example 6.2 was to exhibit concretely what breaks when one hypothesis is dropped. That exercise has the same shape as designing evaluations for AI systems. Against the claim “this prompt works”, search systematically for counterexamples, that is, inputs on which it fails: boundary values, empty input, extremely long input, unexpected languages. For LLM outputs, this search for counterexamples is exactly the detection of plausible errors(Definition 7.1)[LLMs and Programming]. The habit of doubting a claim and building the smallest counterexample, acquired through mathematical exercises, is test case design.
7. What to relearn, and in what order
Section titled “7. What to relearn, and in what order”Finally, a realistic path for practitioners. The goal is not to read a textbook cover to cover, but to be able to carry out computations like the ones above on your own.
| Order | Field | Minimum target | Question that confirms you are there |
|---|---|---|---|
| 1 | Linear algebra | Compute matrix products, norms, inner products, eigenvalues and the SVD | Can you solve Example 3.9 without looking? |
| 2 | Probability and statistics | Conditional probability, Bayes’ theorem, expectation and variance, likelihood | Can you derive the improvement strategy of Example 5.4 yourself? |
| 3 | Calculus | Partial derivatives, gradients, the chain rule, Taylor expansion to second order | Can you explain where the of Lemma 4.2 comes from? |
| 4 | Logic and set theory | Order of quantifiers, forming negations, constructing counterexamples | Can you explain to someone the difference between the two formulas in Definition 6.1? |
The order has reasons. Linear algebra comes first because it carries the largest number of applications you can use today: embeddings, attention, low-rank approximation. Probability comes second because it bears directly on evaluation and decision-making, and because misunderstandings there are expensive, as Example 5.4 shows. Calculus becomes necessary once you step inside training. Logic is placed last, though in truth it is at work from the beginning.
One judgement about how to study. It is better to set aside time for computing by hand, not only for reading proofs. Fifteen minutes decomposing the matrix of Example 3.9 on paper will stay with you longer than reading ten expositions of the SVD. NumPy is convenient for checking the numbers.
import numpy as np
A = np.array([[1.0, 1.0], [1.0, 1.0], [1.0, -1.0]])
U, s, Vt = np.linalg.svd(A, full_matrices=False)print(s) # [2. 1.41421356]
A1 = s[0] * np.outer(U[:, 0], Vt[0, :])print(np.round(A1, 6)) # [[1. 1.] [1. 1.] [0. 0.]]print(np.linalg.norm(A - A1)) # 1.4142135623730951 = sigma_2This agrees with the hand computation. The round trip of “solve by hand, then verify with code” is what makes the material stick.
The overall strategy for continuing to add value in the age of AI is set out in A Survival Strategy for Software Engineers in the AI Era. Where automation hits a ceiling, and what that ceiling is, is given by the limit of automation(Corollary 3.2)[A Survival Strategy for Software Engineers in the AI Era]. Mathematics is one pillar within it. Think of it as an investment made not in order to become a person who builds models, but in order to stand on the side that doubts, explains and controls what the models produce.
8. Exercises
Section titled “8. Exercises”Exercise 8.1Easy
For two vectors chosen independently and uniformly from the unit sphere in dimensions, find the standard deviation of the cosine similarity. Then use Chebyshev’s inequality to bound from above, and compare with the bound obtained from Theorem 3.3.
Solution
Since the vectors are unit vectors, the cosine similarity is the inner product itself. By Proposition 3.2 the variance is , so the standard deviation is .
Chebyshev’s inequality states that for a random variable with mean and variance one has . Substituting ,
On the other hand Theorem 3.3 gives
The exponential estimate is roughly three times stronger. The gap widens as grows: at the former gives while the latter gives . Chebyshev uses only the variance and so cannot capture high-dimensional concentration.
Exercise 8.2Standard
Apply gradient descent with learning rate to with . (1) Express the condition for convergence in terms of and . (2) For and , find . (3) Describe what happens when and .
Solution
(1) The computation is the same as in Example 4.4. Since we get and hence . For , the condition is , that is, . As is -smooth with , this agrees with the condition of Lemma 4.2.
(2) Here , so
Since , the loss shrinks by a factor of .
(3) Here , so . The step sits exactly on the boundary , so the point oscillates forever between and and the loss never decreases (nor does it diverge). Computing the coefficient of the decrease in Lemma 4.2 gives , consistent with the lemma guaranteeing a decrease of . In practice this is worth remembering as a candidate cause when the loss stops falling and oscillates around a constant value.
Exercise 8.3Standard
A model has validation loss (average cross-entropy, in nats) equal to . (1) Find the perplexity. (2) Find the perplexity and loss of a uniform model over a vocabulary of tokens, and compare with (1). (3) When the loss improves from to , by what percentage does the perplexity fall?
Solution
(1) : effectively, hesitating among about 7.4 options.
(2) For the uniform distribution each token has probability , so the loss is . Now nats, and the perplexity is . In the notation of Definition 5.1, this is with taken to be uniform. The trained model has narrowed options down to an effective .
(3) The ratio of perplexities is , a decrease of about . Looking only at the difference in losses it appears to be “a 5% improvement”, but in perplexity it is about 9.5%. Remember it as: for an absolute loss difference , the perplexity is multiplied by .
Exercise 8.4Hard
On let and . (1) Compute and and confirm that the KL divergence is not symmetric. (2) Discuss, for the case of minimising , whether this asymmetry corresponds to “averaging the modes” or to “picking a single mode” in the training of a generative model.
Solution
(1) Following Definition 5.1,
Since , it is not symmetric. That both are positive is consistent with Proposition 5.2.
(2) Consider minimising over . If is large while is extremely small, then is large and the penalty is heavy. Conversely, at points where the term is no matter how large is, so there is no penalty. Minimising therefore pushes to cover every place where puts positive probability. This is mode-averaging: if has two well-separated peaks, ends up assigning probability to the region between them as well.
Ordinary language model training minimises the cross-entropy , and as we saw in Proposition 5.2 we have , so this is the same as minimising . The tendency of trained models to return safe, average outputs owes something to this asymmetry of the objective. Minimising the reverse divergence instead makes concentrate on one of the peaks of , that is, produces mode-seeking behaviour.
References
Section titled “References”- G. Strang, Introduction to Linear Algebra, 5th ed., Wellesley-Cambridge Press, 2016 — Chapter 7 (singular value decomposition and low-rank approximation).
- G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed., Johns Hopkins University Press, 2013 — Chapter 2 (matrix norms and best low-rank approximation).
- S. Boyd and L. Vandenberghe, Convex Optimization, Cambridge University Press, 2004 — Chapter 9 (unconstrained minimisation and descent methods). The full text is available on the authors’ site: https://web.stanford.edu/~boyd/cvxbook/
- T. M. Cover and J. A. Thomas, Elements of Information Theory, 2nd ed., Wiley, 2006 — Chapter 2 (entropy, relative entropy and mutual information).
- R. Vershynin, High-Dimensional Probability: An Introduction with Applications in Data Science, Cambridge University Press, 2018 — Chapter 3 (concentration of measure on the sphere and in high-dimensional distributions).
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016 — Chapters 2–4 (foundations of linear algebra, probability and numerical computation). Online edition: https://www.deeplearningbook.org/
- E. J. Hu et al., “LoRA: Low-Rank Adaptation of Large Language Models”, arXiv:2106.09685 (2021). https://arxiv.org/abs/2106.09685
Report an error in this article ・Operated by: Mugen Giken LLC ・Pricing ・Terms ・Legal notice
© 2026 夢現技研合同会社 ・Feeding the text to an LLM is welcome. Code samples are MIT licensed.