Optimization Algorithms: Finding the Global Minimum

Optimization is the science of finding the input x that minimizes a function f(x), typically representing a "loss" or "cost." In modern engineering, it is the engine that allows a neural network to "learn." In 2024, the field has shifted from mere gradient descent to Full-Parameter Efficiency, allowing massive models to be trained on consumer hardware.


1. The Landscape of Optimization: Gradient vs. Curvature

To find the minimum of a function, an algorithm must decide: Which direction to go? and How far to step?

1.1 First-Order Methods (The "Foggy Mountain" View)

Gradient Descent uses the first derivative (the gradient, \nabla f) to find the direction of steepest descent.

1.2 Second-Order Methods (The "Flashlight" View)

Newton's Method uses the gradient and the second derivative (the Hessian matrix, \mathbf{H}), which represents curvature.


2. Unconstrained Optimization: The Engines of AI

2.1 Adam and AdamW (The Memory-Heavy Standard)

Adam (Adaptive Moment Estimation) tracks both the average gradient (momentum) and the average squared gradient (uncentered variance).

2.2 2024 Breakthroughs: GaLore and DoRA


3. Constrained Optimization: The Geometry of Boundaries

Many problems have rules: "total weight must equal 1" (g(x) = 0) or "budget cannot be negative."

3.1 Lagrange Multipliers: The Tangency Condition

3.2 KKT Conditions: The Balance of Forces

The Karush-Kuhn-Tucker (KKT) conditions generalize Lagrange for inequality constraints (h(x) \le 0).


4. Convexity and Jensen's Inequality

A function is convex if it is "bowl-shaped" everywhere. Convex problems are the "holy grail" because any local minimum is guaranteed to be the global minimum.

4.1 Visualizing Jensen's Inequality

Jensen's Inequality states: E[f(X)] \ge f(E[X]).


5. Quantitative Foundation: Comparative Performance

OptimizerOrderMemory (7B Model)Conv. SpeedBest Use Case
SGD + Momentum1st~28 GBLinearVision / Simple Models
AdamW (32-bit)1st (Adap)56 GBFastGeneral NLP / LLMs
8-bit AdamW1st (Adap)14 GBFastConsumer Fine-tuning
GaLore (2024)1st (Adap)~19 GBFast7B Pre-training
L-BFGS2nd (Quasi)Very HighQuadraticScientific Computing

5.1 Learning Rate Schedulers

Finding the minimum is not just about the algorithm, but the "cooling" schedule.

See Also