Learn AI from First Principles
Modern models write code, solve hard problems, and use tools. LLM Primer teaches the ideas underneath them, one visible step at a time.
Method
How each topic is taught
Each topic moves through the same simple loop: understand the idea, compute it, then test it.
When scale allows it, we also inspect what the model learned: weights, activations, attention patterns, errors, and failure modes.
- 1
Intuition
Why the idea exists.
- 2
Theory
The math and derivation.
- 3
Worked example
A small case by hand.
- 4
Code
An implementation you can inspect.
- 5
Experiment
See where it works and fails.
Approach
Framework-neutral by default.
The early path uses Python, NumPy, and Matplotlib. That keeps the math, arrays, gradients, and experiments visible.
Frameworks enter only when they help the idea, not when they replace it.
Who it is for
For readers who want to understand AI from the inside.
You may be new to programming. You may know Python but not the math. You may have used models and APIs without understanding what happens underneath.
LLM Primer is for the reader who wants the pieces to connect.
Curriculum
From Foundation to Frontier
Python prepares NumPy. Math prepares gradients. Deep learning prepares language modeling. Language modeling prepares transformers.
Python
Enough scientific Python to read examples, inspect arrays, and run small experiments.
Math
Vectors, matrices, probability, gradients, and optimization, taught for use.
Deep Learning
Neural networks as visible computations: tensors, losses, training, and debugging.
Language Modeling
Text as data: tokens, vocabularies, sequence probability, and simple models.
Transformers
Tokenization, embeddings, attention, transformer blocks, and language modeling.
Generative Models
Autoencoders, diffusion, flow matching, and generation as learned structure.
RL Foundations
States, actions, rewards, value functions, Q-learning, and policy gradients.
Frontier
Advanced material will develop carefully because the field changes quickly. The goal is to teach lasting ideas, then connect them to new papers and systems.
What you build
Each stage ends in something inspectable.
A plot. A small numerical library. A gradient check. A training loop. A tokenizer. An attention block. An experiment that fails for a reason you can explain.
The project is not decoration after the lesson. It is how the lesson becomes real.
Updates
Follow the releases.
Chapters will be released in phases. Join the update list when it opens to hear about new lessons, curriculum changes, and important site milestones.
No account is needed for the early site. The update form will stay simple until sign-in and personal features are worth adding.