Start here
This is a book, not a reference manual.
It starts from nothing. You do not need to know what a transformer is, or what "weights" are, or what people mean when they say a model is thinking. You do need to be able to read code. If you know what an array is, and what a function is, you have enough.
The model we are walking toward is Qwen3.8. Alibaba released it as an API on August 3, 2026. The open weights landed on August 12. The downloadable checkpoint is called Qwen3.8-2.4T-A95B. The hosted product is called Qwen3.8-Max. They are related but they are not the same thing. We will get to that.
The first half is what the model is. The second half is why making one is a warehouse problem — the stuff people at xAI or DeepSeek actually fight, once the architecture diagram is boring.
How to read it
Read the chapters in order. Each one assumes the ones before it.
Do not skim the early chapters because they look basic. The later chapters only make sense if the early ones are sitting in your head as pictures, not as vocabulary.
If a chapter has a diagram, look at the diagram after you have read the paragraph that introduces it, not before.
There is a phone-friendly version at ai-from-scratch-c9c.pages.dev.
The chapters
- It's not a program
- Tokens
- The only trick
- Vectors
- Attention
- One layer
- Picking the next word
- Memory
- Experts
- Two kinds of attention
- How they train it
- Teaching it to think
- The Qwen3.8 machine
- One request
- Open weights
- What this is not
Part II — the hard parts
- Why one GPU dies
- Cutting the model up
- All-to-all
- When the math breaks
- A warehouse that thinks
- Long context is a tax
- Serving is another model
- RL is a factory
- The data is the model
- What labs still hide
There is also a glossary, a sources page, and how to write a book like this. The glossary is for looking things up later. It is a bad place to start. The writing system is how this book was made.
If the first half felt easy, start at 17. That is the intended reaction.
What this book is careful about
A lot of writing about new models is recap of recap. This one is not.
The numbers for Qwen3.8 come from the official Hugging Face model card and the config.json that shipped with the weights. The story of how Qwen trains models comes from the Qwen3 technical report, which is the last time they published the full recipe in public. The hybrid attention design comes from the Qwen3-Next writeup, which is the architecture Qwen3.5 and Qwen3.8 sit on.
When something is a vendor claim and not a measured fact, the book says so. xAI in particular publishes cluster size, not training recipes. Those chapters say so.