Optimization
Optimization is finding the best solution of an objective function, its maximum or minimum. In machine learning it is the engine of training: adjusting a model's parameters to minimize its error. We explain what an objective function is, the difference between convex and non-convex problems, gradient descent and its variants, and why the global optimum is not always reached.
Optimization is finding the best possible solution of an objective function—its maximum or minimum value—perhaps subject to constraints that delimit which solutions are admissible. It is a general mathematical idea, but in artificial intelligence it holds a central place: training a model is, literally, an optimization problem. A loss function is defined that measures how wrong the model is, and training consists of adjusting its parameters to minimize it.
The ingredients
Every optimization problem has three pieces: an objective function (or cost, or loss) to be minimized or maximized; decision variables that can be adjusted—in a model, its weights—; and, sometimes, constraints that bound the region of valid solutions. A solution that respects the constraints is “feasible”; among the feasible ones, the one that optimizes the objective function is the “optimal” one.
Convex and non-convex
The most important distinction is this. In a convex problem, every local minimum is also the global minimum: there are no traps, and it can be solved with guarantees. Training neural networks, by contrast, is non-convex: by chaining linear transformations with nonlinear activation functions, the loss landscape fills with valleys, and the optimizer may stop at a local minimum that is not the best.
Gradient descent
The dominant method in deep learning is gradient descent: it computes the slope (the gradient) of the loss with respect to each parameter and takes a small step in the direction that reduces it, repeating until convergence. It has variants depending on how much data it uses per step: stochastic gradient descent (SGD), which uses a single example, and mini-batch, which uses small batches and is the standard. On top of them, adaptive optimizers such as Adam (Kingma and Ba, 2015) are built, which adjust each parameter's step by combining information from recent gradients.
No guarantee of the global optimum
Non-convex problems carry no guarantee of reaching the global minimum. The result depends on the objective, starting point and method; a good numerical solution does not prove it is the best possible one.
Pieces using this term
- A Solver Can Perfectly Solve the Wrong Problem (2026-07-25)
- How to read a PyTorch attention trace before optimizing it (2026-07-24)
- South Dakota wants one AI platform for all its universities: what the documents say and what they don't (2026-07-23)
- Sixteen Claude Agents and a C Compiler: What Made the Experiment Possible (2026-07-19)
- Musk Envisions AI-Generated Binaries: Who Can Audit What We Run? (2026-07-14)
- Gemma 4 12B: Google's multimodal model designed for laptops (2026-07-11)
- Apple proposes fine-tuning models without losing sight of what they know (2026-06-01)
- Anthropic ties together capital, cloud, and chips without making them one deal (2025-11-18)
This article was produced with artificial intelligence under human editorial oversight.