Skip to content
  • Overview
  • Curriculum
    • FLUMental maths and numerical fluency
    • COMBCounting and combinatorics
    • PROBProbability
    • STATStatistics and inference
    • REGRegression and econometrics
    • TSTime series
    • LALinear algebra
    • SCStochastic calculus
    • MLMachine learning
      • 1Framework

        • The framework: bias, variance, capacity and dimensionality
      • 2Tree-based methods

        • Trees: bagging, random forests and gradient boosting
      • 3Other supervised methods

        • Other supervised methods: kNN, SVMs and the kernel trick
      • 4Unsupervised learning

        • Unsupervised learning: clustering assets and correlation structure
      • 5Model selection and evaluation

        • Why k-fold cross-validation is wrong on financial data
      • 6Optimisation for learning

        • Optimisation: gradient descent, momentum and Adam
      • 7Neural networks

        • Neural networks: backpropagation, and when they are the wrong tool
    • SIGAlpha and signal research
    • CASEResearch case studies

Practise

  • Question bank
  • Mental arithmetic
  • Market simulator
  • Arbitrage trees
  • Horse racing
  • Bid book
  • Screening tests
  • Mock papers

Reference

  • Formula reference
  • Search

Your record

  • Review queue
  • Progress
  • Leaderboard
  • Profile
  • Invite friends
AccountSend feedback
  1. Curriculum
  2. /Quantitative research
  3. /Machine learning
  4. /Optimisation for learning

Optimisation: gradient descent, momentum and Adam

ML · Chapter 6·11 min read·Asked at Two Sigma, Citadel, QuantCo, Jump

Assumes Unsupervised learning: clustering assets and correlation structure.

After this lesson you should be able to

  • Say why stochastic gradients are used rather than full-batch ones.
  • Explain what momentum and adaptive rates each fix.
  • Describe how convexity changes what convergence means.

Fitting a model means minimising a loss, and for anything beyond a closed form that means gradient descent. The variants all address the same two problems: the gradient is expensive to compute exactly, and the loss surface is badly scaled in different directions.

Equation 6.1

Stochastic gradient descent

Step downhill using the gradient computed on a small batch rather than on the whole dataset.

θt+1=θt−η ∇θL(θt;Bt)\theta_{t+1} = \theta_t - \eta\,\nabla_\theta L(\theta_t; \mathcal{B}_t)θt+1​=θt​−η∇θ​L(θt​;Bt​)
η\etaη
Learning rate — the single most important hyperparameter.
Bt\mathcal{B}_tBt​
A mini-batch. Its size trades gradient noise against computational efficiency.

Why the noisy gradient is better. The obvious objection is that a batch gradient is an approximation, so it must be worse. It is worse per step and far better per unit of computation: you can take a hundred noisy steps for the cost of one exact one, and a hundred noisy steps make much more progress. The noise also helps — it lets the iterate escape shallow local minima and saddle points, which full-batch descent would sit in forever. Approximation is the feature, not a compromise.

MethodProblem it addressesMechanism
MomentumOscillation across a narrow valleyAccumulate an exponentially weighted velocity
NesterovMomentum overshootingEvaluate the gradient at the look-ahead point
AdaGradParameters needing different step sizesDivide by the accumulated squared gradient
RMSPropAdaGrad’s step size decaying to zeroUse an exponentially weighted average instead
AdamBoth at onceMomentum plus RMSProp, with bias correction
Table 6.2 · What each variant fixes. Adam is the default because it needs the least tuning, not because it always converges to the best solution — plain SGD with a well-chosen schedule often generalises slightly better.

Proposition 6.3

What convexity buys

On a convex loss, any local minimum is global and gradient descent converges to it from any starting point — the problem is solved, and only the speed is in question. Ridge, lasso, logistic regression and SVMs are all convex. Neural networks are not, so the solution depends on initialisation and on the path taken, and "converged" means only that it stopped moving.

Holds when

  • Convexity is why classical statistical models have reproducible answers and deep models do not.
  • On a non-convex loss, different random seeds give genuinely different models — which is an argument for ensembling them.
0306000.51Gradient descentWith momentumIterationsError
Figure 6.4 · What momentum actually buys. On a quadratic with condition number 100100100, plain descent contracts by 0.9800.9800.980 a step and momentum by 0.8180.8180.818. The improvement is from κ\kappaκ to κ\sqrt{\kappa}κ​, which is why badly scaled features are worth fixing before the optimiser is.

The rest of this lesson is in Premium

You have read the opening. 10 more sections follow, including 4 worked examples and 3 quick checks.

Start the free 7-day trialSign in

Nothing is charged for 7 days, and you can cancel before then. Or read The law of large numbers and the central limit theorem in full, free.

← Why k-fold cross-validation is wrong on financial dataNeural networks: backpropagation, and when they are the wrong tool →
On this page
  • Stochastic gradient descent
  • What each variant fixes
  • What convexity buys
  • What momentum actually buys

QuantMax · 141 lessons · 1342 questions · c5c0caa

  • Premium
  • Arbitrage trees
  • Horse racing
  • Invite friends
  • Account
  • About QuantMax
  • Terms
  • Privacy

Firm names identify publicly reported question patterns and nothing more. QuantMax is not affiliated with, endorsed by, or recruiting for any firm named in the curriculum. Everything you do in lessons and the question bank is kept to your account.