Skip to content

A treatise · fifteen chapters · twelve laboratories · 35 sources

Irreducible

The mathematics of the autoregressive Transformer

A complete, notation-stable treatise on building, training, and running an LLM: tokens, residual stream, attention, SwiGLU, cross-entropy, Jacobians, AdamW, and inference. Every symbol defined where it is used. Loss is driven toward zero. It never arrives.

The object

An LLM is a function . Training drives the next-token cross-entropy toward zero. On open language it cannot arrive. The floor is the entropy of the data, not a failure of the optimizer.

x₁:Ttokens
H⁽⁰⁾embed + RoPE
H⁽ⁿ⁾n blocks
Zlogits
p₁:Tsoftmax

Forward map. Training attaches CE → Jacobians → AdamW after p. Inference samples from p.

Treatise

Fifteen chapters, one notation.

  1. 00The object of studyAn LLM is a map from token IDs to logits. Training only ever sees next-token conditionals.
  2. 01Tokenization and targetsText becomes integers. Loss, perplexity, and “zero” are defined on this vocabulary, not on English words.
  3. 02Embeddings and positionTokens enter a vector space. RoPE injects order by rotating query/key pairs.
  4. 03The pre-norm Transformer blockResidual highways, RMSNorm, and the two sublayers that every modern decoder stacks.
  5. 04Causal attentionThe only place tokens mix. Scale, mask, softmax, GQA, and the softmax Jacobian.
  6. 05MLP and SwiGLUPer-token computation and the wide matrices that store features.
  7. 06Unembedding to probabilitiesA final norm, a linear map into V dimensions, and a categorical distribution per position.
  8. 07Loss, entropy, and scalingCross-entropy is maximum likelihood. It decomposes into entropy plus KL. The floor is E, not zero.
  9. 08Why loss is not zeroContext collapses meaning. It does not collapse the next token. The floor is entropy, not tautology.
  10. 09Backpropagation and JacobiansReverse-mode AD, the p − y collapse, RMSNorm, attention, SwiGLU, and the skip whose Jacobian is I.
  11. 10AdamW, clip, and the scheduleTurning a gradient into a new θ without destroying a billion-parameter run.
  12. 11The training loopBatch, forward, loss, backward, accumulate, clip, step. Train loss is not validation loss.
  13. 12Inference and the KV cacheFrozen θ. Temperature, top-k, nucleus. Prefill once, then decode with cached keys and values.
  14. 13End-to-end map and catalogueThe stacked forward equation, the train path, the infer path, Jacobians, and what each piece is for.
  15. 14Literature, in the order of the lessonThe papers that justify each step. Named where they earn a place. The Papers tab is the reading copy.

Laboratory

Manipulate the same objects.

Temperature, shift-invariance, the gradient, RoPE, the causal mask, the scale, the skip whose Jacobian is I, Sunday versus the leftover wording, Chinchilla’s floor, AdamW, nucleus sampling, entropy versus KL, and the KV cache — not as pictures, as instruments.

Primary sources

The papers that named the maps.

Each step of the stack has the work that defined it — Shannon’s floor, Vaswani’s scaled dots, Zhang’s RMSNorm, Hoffmann’s E. Open-access copies are linked; we do not host publisher PDFs. Closed works go to the DOI.

  1. 1948A mathematical theory of communicationEntropy as the irreducible uncertainty of a discrete source. Every later claim that loss cannot hit zero on language is this paper, applied to tokens.
  2. 1951Prediction and entropy of printed EnglishThe floor is a measurement. Humans who have seen the preceding text still cannot guess the next character with certainty. Conditional entropy of English is low, not zero.
  3. 2006Elements of information theory (2nd ed.)The identity the loss chapter writes without apology: cross-entropy = entropy + KL. Training is KL minimization in disguise.
  4. 1990Probabilistic interpretation of feedforward classification network outputs, with relationships to statistical pattern recognitionSoftmax as a categorical distribution, and the collapse of softmax-plus-cross-entropy to p − y. The treatise’s most important gradient is this identification.
  5. 1986Learning representations by back-propagating errorsThe public statement that a scalar loss can be routed to every weight by the chain rule, layer by layer, in reverse.
  6. 2018Automatic differentiation in machine learning: a surveyBackprop as reverse-mode automatic differentiation: vector–Jacobian products, not materialized Jacobians. The treatise’s ‘nobody forms J’ is this paper’s point.
  7. 1994A new algorithm for data compressionByte-pair encoding as a compression algorithm: repeatedly merge the most frequent adjacent pair. The tokenizer is this idea, frozen, pointed at text.
  8. 2016Neural machine translation of rare words with subword unitsBPE as the frozen map from bytes to the integers the treatise trains on. Loss, perplexity, and ‘what zero would mean’ are defined on this vocabulary.

Irreducible

Same notation from tokens to AdamW. Residual loss remains. The floor is entropy, not tautology.