When would you choose L-BFGS over mini-batch gradient descent?

Quick Overview

Asks when a quasi-Newton optimizer such as L-BFGS is a better choice than mini-batch gradient descent or Adam. Tests understanding of curvature estimates, line searches, gradient noise, dataset scale and the practical cost of each optimizer.

When would you choose L-BFGS over mini-batch gradient descent?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

When would you choose `L-BFGS` over mini-batch gradient descent? Compare it with mini-batch methods such as SGD with momentum or Adam. ```hint What L-BFGS builds from each step Think about what L-BFGS stores from consecutive iterates and gradients, and what its line search compares. What happens to both when every gradient comes from a different random batch? ``` ```hint Cost per step Compare the cost of one full-batch gradient with the number of updates each method makes as the dataset grows. ``` ### What a Strong Answer Covers - The properties of the problem (smoothness, size, determinism, parameter count, required precision) that favor each method. - Why stochastic gradients cause trouble for L-BFGS in particular. - Concrete models or tasks on each side. - Practical differences in tuning, memory and framework usage. - How the choice affects generalization in deep learning. ### Follow-up Questions - How does L-BFGS approximate the inverse Hessian, and what does the history size control? - Why does PyTorch's `torch.optim.LBFGS` take a closure, and how should dropout or batch norm be handled inside it? - How would you combine Adam and L-BFGS in one training run, and when is that worth doing? - How would you handle bound constraints on the parameters?

Overview: Asks when a quasi-Newton optimizer such as L-BFGS is a better choice than mini-batch gradient descent or Adam. Tests understanding of curvature estimates, line searches, gradient noise, dataset scale and the practical cost of each optimizer.

Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

When would you choose L-BFGS over mini-batch gradient descent? Compare it with mini-batch methods such as SGD with momentum or Adam.

What a Strong Answer Covers Guidance

  • The properties of the problem (smoothness, size, determinism, parameter count, required precision) that favor each method.
  • Why stochastic gradients cause trouble for L-BFGS in particular.
  • Concrete models or tasks on each side.
  • Practical differences in tuning, memory and framework usage.
  • How the choice affects generalization in deep learning.

Follow-up Questions Guidance

  • How does L-BFGS approximate the inverse Hessian, and what does the history size control?
  • Why does PyTorch's torch.optim.LBFGS take a closure, and how should dropout or batch norm be handled inside it?
  • How would you combine Adam and L-BFGS in one training run, and when is that worth doing?
  • How would you handle bound constraints on the parameters?