← All questions
EvaluationMedium· NDCG· Differentiability· Optimization

Why can’t you just run gradient descent on NDCG?

A strong answer starts with the mechanism, not the label: NDCG depends on scores only through integer ranks, so its gradient is zero almost everywhere and undefined at the swap boundaries - nothing for an optimizer to follow. It then names both escapes: smooth the rank (SoftRank’s Gaussian scores plus the insertion recurrence), or keep the metric discrete and define the gradient by hand (LambdaRank’s delta-NDCG-scaled pairwise lambda). A weak answer simply says NDCG is non-differentiable and stops, failing to reveal knowledge of the different surrogate families.

Code playground (Python)