๐Ÿง  Learn AI the school way

How models actually work (tokens โ†’ embeddings โ†’ attention โ†’ RLHF & LoRA), then how to use them well (prompting, RAG, agents, diffusion) โ€” every concept as a school story, every lesson with a numbered diagram and a hands-on lab. The labs are zero-dependency Python: no GPU, no API key, no pip install.

๐ŸŽฌ Companion video: 9 AI Concepts Explained in 7 minutes (ByteByteAI) โ€” the aerial view; this course is the slow ground tour of every concept it names.

๐Ÿงฉ tokens๐Ÿ—บ๏ธ embeddings ๐Ÿ‘€ attentionโญ RLHF & LoRA ๐Ÿ“– RAG๐Ÿ“‹ agents๐Ÿ“บ diffusion

๐Ÿ”ฌ Part 1 โ€” INSIDE the model

  • rules are grown from examples, not written ๐Ÿ“–
  • text becomes puzzle pieces ๐Ÿงฉ seated by meaning ๐Ÿ—บ๏ธ
  • one game: guess the next piece ๐ŸŽฒ โ€” with glancing ๐Ÿ‘€
  • finishing school: etiquette, gold stars, sticky notes โญ

๐Ÿงฐ Part 2 โ€” USING it for real

  • ask the librarian well; mind the small desk ๐Ÿ—ฃ๏ธ๐Ÿช‘
  • the confident kid makes things up โ€” defenses ๐Ÿ™‹
  • open-book exams (RAG) ๐Ÿ“– and hall passes (agents) ๐Ÿ“‹
  • un-blur the static: diffusion & multimodal ๐Ÿ“บ

๐Ÿ—บ๏ธ The big picture โ€” one diagram, both worlds

The whole course on one canvas. Click for the 4K version.

The big picture: inside the model (tokens, embeddings, attention, RLHF) and using it (prompting, RAG, agents, diffusion)

๐Ÿ”ฌ Part 1 โ€” inside the model (lessons 1โ€“7)

One git branch = one idea; branch 05 contains lessons 01โ€“05. Labs run with plain Python 3.

1

๐Ÿ“– What is AI

Rulebooks vs learning from examples โ€” the rules are grown, not written.lesson-01-what-is-aiRead lesson โ†’See the diagram โ†—
2

โœ๏ธ Training

Practice tests + the red pen โ€” loss and tiny downhill nudges.lesson-02-trainingRead lesson โ†’See the diagram โ†—
3

๐Ÿงฉ Tokens

Cutting text into puzzle pieces โ€” why 'strawberry' is hard.lesson-03-tokensRead lesson โ†’See the diagram โ†—
4

๐Ÿ—บ๏ธ Embeddings

The seating chart of meanings โ€” similar words sit together.lesson-04-embeddingsRead lesson โ†’See the diagram โ†—
5

๐ŸŽฒ Next-token prediction

The sentence-completion game, with a temperature dial.lesson-05-next-tokenRead lesson โ†’See the diagram โ†—
6

๐Ÿ‘€ Attention

Kids glancing around the class โ€” who does 'it' refer to?lesson-06-attentionRead lesson โ†’See the diagram โ†—
7

โญ RLHF & LoRA

Library, etiquette class, gold stars โ€” and sticky notes.lesson-07-rlhf-loraRead lesson โ†’See the diagram โ†—

๐Ÿงฐ Part 2 โ€” using it for real (lessons 8โ€“12 + bonus 13)

No installs here either โ€” the labs use any chatbot you already have, plus paper and honesty.

8

๐Ÿ—ฃ๏ธ Prompting & context

How you ask the librarian โ€” and the small desk it fits on.lesson-08-prompting-contextRead lesson โ†’See the diagram โ†—
9

๐Ÿ™‹ Hallucinations

The confident kid who never says 'I don't know'.lesson-09-hallucinationsRead lesson โ†’See the diagram โ†—
10

๐Ÿ“– RAG

The open-book exam, automated with the seating chart.lesson-10-ragRead lesson โ†’See the diagram โ†—
11

๐Ÿ“‹ Agents & tools

A student with a to-do list and a hall pass.lesson-11-agentsRead lesson โ†’See the diagram โ†—
12

๐Ÿ“บ Diffusion & multimodal

Un-blurring TV static, step by step, toward your words.lesson-12-diffusionRead lesson โ†’See the diagram โ†—
13

๐Ÿ”Œ Bonus: MCP

