Principia Orthogona · Book XVIBook XVII · Book XVIII
Principia Orthogona · Book XVI

LLMs Explained: Tokens, Embeddings, Transformers and More

What a large language model does with a sentence, from the text it reads to the number it predicts, taken from the original papers and checked by script.

The series already holds the mathematics under this (Book XVII, the Machine Floor; Book XVIII, the chain rule that ends in backpropagation; Book XXIV, linear algebra). It did not hold the thing the mathematics is used for. This book fills that gap, one stage at a time, in the order a sentence travels.
How claims are markedEach statement is computed (a script in this folder prints it), quoted (taken from a named paper and section, not recomputed) or open (not checked). Explanations are not written from memory alone: where I have not read a source, the page says so.

Contents

#ChapterStatusMain source
1Tokens: the unit a model actually readsdraftSennrich, Haddow, Birch 2015 (byte pair encoding)
2Embeddings: words as pointsplannedMikolov et al. 2013
3Attention: who looks at whomplannedVaswani et al. 2017, §3.2
4The transformer blockplannedVaswani et al. 2017, §3 and Table 1
5Training: loss, gradients and scaleplannedBooks XVII and XVIII; scaling-law papers (unread)
6What is not understoodplannedto be chosen after the earlier chapters

What I have read, and what I have not

Read for this draft: the byte-pair-encoding paper (Sennrich et al., arXiv 1508.07909, §3.2) and the formulas, hyperparameters, complexity table and results of the transformer paper (Vaswani et al., arXiv 1706.03762, version 7, §§3–6). Not read: the word-embedding paper beyond its abstract, any scaling-law or alignment paper, and the neural-network chapters of a current textbook. The Jurafsky–Martin text on the desk is the 2007 edition, which predates neural language models, so it cannot support chapters 2 to 6. Those chapters are marked planned, not drafted.

Where this connects

Book XVII (mathematics of machine learning) · Book XVIII (chain rule and backpropagation) · Book XXIV (linear algebra) · Book XIV (language of mathematics, parsing machines) · Book XXV (languages side by side, which will supply the multilingual tokenization test in chapter 1).

© 2026 Pablo Nogueira Grossi / G6 LLC · Newark, New Jersey · CC BY-NC-ND 4.0 · Independent teaching text; not peer-reviewed.