The Mechanics of LLMs

Volume 01 · The foundations

The Mechanics of LLMs

Theory, Architecture, and Practice for Engineers

Choose your edition Amazon · Paperback / Kindle

Choose your book’s language, then its format. Prices and delivery details are shown on Amazon.

English

Français

Español

Português (Brasil)

Books on alouani.org ↗

The reading journey

How does a language model work?

From language to architectures, from training to applications. Foundations for understanding and building.

  1. Representing languageTokens, embeddings, attention and Transformers
  2. Building the modelArchitectures, experts and pretraining
  3. Adapting and generatingSFT, alignment, decoding and reasoning
  4. Connecting to applicationsRAG, agents, protocols and evaluation

Who is this for? What do you need?

For students, developers and engineers. Basic algebra helps with calculations; Python is useful for the scripts. You can follow the conceptual journey without running them.

The book follows the construction of a language model, then ways to adapt and use it. It connects text representations with Transformer architectures, training and generation strategies.

The journey extends to systems: document retrieval, agents, protocols and evaluation. Companion scripts explore selected concepts in practice. Their availability and dependencies are documented in the repository.

This volume introduces the foundations. The second develops tool building, result checking and the investigation of internal mechanisms.

Companion code on GitHub

Companion code on GitHub

The repository accompanies the book. Check its contents and instructions for the resources currently available.

Reference to the French edition; pagination in other editions may differ. PDF pages 6–17 · T1-FR-20260107.