1. Data Preparation & Preprocessing
Before any training begins, massive datasets must be collected and formatted. [1, 2]
    • 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)
This step consumes roughly 98% of the total computing budget and builds the “Base Model”. [1, 2]
    • 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]
    • This is the most expensive and time-consuming stage where the model learns the core mechanics of language. [1, 2, 3, 4]
    • 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)
This step shifts the model from a text-completer to an instruction-follower. [1, 2]
    • 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]
    • This step transforms the raw text-predictor into a functional, conversational assistant. [1, 2]
    • 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)
This phase ensures the model is safe, helpful, and behaves according to human values. [1, 2]
    • 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]
      • Even if a model can follow instructions, it might still generate toxic, biased, or unhelpful answers. This phase aligns the model with human values. [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)
Modern models undergo an extra step to handle complex problem-solving. [1, 2, 3, 4, 5]
    • 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]
    • Modern state-of-the-art models undergo an extra layer of optimization to solve complex, multi-step problems. [1, 2]
    • 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


Loading