Optimization Function Classes
Convex Optimization Basics
Convex sets, convex functions, gradient descent convergence, strong convexity, and duality: the optimization foundation that every learning-theoretic result silently depends on.
Prerequisites
Learning position
Read this page in the graph.
optimization-function-classes | layer 1 | tier 1. This page has 9 direct prerequisites and 38 published dependents.
What next
Regularization TheoryThis is the first curated or graph-derived continuation from the current page.
Evidence badge
Source-grounded pageThis page has no public Lean mapping yet. Use the evidence page to inspect how claim status labels work.
Why This Matters
Many learning algorithms are implemented by solving an optimization problem. When you minimize empirical risk, fit a kernel SVM, train logistic regression, or tune a regularized linear model, you are running an optimization algorithm on a loss landscape. Convex optimization is the special case where this landscape has no local minima traps: every local minimum is global.
This is not a "separate" subject from learning theory. The convergence rate of your optimizer determines the computational cost of learning. The properties of your objective (smoothness, strong convexity) determine both how fast you can optimize and how well the result generalizes (via algorithmic stability). Optimization and generalization are entangled.
Mental Model
A convex function is a bowl: any line segment between two points on the graph lies above the graph. This means gradient descent, which always moves "downhill," will reach the bottom. The questions are:
- How fast? (convergence rate)
- How close to the true minimum? (optimization error)
- What properties of the function control the answers?
Formal Setup: Convex Sets and Functions
Convex Set
A set is convex if and only if for all and all :
Every point on the line segment between and stays in . Examples: balls, halfspaces, polyhedra, the probability simplex. Non-examples: the union of two disjoint balls, the set .
Convex Function
A function on a convex set is convex if and only if for all and :
Equivalently, lies below its chords. If the inequality is strict for and , is strictly convex.
First-Order Condition for Convexity
If is differentiable, then is convex if and only if for all :
This says: lies above every tangent hyperplane. The tangent at any point is a global lower bound on . This single inequality is the most useful characterization of convexity in practice.
Smoothness (L-smooth)
A differentiable function is -smooth if and only if is -Lipschitz:
Equivalently, for all :
Smoothness says the function does not curve too sharply. is the maximum curvature. This is the key property that makes gradient descent work: it guarantees that a gradient step of size makes sufficient progress.
Strong Convexity
A function is -strongly convex (with ) if and only if for all :
This says curves at least as much as a quadratic with curvature . Strong convexity implies a unique minimizer and gives:
Condition Number
The condition number of an -smooth, -strongly convex function is . It measures how "elongated" the level sets are. means the function is a perfect isotropic quadratic. Large means the function is badly conditioned: steep in some directions, flat in others.
The condition number controls the convergence rate of gradient descent: , so ill-conditioned problems converge slowly.
Gradient Descent
The gradient descent algorithm with step size :
Starting from , repeat until convergence. The step size is the single most important hyperparameter. Too large: diverge. Too small: crawl.
Main Theorems
GD Convergence for Smooth Convex Functions
Statement
If is convex and -smooth, then gradient descent with step size satisfies:
That is, the optimization error decreases as .
Intuition
Each gradient step with makes progress proportional to . Even when gradients become small near the optimum, the convexity of ensures that the iterates steadily approach . The rate means you need iterations to reach -accuracy.
Proof Sketch
Step 1 (Descent Lemma): By -smoothness, choosing gives:
Step 2: By convexity, .
Step 3: Track . By the update rule:
Combine using convexity: . Sum from to . The left side telescopes. Rearrange to get the bound.
Why It Matters
This is the baseline convergence result. The rate is slow: halving the optimality gap requires doubling the step count. To improve on this you need either (a) strong convexity, which gives a linear rate, or (b) acceleration, where Nesterov's method gives and matches the lower bound for first-order methods on smooth convex functions.
In ML, this rate determines the number of passes over the data needed to approximately solve the ERM problem.
Failure Mode
The bound scales with : bad initialization hurts. Also, the rate applies to the function value gap, not the parameter distance . For the parameter distance, you need strong convexity.
GD Convergence for Smooth and Strongly Convex Functions
Statement
If is -strongly convex and -smooth, then gradient descent with satisfies:
where is the condition number. The convergence is linear (exponential decrease): the error contracts by a factor per iteration.
Intuition
Strong convexity ensures that when you are far from , the gradient is large, so gradient descent makes large steps. When you are close, the gradient is small, but you do not need large steps. The exponential convergence rate means the number of iterations to reach -accuracy is , logarithmic in the target accuracy.
Proof Sketch
By the descent lemma: .
By strong convexity: .
Combining: .
Iterate: .
Replace with by smoothness.
Why It Matters
This is the standard convergence result for regularized ERM. Adding regularization makes any convex loss -strongly convex with . The condition number becomes , and the optimization converges in iterations.
This directly connects to algorithmic stability: the same strong convexity that gives fast optimization also gives stability parameter .
Failure Mode
Large condition number means slow convergence. For ridge regression with small regularization, can be enormous. Preconditioning or second-order methods can help, but at higher per-iteration cost.
Duality Preview
Every convex optimization problem has a dual problem. For the primal:
The Lagrangian is with . The dual problem is:
Weak duality: dual optimal value primal optimal value (always). Strong duality: equality holds (under constraint qualifications like Slater's condition).
Why does duality matter for ML?
- SVMs: the dual of the SVM problem is a quadratic program in the support vector coefficients, leading to the kernel trick
- Regularization: the dual of constrained ERM relates to regularized ERM (Lagrangian multiplier regularization parameter)
- Lower bounds: dual certificates provide provable lower bounds on the optimal value, enabling stopping criteria
Canonical Examples
Quadratic (least squares)
where . This is -smooth with and (if has full rank) -strongly convex with . The condition number is , the squared condition number of .
GD converges in steps. For well-conditioned , this is fast. For ill-conditioned (nearly collinear features), this is slow.
Logistic regression
is convex and smooth (but not strongly convex without regularization). Adding makes it -strongly convex. The smoothness constant depends on : the logistic loss has Lipschitz gradient with constant .
Non-smooth: Lasso
. The penalty is not smooth (not differentiable at ). Standard gradient descent does not apply directly. You need proximal gradient descent, which handles the smooth part with a gradient step and the non-smooth part with a "prox" operator. The prox of is soft-thresholding, and the resulting algorithm (ISTA) converges at rate .
Evidence Ladder for Optimization Claims
Optimization claims in ML papers often sound similar but require different evidence. A proof that the population objective is convex does not prove that the implemented training loop reaches the statistical optimum.
| Claim | Minimum supporting evidence | Common failure mode |
|---|---|---|
| Objective is convex | Hessian is positive semidefinite, or the loss is built from convex-preserving operations on a convex domain | Regularizer, constraint, or parameterization quietly makes the implemented objective nonconvex |
| Gradient descent converges | Smoothness constant , step-size rule, and the theorem's iterate assumptions are stated | Claimed rate uses while code uses Adam, momentum, clipping, or a scheduler |
| Strong-convex rate applies | Explicit -strong convexity or regularization plus a condition-number estimate | Loss is convex but not strongly convex because the design matrix is rank-deficient |
| Dual certificate proves near-optimality | Primal value, dual value, and feasibility gap are all reported at the same tolerance | Solver reports low training loss but violates constraints or has a loose duality gap |
| Optimization error is negligible for learning | Generalization bound, optimization gap, and statistical error are compared on the same scale | Training stops early and the remaining optimization gap is larger than the claimed statistical rate |
For TheoremPath pages, this table is the working standard: if a learning-theory argument cites an optimization result, it should name which row it needs rather than citing "convex optimization" generically.
From Theorem to Training Run
A convex theorem is not automatically an implementation certificate. The mathematical object in the proof and the object optimized in code must match. Use this checklist when reading an ML claim that cites convex optimization.
- Identify the actual objective. Is the optimized function the stated convex loss, or did the implementation add clipping, normalization, nonconvex parameterization, early stopping, or a learned feature map?
- Name the geometry constants. A convergence-rate claim should state the relevant , , condition number, diameter, or duality gap. If those quantities are unknown, the theorem is a guide, not a measured certificate.
- Separate optimizer family from theorem family. A rate for fixed-step gradient descent does not directly justify Adam, momentum, line search, stochastic minibatches, or gradient clipping. Those methods need their own assumptions or an empirical optimization-gap check.
- Report the right residual. Training loss is not the same as a primal-dual gap, constraint violation, gradient norm, or distance to . Pick the residual that matches the claim.
- Compare against statistical scale. In learning theory, the optimization gap only matters relative to estimation and approximation error. Solving the empirical problem to is wasted work if the statistical error is .
Kernel SVM as a clean convex case
The soft-margin SVM objective is convex in the margin weights, and its dual is a quadratic program with box constraints on the support-vector coefficients. A solver can therefore report both primal and dual values. If the primal-dual gap is below tolerance and the constraints are feasible, the optimization claim is auditable.
Neural-network cross-entropy is not a convex training problem
Cross-entropy is convex as a function of predicted class probabilities, but a deep network's predicted probabilities are a nonconvex function of its weights. The composed training objective can have saddles, flat directions, and multiple basins. Convex-loss facts still help analyze calibration or surrogate losses, but they do not prove that SGD found a global optimum of the neural-network training objective.
Worked Optimization Certificate
For a regularized logistic-regression or kernel-SVM claim, a useful certificate should connect the theorem to the run that produced the model. The following audit is stronger than "the loss went down."
| Certificate item | What to report | Why it matters |
|---|---|---|
| Objective identity | Exact loss, regularizer, constraints, feature map, and any clipping or normalization | The proof may apply to a different objective than the code |
| Step-size contract | Fixed step, line search, proximal step, or adaptive method, plus the theorem family it invokes | A fixed-step theorem does not certify Adam or scheduler behavior |
| First-order residual | Gradient norm, prox-gradient norm, or KKT residual at the returned iterate | Low training loss can still be far from stationarity |
| Dual evidence | Primal value, dual value, primal-dual gap, and constraint violation when a dual is available | The optimization gap is measurable rather than assumed |
| Statistical scale | Compare the optimization gap with the estimation error or validation uncertainty | Solving beyond the statistical error scale does not improve the learning claim |
The strongest statement is not "the optimizer converged" but "the measured optimization gap is below the statistical error scale for this learning problem." That is the point where optimization theory and learning evidence meet.
Common Confusions
Convexity is about the objective, not the model
A linear model trained with a non-convex loss has a non-convex optimization problem. A neural network trained with cross-entropy has a non-convex problem (because the model is non-linear in parameters, even though cross-entropy is convex in predictions). Convexity of the optimization landscape depends on the composition of loss and model.
Smoothness and strong convexity are separate properties
Smoothness bounds curvature from above ( does not curve too fast). Strong convexity bounds curvature from below ( curves at least a certain amount). A function can be smooth but not strongly convex (e.g., smoothed near ), or strongly convex but not smooth (e.g., ). You need both for the fast rate.
The step size 1/L is not always practical
The theoretical step size requires knowing exactly, which is often unknown. In practice, you use line search or adaptive step sizes (Adam, AdaGrad). The theory with gives a benchmark: this is the best GD can do, and practical methods should match or beat it.
Why Optimization is Not Separate from Learning Theory
The total error of a learning algorithm decomposes as:
The optimization error is the gap between what the algorithm actually finds and the true ERM minimizer. Convex optimization theory directly controls this third term. If you can solve the ERM problem to -accuracy in iterations, and each iteration takes time, the total computational cost of learning is .
Exercises
Problem
Prove that the function is -strongly convex and -smooth when is symmetric with eigenvalues in . What is the condition number?
Problem
How many gradient descent iterations are needed to reach accuracy on a -strongly convex, -smooth function with ? Compare with the merely convex case (same , ).
Problem
Show that adding regularization to a convex, -smooth function produces a function that is -strongly convex and -smooth. What is the new condition number?
Related Comparisons
References
Canonical:
- Boyd & Vandenberghe, Convex Optimization (2004), Chapters 2-3, 9
- Nesterov, Introductory Lectures on Convex Optimization (2004), Chapters 1-2
- Nocedal & Wright, Numerical Optimization (2006), Chapters 2-3, 11
- Bertsekas, Convex Optimization Algorithms (2015), Chapters 1-2
Current:
-
Bubeck, "Convex Optimization: Algorithms and Complexity" (2015), Foundations and Trends in Machine Learning, Sections 3-4
-
Bottou, Curtis, Nocedal, "Optimization Methods for Large-Scale Machine Learning" (2018), SIAM Review, Sections 4-6
Next Topics
Natural next steps from convex optimization:
- Regularization theory: how regularization connects optimization to generalization
- Kernels and RKHS: convex optimization in infinite-dimensional function spaces
- Online convex optimization: extending convex optimization to sequential, adversarial settings
Last reviewed: July 3, 2026
Canonical graph
Required before and derived from this topic
These links come from prerequisite edges in the curriculum graph. Editorial suggestions are shown here only when the target page also cites this page as a prerequisite.
Required prerequisites
9- Common Inequalitieslayer 0A · tier 1
- Continuity in Rⁿlayer 0A · tier 1
- Differentiation in Rⁿlayer 0A · tier 1
- Dynamic Programminglayer 0A · tier 1
- Matrix Operations and Propertieslayer 0A · tier 1
Derived topics
38- Maximum A Posteriori (MAP) Estimationlayer 0B · tier 1
- Activation Functionslayer 1 · tier 1
- Gradient Descent Variantslayer 1 · tier 1
- K-Means Clusteringlayer 1 · tier 1
- Logistic Regressionlayer 1 · tier 1
+33 more on the derived-topics page.
Graph-backed continuations