MLCrack

    ML MATH & LINEAR ALGEBRA · INTERVIEW QUESTION

    What is the difference between convex and non-convex optimization? Why does it matter in deep learning?

    🟡 intermediate · Calculus & Optimization

    Hint: Think about guarantees on finding global optima vs local optima.

    Answer

    Convex optimization: any local minimum is a global minimum. Convergence additionally requires assumptions such as an attained minimum, appropriate smoothness and a suitable step-size rule. Convexity alone does not guarantee a particular algorithm converges.

    A function ff is convex if: f(λx+(1−λ)y)≤λf(x)+(1−λ)f(y)∀λ∈[0,1]f(\lambda x + (1-\lambda)y) \leq \lambda f(x) + (1-\lambda) f(y) \quad \forall \lambda \in [0,1]

    Non-convex problems (like deep learning) can have multiple local minima, saddle points, and plateaus.

    In practice:

    • Saddle points are more problematic than local minima in high dimensions
    • SGD with momentum helps escape saddle points
    • Some over-parameterized models have favorable optimization landscapes under specific assumptions; this is not a universal guarantee
    ConvexNon-Convex
    Local minimum globally optimal?Yes, on a convex feasible domainNot in general
    Local = Global✅ Yes❌ No
    Saddle points❌ None⚠️ Many
    ExamplesLinear regression, SVMNeural networks