Thursday, December 3, 2026 | London 11°C · Drizzle
DailyGlimpse

AI

Understanding Gradient Descent's Zigzag Pattern and the Role of Momentum

MarkTechPost 2 min read

Understanding Gradient Descent's Zigzag Pattern and the Role of Momentum

Gradient descent, a fundamental optimization algorithm in machine learning, often exhibits a zigzagging behavior that can slow down convergence. This occurs because the algorithm updates parameters by moving in the direction of the steepest descent, which may oscillate across ravines or narrow valleys.

Why does gradient descent zigzag?

In regions where the loss function has a high curvature along one direction and low curvature along another, gradient descent tends to make large jumps in the high-curvature direction, leading to oscillation. For example, if the error surface is shaped like a long, steep canyon, the gradient points across the canyon rather than along it, causing the optimizer to bounce back and forth.

How momentum fixes the zigzag

Momentum is a technique that accelerates gradient descent by accumulating a velocity vector in the direction of persistent gradients. Instead of using only the current gradient to update parameters, momentum adds a fraction of the previous update. This dampens oscillations in high-curvature directions while building up speed in consistent directions.

Mathematically, the update rule with momentum is: ( v_{t} = \beta v_{t-1} + \eta \nabla J(\theta) ) ( \theta = \theta - v_{t} ) where ( \beta ) is the momentum coefficient (typically 0.9) and ( \eta ) is the learning rate.

By smoothing out the updates, momentum helps the optimizer move more directly toward the minimum, reducing the zigzag effect and often leading to faster convergence. This simple yet powerful modification is widely used in training deep neural networks.

React