How Large Language Models (LLMs) Work
This technical guide explains how large language models work through transformer architecture and self-attention mechanisms that process relationships between all elements in a sequence simultaneously. LLMs consist of hundreds of millions or billions of parameters pre-trained on massive text corpora, enabling them to understand word associations regardless of position in a sentence. As of 2024, multimodal LLMs have become mainstream, with major providers now processing images, audio, and video alongside text.
10 sections ยท 27 lessons
Course outline
Foundational Concepts
- Text to Numbers
- Layered Processing
- Tokenization
- Embeddings
- Foundational Concepts
Sequential Processing Problems
- Sequential Limitations
- Sequential Processing Problems
Transformer Architecture
- Parallel Processing
- Query-Key-Value
- Attention Weights
- Transformer Architecture
Self-Attention Mechanics
- Self-Attention
- Causal Masking
- Multi-Head Attention
- Self-Attention Mechanics
Model Architectures
- Architecture Types
- Model Scale
- Model Architectures
Pre-Training Process
- Pre-Training
- Next-Word Prediction
- Pre-Training Process
Fine-Tuning and Alignment
- Fine-Tuning: Specializing Pre-Trained Models
- RLHF Overview
- RLHF Stages
- Fine-Tuning and Alignment
Text Generation
- Autoregressive Generation
- Softmax Transformation
- Temperature: Controlling Output Randomness
- Sampling Strategies
- Text Generation
Generation Control
- Creativity vs Precision
- Generation Control
Model Limitations
- Hallucinations
- Mitigating Hallucinations
- Context Windows
- Context Management
- Model Limitations