Zubnet AIसीखेंWiki › Gradient Descent
Training

Gradient Descent

SGD, Stochastic Gradient Descent, Backpropagation
वो algorithm जो neural networks को train करता है parameters को iteratively adjust करके loss function कम करने के लिए। ये ऐसे काम करता है: loss के gradient (steepest increase की direction) को हर parameter के respect में compute करता है, फिर हर parameter को opposite direction (downhill) में एक छोटा step move करता है। Backpropagation वो technique है जो इन gradients को network की layers के through efficiently compute करती है।

यह क्यों matter करता है

Gradient descent पूरे deep learning के engine के नीचे का engine है। हर वो model जो आप use करते हैं — हर LLM, हर image generator, हर embedding model — gradient descent से trained था। इसे समझना आपको training dynamics समझने में help करता है: learning rate क्यों matter करता है, training diverge या stuck क्यों हो सकती है, और क्यों Adam जैसे modern optimizers naive gradient descent से बेहतर काम करते हैं।

Deep Dive

The full algorithm: (1) take a batch of training examples, (2) run them through the model to get predictions, (3) compute the loss, (4) use backpropagation to compute the gradient of the loss with respect to every parameter, (5) update each parameter by subtracting the gradient times a learning rate, (6) repeat. In practice, "stochastic" gradient descent (SGD) uses random mini-batches rather than the full dataset, which is both computationally necessary (the full dataset doesn't fit in memory) and beneficial (the noise from random batches helps escape local minima).

Adam and Modern Optimizers

Plain SGD is rarely used today. Adam (Adaptive Moment Estimation) maintains a running average of both the gradient and its squared magnitude for each parameter, effectively giving each parameter its own adaptive learning rate. Parameters with consistently large gradients get smaller updates (they're already well-calibrated), while parameters with small, noisy gradients get larger updates (they need more aggressive movement). AdamW adds weight decay for regularization. Most LLM training uses AdamW or variants.

The सीखेंing Rate

The learning rate is arguably the single most important hyperparameter in training. Too high and the model overshoots the minimum, loss diverges, and training fails. Too low and training takes forever or gets stuck. Modern training uses learning rate schedules: start with a warmup phase (gradually increasing from near-zero), reach a peak, then decay (cosine annealing is common). The peak learning rate, warmup duration, and decay schedule all interact with batch size and model architecture. Getting this right is a significant part of training large models.

संबंधित अवधारणाएँ

← सभी Terms
← Gradient Checkpointing Groq →