Home › Blog › AGI Researcher Foundations — The Mathematical Foundations
AGI Researcher Foundations · Article 3 of 11 📐

The Mathematical Foundations: What You Actually Use, Versus What's Textbook-Only

Linear algebra, probability, calculus and optimization, and information theory — scoped deliberately: not a full math curriculum, but the specific slice each area contributes to daily research work, with the line drawn explicitly between "you'll use this every week" and "you'll rarely touch this past a lecture."

FL
FrontierAGI Team

Why This Article Draws a Line Instead of Listing a Curriculum

Ask ten AI researchers what math you "need" and you'll get ten overlapping but different answers, usually padded with everything they personally studied in a math or physics degree. That's not useful to someone deciding what to actually spend the next three months on. This article takes a narrower, more falsifiable approach for each of four areas — linear algebra, probability and statistics, calculus and optimization, and information theory — separating what shows up in daily research work (reading papers, writing training code, debugging a run) from what's genuinely textbook-only for most ML practitioners, and citing exactly where each claim comes from.

This isn't a claim that deeper math is useless — for the research-scientist end of the Field Guide's career paths, more theoretical depth compounds over a career. It's a claim about sequencing: the "daily use" slice below is what unblocks Articles 1 and 2 of this series right now: the reproduction, debugging, and paper-reading skills. The rest can be added later, as specific research directions demand it.

4 Math areas covered — linear algebra, probability, calculus/optimization, information theory
Chapters 2–4 Of the free Deep Learning Book (Goodfellow, Bengio, Courville) cover exactly this article's scope
2014 Year the Adam optimizer paper was published — still the default optimizer in most training code today
1948 Year Shannon's original information theory paper introduced entropy — still the basis of every cross-entropy loss function
Part 1 — Linear Algebra

Linear Algebra: Tensors, Rank, and Norms

Every model in this series — from nanoGPT (Article 2) to the frontier-scale systems in the Field Guide — is, mechanically, a sequence of matrix multiplications. Linear algebra isn't a prerequisite you clear once; it's the language the rest of this article is written in.

