Non-convex optimization

Also known as: nonconvex optimization

On this page 7

Non-convex optimization is the problem of minimizing or maximizing an objective function that is not convex, or doing so over a feasible region that is not a convex set, so that a local optimum need not be the global optimum. In artificial intelligence it is the normal case rather than the exception: training a deep neural network, fitting a mixture model or tuning a policy in reinforcement learning are all non-convex optimization problems.

Within mathematical optimization, the convex case offers guarantees of global optimality and reliable solvers. Non-convex problems give up those guarantees, and practitioners compensate with good initialization, stochastic methods, overparameterization and careful empirical validation.

What makes an optimization problem non-convex

A problem is non-convex when either the objective or the constraint set breaks convexity. A convex function lies below every chord between two of its points; a non-convex function can bend upward and downward, creating multiple valleys, ridges and flat plateaus. A convex set contains every line segment between its members, while a non-convex set may have holes, gaps or disconnected pieces.

The practical consequence is that first-order optimality conditions are only necessary, not sufficient. A zero gradient can mark a local minimum, a local maximum or a saddle point, and the Hessian matrix is needed to tell these apart. Even with second-order information, nothing certifies that a found minimum is the best one in the whole space.

The table below summarizes the typical sources of non-convexity encountered in machine learning and related fields.

SourceWhere it appearsEffect on the landscape
Composition of nonlinear layersDeep neural networksMany equivalent minima and saddle points
Weight-space symmetryPermutable hidden unitsIdentical minima repeated many times
Integer or binary variablesScheduling, routing, pruning masksDisconnected feasible region
Latent variablesMixture models, matrix factorizationSeveral local optima of the likelihood
Nonconvex penaltiesL0 sparsity, SCAD, MCPKinks and isolated sparse solutions
Common sources of non-convexity

Local optima, saddle points and the loss landscape

The loss landscape is the surface the objective draws over parameter space, and its geometry determines how hard the problem is. Three kinds of critical points matter: local minima, where every direction goes up; saddle points, where some directions go up and others go down; and flat regions, where the gradient is nearly zero over a wide area.

In high-dimensional models the saddle points vastly outnumber poor local minima. Theoretical and empirical studies of deep networks suggest that most local minima reached by training have loss values close to the global minimum, while saddle points and plateaus are the real cause of slow progress. Gradient noise and momentum help optimizers escape strict saddles in practice.

Critical pointHessian signatureTypical optimizer behavior
Global minimumPositive semidefiniteDesired endpoint, rarely certifiable
Poor local minimumPositive semidefiniteTrap; restarts or noise may help
Strict saddle pointAt least one negative eigenvalueEscaped by noise or curvature steps
Degenerate plateauMany near-zero eigenvaluesSlow progress, apparent stagnation
Critical points and how optimizers treat them

A frequent observation is that wide, flat minima generalize better than sharp ones, although the measure of sharpness depends on parameterization and remains an active research question.

Methods used for non-convex problems

No single algorithm solves general non-convex problems efficiently, because the class includes NP-hard problems. Methods therefore trade guarantees against scalability. Local methods find stationary points quickly, global methods search more broadly at higher cost, and relaxations replace the problem with a convex surrogate.

Method familyGuaranteeTypical scaleUse in AI
Stochastic gradient descent and AdamStationary point in expectationBillions of parametersNeural network training
Second-order and quasi-Newton methodsLocal minimum under assumptionsThousands to millionsSmaller models, fine-tuning
Branch and boundCertified global optimumHundreds to thousands of variablesVerification, mixed-integer models
MetaheuristicsNone, only empiricalSmall to mediumArchitecture and design search
Bayesian optimizationAsymptotic, sample-efficientTens of dimensionsHyperparameter search
Convex relaxationBound on the true optimumProblem-dependentSparse recovery, robustness bounds
Method families compared

Common enhancements include random restarts, learning-rate schedules with warmup, momentum, gradient clipping and simulated annealing-style noise. Each changes which basin the optimizer settles in rather than guaranteeing the best basin.

Non-convex optimization compared with convex optimization

The central difference is that convex optimization equates local and global solutions, while non-convex optimization does not. This one property changes solver design, error analysis and how results should be reported, as the following comparison shows.

AspectConvex optimizationNon-convex optimization
Local versus globalEvery local optimum is globalLocal optima may be far from global
Optimality conditionsKKT conditions sufficientKKT conditions only necessary
Dependence on initializationNone for the final valueStrong; results vary between runs
Duality gapUsually zeroOften positive
Typical AI examplesLogistic regression, SVM trainingDeep learning, k-means, matrix factorization
Convex and non-convex problems side by side

Because of this, reporting results over several random seeds is standard practice for non-convex models, and a single training run should never be treated as evidence of the best achievable result.

Practical guidance, limitations and common mistakes

Success with non-convex problems depends more on problem formulation and engineering discipline than on any single solver. The most reliable habits are the following.

  • Reformulate when possible: a convex surrogate or a convex subproblem often gives a strong starting point.
  • Initialize with care: scaled initializations such as Xavier or He keep gradients usable in deep networks.
  • Run multiple seeds and report the spread, not only the best score.
  • Monitor gradient norms to distinguish saddle stagnation from true convergence.
  • Do not assume a global optimum when an approximate solution is presented as certified.

The main limitation is that certifying global optimality is generally intractable. Global solvers scale poorly, and local methods cannot confirm that a better solution does not exist. Treating a stalled loss curve as convergence, or comparing two models from single runs, are the most common analytical mistakes.

In plain words

Imagine looking for the lowest point in a mountain range while standing in fog. You can only feel the slope under your feet. In a single smooth bowl, walking downhill always brings you to the bottom. That is the easy, convex case.

A non-convex problem is a landscape with many valleys. Walking downhill takes you to the bottom of the nearest valley. That valley may not be the deepest one. Training modern AI models means searching such landscapes. In practice, the valleys found are usually good enough, but nobody can promise they are the best.

A real-world example

A machine learning team trains an image classification network with about 25 million parameters on a product catalog. The loss is non-convex, so the team runs five training runs with different random seeds using stochastic gradient descent with momentum, a cosine learning-rate schedule and a short warmup.

Validation accuracy ranges from 91.8 to 92.6 percent across seeds. One early run stalled on a plateau for several epochs; the gradient norm log showed it was a saddle region, and a larger warmup fixed the issue. The team reports the mean and standard deviation rather than the single best run, and the deployed model is chosen on a separate test set. The outcome is a reproducible model whose quality is honestly quantified, despite the absence of any global optimality guarantee.