1. Data Preparation & Preprocessing
-
- Data Curation (organizing, selecting, managing, and compiling) : Gathering terabytes of diverse text from websites, books, academic journals, and code repositories.
- Data Cleaning: Removing HTML tags, duplicates, spam, and toxic content to maximize data quality.
- Tokenization: Splitting raw text into smaller chunks called “tokens” (words or sub-words) and converting them into numerical IDs. [1, 2, 3, 4, 5]
2. Pre-Training (Self-Supervised Learning)
-
- Next-Token Prediction: The model reads billions of text sequences and repeatedly guesses the next token. [1, 2]
- Backpropagation & Loss Minimization: If the model guesses wrong, a loss function calculates the error. The internal weights (parameters) are adjusted using an optimizer to make better future guesses. [1, 2, 3]
- Outcome: The resulting model understands grammar, world facts, and language structure. However, it acts like an autocomplete engine rather than a helpful assistant. [1, 2, 3, 4, 5]
- The Architecture: Using a Transformer neural network with an attention mechanism to understand how words relate to each other over long distances. [1]
- The Objective: Training the model on a simple task: predicting the next token in a sequence. [1, 2]
- The Result: A “Base Model” that has deep knowledge of language patterns and facts, but lacks conversational skills.
3. Supervised Fine-Tuning (SFT)
-
- Instruction Datasets: The model is trained on highly curated, high-quality prompt-and-response pairs (e.g., “Prompt: Summarize this text. Response: [Expert Summary]”).
- Behavior Copying: The model learns the typical format, tone, and helpful boundaries required of an AI assistant. [1, 2, 3, 4]
- The Dataset: Training on high-quality, curated pairs of instructions and ideal responses (e.g., Prompt: “Summarize this article.” -> Response: [A perfect summary] ). [1, 2, 3]
- The Result: An “Instruction-Tuned Model” that understands how to act as a chatbot, follow explicit formatting commands, and execute diverse tasks
4. Preference Alignment (RLHF / DPO)
-
- Preference Gathering: Humans or stronger AI models score different variations of the model’s responses to flag which options are better, safer, or more accurate. [1, 2]
- Optimization: Techniques like Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO) mathematically penalize the model for generating harmful or inaccurate text while rewarding high-quality outputs. [1, 2, 3, 4, 5]
- RLHF: Utilizing Reinforcement Learning from Human Feedback. Humans score multiple model responses to train a secondary “Reward Model” on what a good answer looks like.
- DPO / RL: Applying algorithms like Direct Preference Optimization (DPO) or Proximal Policy Optimization (PPO) to shift the LLM’s weights toward generating highly rated responses.
- The Result: A safer, more polite, and helpful assistant (like the public versions of ChatGPT or Claude). [1, 2, 3, 4, 5]
5. Reasoning Fine-Tuning (Advanced Models)
-
- Chain-of-Thought (CoT): Training the model on step-by-step reasoning processes for logic, math, or coding.
- Verifiable Rewards: Utilizing frameworks like Group Relative Policy Optimization (GRPO) to give the model massive computing rewards when it successfully reasons through a hard prompt to reach the correct answer. [1, 2, 3, 4, 5]
- The Approach: Training the model to generate a Chain-of-Thought (inner monologue) before delivering a final response.
- Verifiable Rewards: Using Reinforcement Learning with Verifiable Rewards (such as checking if a math equation or a block of code actually works) to reward correct logic. Techniques like DeepSeek’s GRPO are widely leveraged here. [1, 2, 3, 4, 5]
6. Evaluation & Quantization and Deployment
-
- Benchmarking: Testing the model against standard standardized benchmarks (e.g., MMLU, GSM8K) to measure its knowledge and reasoning.
- Quantization: Compressing the final weights of the model so that it runs faster and uses less memory during live deployment. [1, 2, 3, 4, 5]
- Inference Deployment: Hosting the model on cloud servers to generate real-time answers for users
![]()

