Gradient Descent Questions with Answers

11 practice questions on Gradient Descent (Machine Learning) with answers and step-by-step solutions. Try 10 samples below, then practise all 11 free in the AptiNest app.

Sample questions

Question 1Easy

In gradient descent, a learning rate that is too large can cause

  1. Guaranteed convergence in one step
  2. The loss to oscillate or diverge
  3. Zero gradient at start
  4. Overfitting on the test set

Answer: B. The loss to oscillate or diverge

Explanation

Big steps overshoot the minimum and may bounce around or blow up.

Step-by-step solution

  1. Update = w - lr * gradient.
  2. Large lr overshoots.
  3. Loss oscillates or diverges.

Why the other options are wrong

  • A. Large steps usually overshoot.
  • C. The gradient depends on the loss surface, not the step.
  • D. The learning rate does not touch the test set.

Question 2Easy

The gradient descent update rule for a weight w is

  1. w = w - learning_rate * dLoss/dw
  2. w = w + learning_rate * dLoss/dw
  3. w = w * dLoss/dw
  4. w = dLoss/dw

Answer: A. w = w - learning_rate * dLoss/dw

Explanation

We move opposite to the gradient to reduce the loss.

Step-by-step solution

  1. Gradient descent reduces loss by moving against the gradient direction.
  2. Update rule subtracts learning rate multiplied by derivative of loss.
  3. Correct formula is w = w - learning_rate * dLoss/dw.
  4. This ensures weight adjustment in direction opposite to steepest increase.
  5. Final answer: w = w - learning_rate * dLoss/dw.

Why the other options are wrong

  • B. Adding the gradient moves the weight uphill and raises the loss; gradient descent subtracts it.
  • C. Multiplying the weight by the gradient is not the update rule; the step is a subtraction.
  • D. Setting w to the gradient ignores the current weight and the learning rate.

Tip: Remember: Gradient descent moves in direction opposite to gradient to reduce loss.

Question 3Medium

For loss (w-5)^2, w = 1 and learning rate 0.25, the updated w is

  1. 2
  2. 5
  3. 3
  4. -1

Answer: C. 3

Explanation

Gradient = 2(w-5) = -8. w = 1 - 0.25*(-8) = 3.

Step-by-step solution

  1. The loss is (w - 5)^2, so its derivative is 2 (w - 5).
  2. At w = 1 the derivative is 2 × (1 - 5) = -8.
  3. Update: w = 1 - 0.25 × (-8) = 1 + 2 = 3, option C.

Why the other options are wrong

  • A. This comes from dropping the factor 2; the derivative is 2 (w - 5) = -8, not -4.
  • B. 5 is the target value, and one step of size 0.25 does not jump straight to it.
  • D. Gradient descent subtracts the step, so w moves up from 1 to 3, not down to -1.

Tip: Gradient descent: new w = w - learning rate × derivative. Keep the factor from the power rule.

Question 4Medium

With 10,000 samples, a mini-batch size of 100 means each epoch has how many updates?

  1. 10,000
  2. 100
  3. 1
  4. 1,000,000

Answer: B. 100

Explanation

Updates per epoch = N / batch size = 10000/100 = 100.

Step-by-step solution

  1. N = 10000, batch = 100.
  2. Batches per epoch = N / batch.
  3. = 100 updates.

Why the other options are wrong

  • A. That is one update per sample (SGD).
  • C. That is full-batch gradient descent.
  • D. Multiplies instead of dividing.

Question 5Medium

A learning rate that is too large typically causes

  1. very slow but guaranteed convergence
  2. divergence or oscillation around the minimum
  3. zero gradient immediately
  4. lower variance

Answer: B. divergence or oscillation around the minimum

Explanation

Big steps can overshoot the minimum repeatedly, so the loss may bounce or blow up.

Step-by-step solution

  1. Large learning rate makes updates too big.
  2. Updates may overshoot the minimum repeatedly.
  3. This causes divergence or oscillation around the minimum.
  4. Final answer: divergence or oscillation around the minimum.

Why the other options are wrong

  • A. A large learning rate causes overshooting, so convergence is not slow or guaranteed.
  • C. A large learning rate does not make the gradient zero; the gradient is the slope at the point.
  • D. The learning rate does not set variance; a large rate makes training unstable instead.