The universal plug โ€” deep-dive course: learn-mcp-school ๐Ÿ”Œlesson-13-mcpRead lesson โ†’See the diagram โ†—
# take the course locally:
git clone https://github.com/BaluRaut/learn-ai-school.git
cd learn-ai-school
python3 demo/bigram_model.py            # a language model in 60 seconds
git checkout lesson-01-what-is-ai       # then lesson by lesson
๐Ÿ”Œ Went deep on lesson 13? There is now a whole MCP school โ€” with a real server & client in the repo and 5 use cases with sequence diagrams. And for lesson 11: the Agents school โ€” a runnable agent, guardrails, failure modes, and 5 patterns. And for lessons 04 & 10: the VectorDB school โ€” a runnable mini vector database and the RAG machine room.
๐ŸŽ“ From the same school: Docker ยท Kubernetes ยท AWS ยท ArgoCD โ€” same analogies universe, same branch-by-branch method.

๐Ÿ“ The lesson diagrams โ€” follow the numbers

Every lesson as one numbered box-and-arrow diagram (purple = inside the model, teal = using it) โ€” also on a standalone page.

1 ๐Ÿ“– What is AI

Rulebooks vs learning from examples โ€” the rules are grown, not written.

๐Ÿ“œ the rulebook wayif ears AND whiskers AND tailโ€ฆrule #41 breaks on cartoon cats ๐Ÿ’ฅ๐Ÿฑ the examples way10,000 photos: cat / not-catโœ๏ธ trainingrules GROW inside๐Ÿง  modelanswers even for NEW cats12AI โŠƒ machine learning โŠƒ deep learning โŠƒ LLMs โ€” this course walks inward3

Read full lesson 01 โ†’

2 โœ๏ธ Training

Practice tests + the red pen โ€” loss and tiny downhill nudges.

๐Ÿ“š examplesquestion + true answer๐Ÿง  modelmillions of dialsโœ๏ธ prediction๐Ÿ”ด lossHOW wrong?1โ›ฐ๏ธ gradient descent: nudge EVERY dial slightly downhill2repeat millions of times๐Ÿงช validation set = unseen questions โ€” catches memorizers (overfitting)3

Read full lesson 02 โ†’

3 ๐Ÿงฉ Tokens

Cutting text into puzzle pieces โ€” why 'strawberry' is hard.

๐Ÿ“ text'the robot reads'๐Ÿงฉ tokenizer - BPEglue the most frequent pair,repeat thousands of times๐Ÿ”ข token IDs[464, 9379, 9743]12the model sees ONLY these pieces โ€” never words, never letters:why 'how many R's in strawberry' is hard ๐Ÿ“ ยท why pricing is per-token ยท why some languages cost 3ร—3

Read full lesson 03 โ†’

4 ๐Ÿ—บ๏ธ Embeddings

The seating chart of meanings โ€” similar words sit together.

๐Ÿงฉ token 'cat'๐Ÿ—บ๏ธ its seat coordinates[0.31, -1.2, 0.88, โ€ฆ] ร—768learned, not drawnthe seating hall - meaning spacecat ๐Ÿฑkittendog ๐Ÿถ๐Ÿ“Ž stapler - far12distance = similarity โ†’semantic search, RAG (L10), kingโˆ’man+womanโ‰ˆqueen ๐Ÿ‘‘3

Read full lesson 04 โ†’

5 ๐ŸŽฒ Next-token prediction

The sentence-completion game, with a temperature dial.

๐Ÿ“ pieces so far'The dog chased the'๐Ÿ“Š scoreboard over ALL piecescat 24% ยท ball 17% ยท car 9%โ€ฆ stapler 0.0001%one full scoreboard per step๐ŸŽ›๏ธ temperature0: safe ยท 1: natural2: chaos12๐Ÿงฉ picked: 'cat' โ€” glue on3repeat โ€” that's whyanswers STREAM

Read full lesson 05 โ†’

6 ๐Ÿ‘€ Attention

Kids glancing around the class โ€” who does 'it' refer to?

'The robot dropped the ball because IT was heavy'๐Ÿ‘€ 'it' glances aroundlearned weights:robot 65% ยท heavy 14% ยท ball 5%๐ŸŽจ blend'it' comes outROBOT-flavored ๐Ÿค–๐Ÿ—๏ธ transformerthis, ร—many heads,ร—32 layers, ALL tokensin parallel123queryยทkey similarity on the seats (L04) โ†’ softmax โ†’ weighted blend โ€” demo prints these exact numbers

Read full lesson 06 โ†’

7 โญ RLHF & LoRA

Library, etiquette class, gold stars โ€” and sticky notes.

