Gradient Descent.
An optimization algorithm that iteratively adjusts model parameters by moving in the direction opposite to the gradient of the loss function.
Gradient descent is the fundamental optimization algorithm that powers the training of neural networks and large language models. It works by calculating the gradient (slope) of the loss function with respect to each parameter, then updating those parameters in the direction that reduces the loss most steeply. This iterative process continues until the model converges to a minimum loss, effectively learning to make better predictions. Without gradient descent and its variants, modern AI systems like GPT-4 and Claude would be impossible to train at scale.
The algorithm comes in several key variants that balance computational efficiency with training stability. Batch gradient descent computes gradients using the entire dataset, providing stable updates but requiring enormous memory for large datasets. Stochastic gradient descent (SGD) uses individual examples, enabling faster iterations but with noisy updates. Mini-batch gradient descent strikes a middle ground, using small batches of data to provide reasonably stable gradients while maintaining computational efficiency. Modern implementations often incorporate momentum, adaptive learning rates, and other techniques to improve convergence speed and avoid getting stuck in poor local minima.
In practice, gradient descent faces several challenges that AI practitioners must navigate carefully. The choice of learning rate is critical—too high and the model may overshoot optimal solutions, too low and training becomes prohibitively slow. The algorithm can get trapped in local minima or saddle points, though this is less problematic in high-dimensional spaces typical of neural networks. Many assume gradient descent always finds the global optimum, but it typically finds good local minima that work well in practice. Advanced optimizers like Adam and RMSprop have largely replaced vanilla gradient descent in production systems, incorporating adaptive learning rates and momentum to achieve faster, more stable training.