What Happens During Training?

Summary

A high-level overview of how a neural network trains step by step: from data to improved predictions.

basic
neural-network-basics

Training a neural network is a cyclical process of learning from data.

Let’s break it down step-by-step.


1. πŸ“₯ Input Data

The model takes in examples:

Input: "What is the capital of France?"
Label: "Paris"

The data is tokenized and turned into numbers.


2. πŸ”„ Forward Pass

The inputs go forward through the network, layer by layer, producing an output (prediction).


3. πŸ“‰ Compute Loss

Compare the output to the true label using a loss function.

Example:

L = (Ε· - y)^2

4. πŸ” Backward Pass

Use backpropagation to calculate how much each weight contributed to the error.


5. 🎯 Update Weights

Apply gradient descent to slightly adjust each weight in the direction that reduces loss.


6. πŸ” Repeat

This cycle is repeated for:

  • Many batches
  • Over many epochs

The model improves over time as loss decreases.


βš™οΈ Visualization

Watch how the model learns after each step.


🧠 Summary Table

| Step | Description | |------------------|-------------------------------------| | Input | Tokenized data | | Forward Pass | Compute prediction | | Loss | Compare prediction to label | | Backward Pass | Compute gradients | | Update Weights | Use gradients to adjust parameters |


βœ… Self-Check

  • What are the major phases of training?
  • What does the model learn from?
  • Why is training repeated in cycles?