Mathematical Foundations of LLM Training and Inference

Author

Vitaly Rubinovich

An engineer adjusts a brass instrument with translucent vector grids and connected layers, beside a descending track, measuring gauge, books, and mathematical sketches.

A language model’s behavior depends on calculations you can inspect: how text becomes numbers, how errors change weights, and how a trained model produces an answer. This book develops the mathematical foundations of large language models through small examples and computational labs. It helps you connect those calculations to practical decisions about model quality, adaptation, memory, and inference.

Contents

Front matter

Part I: From Text to Mathematical Objects

Part II: From Scores to Loss

Part III: From Error to Learning

Part IV: Modeling Sequences

Part V: Adapting and Running LLMs

Part VI: Implementation and Extensions

Appendices