ConceptDaily Use or Textbook-Only?Where It Actually Shows Up
Vectors & matrices as tensorsDailyEvery tensor in PyTorch/JAX code from Article 1 is this, directly
Matrix multiplication & its costDailyUnderstanding why attention is O(n²) in sequence length, why batching helps GPU utilization
Norms (L1, L2)DailyWeight decay, gradient clipping, regularization terms in nearly every loss function
Eigenvalues & SVD, rankRegularly, not dailyUnderstanding why LoRA (Article 1's Hu et al. paper) works: it assumes weight updates during fine-tuning are low-rank
Formal vector space axioms, full proofs of decompositionsTextbook-onlyRarely needed to read or write ML papers; useful mainly for a pure theory research track
🧮Applied Example — Understanding LoRA's "Low-Rank" Claim
Article 1 cited Hu et al.'s LoRA paper as the standard parameter-efficient fine-tuning method. Its core claim only makes sense with a working notion of matrix rank: instead of updating a full weight matrix during fine-tuning, LoRA approximates the update as a product of two much smaller matrices, exploiting the empirical observation that the needed update has low "intrinsic rank." Without rank as a concept, "low-rank adaptation" is just a name; with it, the paper's entire design decision becomes legible.
The lesson: linear algebra concepts aren't abstract exercises — they're the vocabulary papers use to justify their design choices.
3Blue1Brown — Essence of Linear Algebra MIT 18.06 (Gilbert Strang) fast.ai — Computational Linear Algebra
Part 2 — Probability & Statistics

Probability & Statistics: Distributions, Bayes, and Divergence

Nearly every model discussed in this series outputs a probability distribution, not a single answer — an LLM's next-token prediction is a distribution over the vocabulary, sampled from at generation time. Probability is how you reason about what a model is actually doing, not just what it outputs.

ConceptDaily Use or Textbook-Only?Where It Actually Shows Up
Distributions (Gaussian, categorical/softmax)DailyWeight initialization, the softmax output layer of every classifier and LLM
Expectation & varianceDailyLoss functions are expectations over a data distribution; variance shows up in gradient noise, batch size tradeoffs
KL divergence, cross-entropyDailyThe standard training loss for classifiers and language models; the theoretical basis of RLHF's KL penalty term
Bayes' rule (intuition-level)Regularly, not dailyReasoning about uncertainty, priors in Bayesian-flavored papers — useful as intuition even outside formal Bayesian ML
Measure theory, most classical hypothesis testingTextbook-onlyRarely required to read or implement mainstream deep learning papers
🔍Applied Example — Recognizing Cross-Entropy as KL Divergence in Disguise
Nearly every classification or language-modeling loss function is labeled "cross-entropy loss" in code, but understanding why that's the right loss to minimize requires probability: cross-entropy between the true distribution and the model's predicted distribution equals the true distribution's entropy plus the KL divergence between the two — and since the true distribution's entropy is fixed, minimizing cross-entropy is exactly minimizing KL divergence, i.e., making the model's predicted distribution match reality as closely as possible. This is the same KL divergence term that appears in the RLHF papers cited in Article 1, used there to keep a fine-tuned policy from drifting too far from its starting point.
The lesson: the same handful of probability concepts (here, KL divergence) reappear across supervised learning, language modeling, and RLHF — learn them once, recognize them everywhere.
Harvard Stat 110 (Joe Blitzstein) Deep Learning Book — Ch. 3 (Probability)
Part 3 — Calculus & Optimization

Calculus & Optimization: Gradients, the Chain Rule, and Why Training Works at All

Article 2's first self-assessment item asked whether you can implement a training loop's forward pass, loss, backward pass, and optimizer step without copying a tutorial. Calculus is the "why" underneath that "how" — specifically, the chain rule is the entire mathematical justification for backpropagation.

ConceptDaily Use or Textbook-Only?Where It Actually Shows Up
Gradients & the chain ruleDailyThe entire mechanism behind loss.backward() in Article 2's training-loop skill
SGD / Adam mechanicsDailyNearly every training run in this series uses one of these two optimizer families
Convexity (intuition-level)Regularly, not dailyUnderstanding why loss landscapes are hard (non-convex) and why that's normal, not a bug
Learning rate schedules (warmup, decay)DailyPresent in essentially every training script and paper's hyperparameter table
Full convex optimization theory, second-order methods (e.g. full Newton's method at scale)Textbook-onlyRarely used directly in large-scale deep learning; first-order methods (SGD/Adam variants) dominate in practice
💥Applied Example — Diagnosing a NaN Loss
A training loss suddenly turning to NaN is one of the most common real debugging scenarios tied directly to Article 2's training-loop skill — and diagnosing it requires calculus intuition, not just code-reading. The usual cause is exploding gradients: through repeated application of the chain rule across many layers, small per-layer gradient magnitudes multiply into enormous ones, especially in deep or poorly-initialized networks. The standard fixes — gradient clipping (a linear-algebra norm operation, tying back to Part 1) and lower learning rates — only make sense once you understand gradients are the thing being clipped and scaled in the first place.
The lesson: "my loss went to NaN" is not a mysterious bug — it's the chain rule doing exactly what it's supposed to do, on a landscape that wasn't set up to handle it.
3Blue1Brown — Essence of Calculus Kingma & Ba — Adam paper (arXiv:1412.6980)
Part 4 — Information Theory

Information Theory: Entropy, Perplexity, and Why LLMs Are Measured This Way

Information theory is the smallest of the four areas in daily surface area, but it directly explains one number that appears constantly in this series' coverage of language models: perplexity.

ConceptDaily Use or Textbook-Only?Where It Actually Shows Up
Entropy, cross-entropyDailyDirectly the loss function used to train nearly every LLM in this series
PerplexityRegularly, not dailyA standard reported metric in papers — literally 2 raised to the cross-entropy (in bits), i.e., a re-expression of the training loss as an interpretable number
KL / JS divergenceRegularly, not dailyAlready covered under probability above — the same concept, viewed through an information-theoretic lens
Channel capacity, coding theory proofsTextbook-onlyFoundational to the field of information theory itself, but rarely touched in mainstream deep learning research

The field traces to a single source: Claude Shannon's 1948 paper "A Mathematical Theory of Communication", which introduced entropy as a measure of information content. Every cross-entropy loss function used across this entire series traces its name, and its mathematical justification, directly back to that paper.

Perplexity isn't a separate metric from the training loss — it's the same cross-entropy loss, re-expressed in a scale that's easier for humans to compare across papers. Once you see that, "the model achieved a perplexity of 12.3" stops being an opaque number.
Part 5 — Papers & Courses

Key Papers & Resources

Unlike Article 1's key-papers list, most of the foundational sources here are textbooks and classic papers rather than recent arXiv preprints — the math underneath deep learning has moved far more slowly than the architectures built on top of it.

SourceWhy It's FoundationalLink
Shannon — A Mathematical Theory of Communication (1948)Introduces entropy; the direct ancestor of every cross-entropy loss function in this seriesPDF
Kingma & Ba — Adam: A Method for Stochastic Optimization (2014)The optimizer used by default across the vast majority of training code referenced throughout this seriesarXiv:1412.6980
Goodfellow, Bengio & Courville — Deep Learning (2016)Free online textbook; Chapters 2–4 map almost exactly onto this article's four sectionsdeeplearningbook.org
Hu et al. — LoRA (2021, previously cited in Article 1)The applied linear-algebra example used in Part 1 of this articlearXiv:2106.09685

Courses to Complete

Part 6 — Self-Assessment

Self-Assessment Checklist

1
Can you explain why matrix multiplication order matters (i.e., why AB ≠ BA in general) and why that's relevant to how layers compose in a neural network?
2
Can you explain, without looking it up, why cross-entropy loss and KL divergence minimization are the same thing?
3
Have you derived the gradient of a simple function (like a 2-layer network's loss with respect to its weights) by hand, using the chain rule, at least once?
4
Do you know why Adam is generally preferred over vanilla SGD for training transformers, at least at an intuitive level (adaptive per-parameter learning rates, momentum)?
5
Can you explain what "low-rank" means in LoRA to someone who knows what a matrix is but not what rank means?
6
Do you know why a reported perplexity number is just a re-expression of cross-entropy loss, rather than an unrelated metric?
This checklist is deliberately shorter than Article 2's — math foundations are meant to be internalized once and reused constantly, not maintained as an ever-growing list of separate skills.

⚠️ What's Missing or Scoped Out of This Article

This article is deliberately narrow, not exhaustive. It does not cover measure-theoretic probability, formal convex optimization theory, differential geometry (relevant to some advanced optimization research), or abstract algebra — all of which have legitimate research applications but fall outside the "daily use for a starting researcher" scope this article set out to cover. If a specific research direction later in this series (e.g., a future geometry-heavy interpretability topic) requires one of these, that will be flagged explicitly in that article rather than assumed here.

Where This Series Goes Next

Article 4 moves from mathematical foundations to core deep learning concepts built directly on top of them — architectures beyond the Transformer, normalization techniques, initialization schemes, and the practical training dynamics (loss landscapes, generalization gaps) that connect back to the calculus and optimization concepts in Part 3 of this article. From there, the series continues through generalization and learning theory, RL foundations, interpretability, alignment, world models, systems, and research methodology, before a capstone article ties everything back into one unified map.

🎥 Recommended Videos

🧭 Closing — Four Areas, Used Constantly, Never Requiring a Math Degree

🎯 The Bottom Line
Every "daily use" concept in this article — matrix operations, cross-entropy and KL divergence, gradients and the chain rule, entropy and perplexity — is covered by freely available courses and a single free textbook (Goodfellow, Bengio & Courville). None of it requires a math degree; all of it requires actually doing the applied examples in this article, not just recognizing the terms. The line this article drew between daily-use and textbook-only isn't a claim that deeper math never helps — it's a sequencing claim: internalize this slice first, since it directly unblocks the reproduction and debugging skills from Articles 1 and 2, and go deeper into specific areas only when a specific research direction actually demands it.