๐Ÿ“š pretrainingread EVERYTHINGmonths ยท $$$M ยท once๐ŸŽ“ fine-tuningQโ†’A examples:learn to ANSWERโญ RLHFhumans pick better โ†’taste-judge โ†’ nudge๐Ÿค–theassistant123๐Ÿ—’๏ธ LoRA: freeze the brain, learn tiny sticky notes~0.1% of the size ยท one GPU ยท swappable per customer4

Read full lesson 07 โ†’

8 ๐Ÿ—ฃ๏ธ Prompting & context

How you ask the librarian โ€” and the small desk it fits on.

๐Ÿช‘ the desk - context window: N tokens, that's ALL there is๐Ÿ“œ role + rules (system)๐Ÿ’ฌ conversation - oldest slides off๐Ÿ“Ž pasted docs + examplesโœ๏ธ the answer itself - also here!๐Ÿ—ฃ๏ธ the craftsay who to be ยท exact ask ยทshow examples (few-shot) ยท'think step by step first'1๐Ÿ•ณ๏ธ not on the desk = doesn't exist:no memory between chats ยท middle gets skimmed2same model, 10ร— better output โ€” prompting is iteration, not incantation3

Read full lesson 08 โ†’

9 ๐Ÿ™‹ Hallucinations

The confident kid who never says 'I don't know'.

โ“ thin-shelf question'books about Mongolianpirates?'๐Ÿง  the machineproduce the LIKELIEST continuationtruth was never in the loss (L02)๐Ÿ™‹ fluent ยท confident ยท WRONGrealistic fake title,fake author, page count12๐Ÿ“– defense 1: facts ON the desk(paste them โ€” or RAG, L10)๐Ÿงพ defense 2: 'quote the exactsentence you base this on'๐Ÿคท defense 3: 'if unsure, say so'+ verify anything you'd act on3

Read full lesson 09 โ†’

10 ๐Ÿ“– RAG

The open-book exam, automated with the seating chart.

1 before exam season - once๐Ÿ“š handbookโ†’ โœ‚๏ธ chunks๐Ÿ—บ๏ธ vector DBseat per chunkโ“ questionembedded too๐Ÿ“ nearest seats= most relevant chunks๐Ÿช‘ the deskquestion + those chunks +'answer ONLY from these, cite' ๐Ÿงพ234facts โ†’ RAG ยท style โ†’ fine-tune (L07) โ€” the rule of rules

Read full lesson 10 โ†’

11 ๐Ÿ“‹ Agents & tools

A student with a to-do list and a hall pass.

๐Ÿ“‹ goal'organize theclass picnic'๐Ÿง  THINKnext-token planningin words (L05!)๐Ÿงฐ ACTwrites a tool call:roster.count()๐Ÿ‘€ LOOKresult โ†’ desk:23 kids123loop until the goal is met๐Ÿšง guardrails: read-only tools by default ยท spending caps ยท human sign-off for field-trip forms ยท logs of every step4

Read full lesson 11 โ†’

12 ๐Ÿ“บ Diffusion & multimodal

Un-blurring TV static, step by step, toward your words.

๐ŸŽจ homework, millions of times๐Ÿฑ photo+noise ร—1000๐Ÿ“บ staticlearn: predictthe noise๐Ÿ“บ purestatic๐ŸŒ€ un-noise ร—20-50 stepsprompt's meaning-seat (L04) steers each step๐Ÿฑ๐Ÿ‘‘ 'cat witha crown'12๐Ÿ‘€ multimodal:images/audiobecome tokens too โ€”same desk, sameattention (L03/L06)3

Read full lesson 12 โ†’

13 ๐Ÿ”Œ Bonus: MCP

The universal plug โ€” deep-dive course: learn-mcp-school ๐Ÿ”Œ

๐Ÿ before MCPevery app ร— every tool =a hand-built adapter (Nร—M)๐Ÿซ hosts - the roomsClaude Desktop ยท IDE ยทyour agent โ€” standard sockets ๐Ÿ”Œ๐Ÿ”ฌ MCP serversfiles ยท GitHub ยท your DB โ€”standard plugs12each server announces: my TOOLS ๐Ÿงฐ ยท my RESOURCES ๐Ÿ“ ยท my PROMPTS ๐Ÿ“œdiscover (tools/list) โ†’ call (tools/call) โ†’ result lands on the desk โ€” L11's loop, standardized3๐Ÿšง a server runs with YOUR permissions โ€” installing one = installing software; L11 guardrails apply double4

Read full lesson 13 โ†’

Start Lesson 01 โ†’ ๐Ÿ—“๏ธ Study plan (4 weeks) ๐Ÿ“ All 13 lesson diagrams ๐Ÿงช Quiz โฎ๏ธ Before & trade-offs