How an LLM is made

The notes

1. Data collection and preparation

  • Massive datasets
  • Web crawling
  • Filtering
  • Cleaning data
  • Tokenization: text is split into tokens

2. Pre-training (self-supervised)

  • Large neural networks running on servers
  • Learns general language patterns
  • Understands structure and relationships
  • Unsupervised learning (e.g. predict the next word)
  • Uses vast computational resources (GPUs/TPUs)
  • Result: the base model

3. Supervised fine-tuning (SFT)

  • Trained on high-quality demonstrations (example: prompt "Write a summary" with output "A concise summary is...")
  • Teaching specific skills
  • Following instructions
  • Focused training

4. Reinforcement learning from human feedback (RLHF)

  • Human annotators compare model responses
  • Human preferences are collected
  • Training a reward model
  • Policy optimization (e.g. PPO)
  • Aligning to human values: making it helpful, honest, harmless

5. Evaluation and deployment

  • The final model is tested with quality metrics
  • Benchmark tests
  • Quality and bias checks
  • Safety guardrails
  • Mitigating bias
  • Integrating into applications (chatbots, assistants)
  • Ready for deployment

AI fundamentals deck

  1. 1. How an LLM is made
  2. 2. What is a token?

and many more

Watch the lesson

Smarter with AI, Lesson 9, from 0:47: How is an LLM made?