Tip: High learning rate = unstable updates, low learning rate = slow progress.

Question 6Medium

For f(x) = x^2, starting at x = 3 with learning rate 0.1, the value of x after one gradient descent step is

  1. 2.7
  2. 0.6
  3. 3.6
  4. 2.4

Answer: D. 2.4

Explanation

Gradient = 2x = 6. x = 3 - 0.1*6 = 2.4.

Step-by-step solution

  1. Gradient of f(x) = x^2 is 2x = 6.
  2. Update rule: x = 3 - 0.1 * 6 = 2.4.
  3. New value of x after one step is 2.4.
  4. Final answer: 2.4.

Why the other options are wrong

  • A. 2.7 would need a step of 0.3; the gradient 6 times 0.1 gives a step of 0.6, so x is 2.4.
  • B. 0.6 is the size of the step, not the new x; subtracting 0.6 from 3 gives 2.4.
  • C. 3.6 adds the step instead of subtracting it; gradient descent moves against the gradient.

Tip: Use formula x = x - learning_rate * gradient.

Question 7Medium

Momentum in optimisers helps by

  1. Removing the learning rate
  2. Randomly shuffling the data before every single epoch
  3. Making the loss convex
  4. Accumulating past gradients to speed movement along consistent directions and dampen oscillations

Answer: D. Accumulating past gradients to speed movement along consistent directions and dampen oscillations

Explanation

Momentum keeps a running velocity so steps build up along steady slopes and cancel across noisy ones.

Step-by-step solution

  1. Keep a velocity term.
  2. Add each new gradient to it.
  3. Move along the velocity.

Why the other options are wrong

  • A. The learning rate is still needed.
  • B. Shuffling is a separate step.
  • C. Momentum does not change the loss surface.

Question 8Medium

Compared with batch gradient descent, stochastic gradient descent (SGD)

  1. Updates weights using one sample at a time, giving noisy but frequent updates
  2. Uses the whole dataset for every update
  3. Needs no learning rate
  4. Always finds the global minimum because of its random steps

Answer: A. Updates weights using one sample at a time, giving noisy but frequent updates

Explanation

SGD estimates the gradient from one example, making each step cheap but noisy.

Step-by-step solution

  1. Pick one sample.
  2. Compute its gradient.
  3. Update immediately.

Why the other options are wrong

  • B. That is batch gradient descent.
  • C. SGD still has a learning rate.
  • D. Noise helps escape but gives no guarantee.

Question 9Hard

For a convex loss function, gradient descent with a suitably small learning rate

  1. May get stuck in many bad local minima
  2. Cannot converge
  3. Converges towards the global minimum
  4. Needs the Hessian to be zero

Answer: C. Converges towards the global minimum

Explanation

Any local minimum of a convex function is also global, so descent reaches it.

Step-by-step solution

  1. Convex = bowl-shaped.
  2. Only one basin.
  3. Descent heads to the bottom.

Why the other options are wrong

  • A. Convex functions have no bad local minima.
  • B. It converges under a suitable step size.
  • D. No such requirement.

Question 10Hard

For a convex loss such as the MSE of linear regression, gradient descent with a suitably small learning rate

  1. converges toward the global minimum
  2. can only reach a local minimum that is not global
  3. never converges
  4. needs random restarts to find the minimum

Answer: A. converges toward the global minimum

Explanation

A convex function has no non-global local minima, so a proper step size reaches the global minimum.

Step-by-step solution

  1. MSE is a convex loss function.
  2. Gradient descent on convex functions moves toward the global minimum.
  3. Small learning rate ensures convergence without overshooting.
  4. No local minima exist in convex functions.
  5. Thus, gradient descent converges toward the global minimum.

Why the other options are wrong

  • B. A convex loss such as MSE has no local minima other than the global one, so this is wrong.
  • C. With a suitable learning rate, gradient descent on a convex loss does converge.
  • D. Random restarts are unnecessary for convex losses, since any minimum found is the global one.

Tip: In convex problems, gradient descent finds the global minimum if learning rate is small enough.

Practise all 11 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Machine Learning topics · All topics