AI Lab — All Lessons Summary

AI Lab is a free, interactive learning site that explains how AI models work and how they are made smaller and faster: 14 lessons, 64 steps, with hands-on diagrams, sliders, and quizzes, in Japanese, English, and Chinese. This page is a static summary of every lesson for readers and crawlers without JavaScript. The interactive version is at lab.militou.com.

Intro

1. How Models Are Made

The full pipeline of a modern language model: large-scale pretraining on raw text, then instruction tuning and RLHF to make it follow instructions, then fine-tuning for specific uses.

Open the interactive lesson

Intro

2. LoRA Basics

LoRA freezes the original weights and learns a low-rank update W + BA instead of updating the full weight matrix.

Open the interactive lesson

Intro

3. Quantization Basics

Quantization stores weights in fewer bits, trading a little precision for a much smaller, faster model.

Open the interactive lesson

Intro

4. Knowledge Distillation Basics

A small student model learns from a large teacher's output distribution, not only from the correct answer.

Open the interactive lesson

Intro

5. Diffusion Model Basics

Image generation models learn to reverse a noising process: noise is added step by step until the image is pure noise, and the model learns to remove it step by step.

Open the interactive lesson

Intro

6. Parts of a Model

The building blocks of a Transformer: token embeddings, attention, MLP blocks, layer normalization, and the output head.

Open the interactive lesson

Intro

7. Three Ways to Shrink a Model, and Pruning

The three main compression routes are quantization, distillation, and pruning, and they can be combined.

Open the interactive lesson

Intro

8. Making Inference Faster

Inference speed is often limited by memory bandwidth rather than compute.

Open the interactive lesson

Intro

9. Sampling at Generation Time

Temperature and top-p control randomness when a model picks the next token.

Open the interactive lesson

Intro

10. How to Evaluate and Compare

Fair comparison requires fixed conditions and metrics matched to the purpose.

Open the interactive lesson

Deep Dive

11. The PEFT Family

Parameter-efficient fine-tuning methods (LoRA, adapters, prefix/prompt tuning) freeze almost all of the base model and train only a small added part.

Open the interactive lesson

Deep Dive

12. QLoRA in Practice

QLoRA quantizes the frozen base model to 4-bit NF4 and trains LoRA adapters on top.

Open the interactive lesson

Deep Dive

13. Datasets and Training Tuning

Practical fine-tuning is mostly data work: curation, consistent formatting, and choosing learning rate, epochs, and rank.

Open the interactive lesson

Deep Dive

14. The Few-Step Family

Few-step generation methods compress a diffusion model's tens of denoising steps into roughly 1–8 steps.

Open the interactive lesson

Operated by militou. See also llms.txt.