convexity
/ kon-VEK-suh-tee /
A convex function is one shaped like a single smooth bowl: pick any two points on its curve, stretch a straight string between them, and the string never dips below the curve. The everyday consequence is wonderful — there is exactly one lowest point, and no false bottoms to trap you. Wherever you stand, walking downhill always leads to the one true minimum. A non-convex function, by contrast, is a rugged mountain range full of local dips that each look like the bottom but are not.
This 'one bowl, no traps' property is the dream of anyone doing optimization, which is the art of finding the lowest (or highest) point of a function. With a convex problem, simple downhill methods are guaranteed to find the global best answer, and they get there efficiently. You never have to wonder whether a better solution is hiding somewhere you did not look — convexity promises there isn't one.
Classic machine learning methods like linear regression, logistic regression, and support vector machines are built to be convex precisely so their training is reliable and reproducible: run it twice, get the same answer. But here is the candid truth about deep learning — neural networks are emphatically not convex. Their error landscapes are wildly rugged, riddled with countless valleys and saddle points, and there is no guarantee gradient descent finds the very best one. The pleasant surprise of the last decade is that, in these enormous landscapes, many of the 'good enough' valleys turn out to work remarkably well in practice — which is why deep learning succeeds despite forfeiting the comfort of convexity.
The parabola y = x² is convex: any chord you draw between two points on it floats above the curve, and there is a single bottom at x = 0. Now picture a wavy curve with several dips of different depths — that is non-convex. Start a downhill walk in the wrong place and you get stuck in a shallow dip, never reaching the deepest one.
Convex: one bowl, downhill always wins. Non-convex: a rugged range where you can get trapped in a shallow dip.
Convexity guarantees that 'downhill leads to the global best,' which is why classic methods are so dependable — but deep neural networks are not convex, so gradient descent only ever promises a good-enough valley, not the deepest one in existence.