Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on. You've got this! 🚀
Training an LLM
Training a large language model requires enormous amounts of data and computing power. Understanding the basic process explains why LLMs know what they know and why their knowledge has a cutoff date.
The LLM Training Process: Simplified
- Step 1 - Data collection: gather hundreds of billions of words from books, websites, code, scientific papers, and other text sources
- Step 2 - Tokenization: convert all text into tokens the model can process
- Step 3 - Pre-training: train the model to predict the next token across the entire dataset, billions of times
- Step 4 - Fine-tuning: train the model further on specific tasks or high-quality examples to improve usefulness
- Step 5 - RLHF (Reinforcement Learning from Human Feedback): human raters evaluate responses and the model is further trained to produce responses humans prefer
- Step 6 - Safety testing: test for harmful outputs and add guardrails to prevent them
- Step 7 - Deployment: make the trained model available via applications and APIs
Practice Task
Note
Think about what this training process means for practical use. If an LLM was trained on data collected up to January 2024: (1) What would it not know about? (2) What types of questions would give you the most reliable answers? (3) What types of questions would require you to verify the answer? Write your thoughts before reading the next section.
Deep Learning ⊂ Machine Learning ⊂ Artificial Intelligence
Key Takeaways
- Training a large language model requires enormous amounts of data and computing power.
- Step 1 - Data collection: gather hundreds of billions of words from books, websites, code, scientific papers, and other text sources
- Step 2 - Tokenization: convert all text into tokens the model can process
- Step 3 - Pre-training: train the model to predict the next token across the entire dataset, billions of times