The math behind large language models
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
Avidlive.ai, made by Serein, has published a free guide to the math behind large language models: 73 formulas in 20 sections, from byte-pair encoding and attention to scaling laws, KV cache, quantization, RLHF, mixture of experts and speculative decoding. Each formula has a plain explanation, a NumPy snippet and a cited paper, and the page says every snippet was run. Checked claims, including the Chinchilla and Kaplan constants and the lossless speculative-decoding rule, match their sources. The Llama 2 grouped-query attention and PPO clipping figures could not be checked.