Learn AI from First Principles

Build the knowledge and practical skill to move from Python and mathematics through deep learning and modern language models. Read, compute, run code, and interact with the ideas one visible step at a time.

Method

A textbook you can work with

Hard technical topics often move through a useful loop: understand the idea, compute a small case, implement it, then test where it works and fails.

Interactive diagrams let you move the quantities and inspect what changes. Runnable examples expose arrays, weights, activations, attention patterns, errors, and failure modes when doing so helps the lesson.

  1. 1

    Intuition

    Why the idea exists.

  2. 2

    Theory

    The math and derivation.

  3. 3

    Worked example

    A small case by hand.

  4. 4

    Code

    An implementation you can inspect.

  5. 5

    Experiment

    See where it works and fails.

Approach

Ideas first. Frameworks when they help.

The early path uses Python, NumPy, and Matplotlib. That keeps the math, arrays, gradients, and experiments visible.

Later, frameworks become tools for larger experiments, hardware, and real engineering—after you can see what they compress.

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 and is willing to reason, calculate, program, and experiment.

Curriculum

From Foundation to Frontier

Python prepares NumPy. Math prepares gradients. Deep learning prepares language modeling. Language modeling prepares transformers.

Advanced path

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. Leave your email if you want occasional notes about new lessons, curriculum changes, and major site milestones.

No account is needed for the early site. The update form stays separate from sign-in and personal features.