Deeply Understand Large Language Models
We are training an LLM from scratch, and every step goes into this course: why we did it, what we traded off and where it went wrong.
Intelligence
Context
- Int1072
- elligence8509
- ?
Next-token probabilities
- is0.39
- and0.22
- in0.11
- ,0.07
- as0.05
Math, code and a figure you can touch
Encode position as a rotation angle, and the dot product only sees the relative distance m−n.
def rotate_half(x):
x1 = x[..., : x.shape[-1] // 2]
x2 = x[..., x.shape[-1] // 2 :]
return torch.cat((-x2, x1), dim=-1)
q_embed = (q * cos) + (rotate_half(q) * sin)
k_embed = (k * cos) + (rotate_half(k) * sin)Curriculum
Six parts, from the basics to agents
Code in the cookllm-recipes repo, runnable as you read
Start Learning →- 01BasicsTokenization, Transformer, optimization
- 02Systems and deploymentGPU kernels, parallelism, inference and serving
- 03Scale and dataScaling laws, cleaning, dedup, mixing
- 04EvaluationBenchmarks, parsing, reliability
- 05Post-trainingSFT, RLHF, GRPO, DPO
- 06Multimodal and agentsVision, image-text alignment, tool use
Six stages, from data to an agent
Code in the cookllm-bento repo, trained in public
View experiments →- 01Data prepDownload, Clean, Pack
- 02Tokenizer trainingRustBPE, tiktoken
- 03Model buildBentoLM, RoPE, Muon
- 04PretrainingMuon, WSD, Scaling
- 05MidtrainingLong context, RoPE scaling
- 06Post-training and agentsSFT, RL, tool use
More chapters on the way. Stay tuned.
Pricing
Jobs membership
Course lifetime members: 25% off
- Upload your resume and we pick the fits among tens of thousands of open AI jobs
- New jobs that fit you, in your inbox every morning
- Hiring posts from the team on X and LinkedIn, with the poster and the post
- Fit, shared skills and level gap for every job
- Apply links go straight to the company, jobs updated daily
- Filter by region, work mode and level
Course lifetime
The course is still being built: early price
Pay once, yours for good
- Every chapter, now and to come
- All the course repo code
- Interactive figures you can tweak in each chapter
- Hands-on training: six stages, from data to an agent
- Every BentoLM experiment record
- The video course when it launches
What you might want to know
It is if you can already call an API and want to know how models are actually trained. It fits people moving into LLM work from other fields, preparing for LLM interviews, or training and tuning models at work. If you only want to get better at using ChatGPT, this course isn't for you.
Four things. The course docs live on this site in two parts, Fundamentals and Hands-on Training, with formulas, diagrams and runnable code side by side. The code is in two private GitHub repos: cookllm-recipes holds each module, and cookllm-bento has the full code for training an LLM from scratch. Every experiment from training BentoLM is in there too, with its config, results and cost. A video course is in the works, and buyers get it when it launches.
Yes. Some chapters are fully free, and paid chapters still show the parts that aren't locked.
Yes. You pay for the course once, and new chapters, code and the video course come at no extra cost.
Most courses either teach you to call an existing framework or retell the paper. Here we explain why each step is done the way it is: formulas, diagrams and code sit side by side, so you can see what each design choice changes. We are training an LLM from scratch ourselves, and the whole process is public on /lab, failed experiments and costs included.
Ask in Discord or email us. Both are on the contact page.