← Back to Classic ML Mind Map
📊 Classic MLID: learning-to-rank

Learning to Rank

排序学习 LTR
🎯Core Definition
Learning to Rank formulates "score and order the candidate set for a query" as supervised learning in three paradigms: Pointwise regresses/classifies each document independently (e.g. CTR prediction) with no regard for relative order; Pairwise converts ranking into document-pair binary classification (document ii should rank above jj), e.g. RankNet and RankSVM, covering only local pairwise relations; Listwise optimizes a whole-list ranking metric directly, e.g. ListNet and LambdaRank. LambdaMART = GBDT + LambdaRank is the de-facto standard for tabular ranking. For each pair (i,j)(i, j) it defines the Lambda gradient: λij=−σΔNDCG1+eσ(si−sj)\lambda_{ij} = -\frac{\sigma \Delta NDCG}{1 + e^{\sigma(s_i - s_j)}}, where si,sjs_i, s_j are current scores, ΔNDCG\Delta NDCG is the NDCG change from swapping ii and jj, and σ\sigma controls the sigmoid steepness; the negative sign moves toward improving NDCG — a non-differentiable ranking metric weighting a differentiable pairwise gradient. Each document accumulates λi=∑jλij\lambda_i = \sum_j \lambda_{ij}, which the regression trees directly fit.
💡Use Cases
the core of search, recommendation and ad ranking; interview questions like "compare Pointwise/Pairwise/Listwise" or "where does LambdaMART's λ come from"; in practice, LightGBM/XGBoost rank objectives (lambdarank) train directly and position-sensitive metrics such as NDCG/MRR evaluate the result.
⚡Key Problems Solved
Pointwise optimizes per-item error and ignores order (errors near the top cost more); Pairwise only handles pairwise relations and treats "1→2" and "99→100" equally; Listwise/LambdaMART uses ΔNDCG\Delta NDCG so the training objective matches the online metric — the higher the position and the more relevant the document, the larger the gradient weight — directly optimizing the non-differentiable NDCG.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Learning to Rank.
Use Cases
In production engineering, what are the primary use cases for Learning to Rank and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Compare Pointwise / Pairwise / Listwise: objective function, pros/cons and representative algorithms for each?
2
Write the LambdaMART gradient λij=−σΔNDCG1+eσ(si−sj)\lambda_{ij} = -\frac{\sigma \Delta NDCG}{1 + e^{\sigma(s_i - s_j)}}; explain the roles of ΔNDCG\Delta NDCG and σ\sigma, and why the negative sign?
3
Why does LambdaMART turn the non-differentiable NDCG into a differentiable regression target? What exactly does each GBDT tree fit?
4
How is LambdaRank's λ derived from RankNet's pairwise loss gradient?
5
Why use NDCG/MRR/GAUC instead of AUC for ranking? What is the essential difference from classification metrics?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Learning to Rank"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardData Drift & PSI

🔗 More Classic ML Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/ML/card/learning-to-rank
中文速览与面试要点

排序学习 LTR (Learning to Rank)

定义: 排序学习(Learning to Rank)把“给 query 的候选集打分排序”建模为监督学习,三类范式: Pointwise 逐文档回归/分类(如 CTR 预估),只拟合单个文档与相关性的关系,完全不看相对顺序;Pairwise 把排序转为文档对二分类(文档 i 应排在 j 前),代表 RankNet、RankSVM,损失只覆盖局部两两关系;Listwise 直接以整个列表为单位优化排序指标,代表 ListNet、LambdaRank。LambdaMART = GBDT + LambdaRank,是工业界 tabular 排序的事实标准,对每个文档对 (i, j) 定义 Lambda 梯度: _ij = - NDCG1 + e^ (s_i - s_j),其中 s_i, s_j 为当前得分、 NDCG 是交换 i, j 位置引起的 NDCG 变化量、 控制 sigmoid 陡峭度;负号表示沿提升 NDCG 的方向更新——用不可导的排序指标变化量为可导的 pairwise 梯度加权,每个文档累积 _i = _j _ij,回归树直接拟合该目标。 使用场景: 搜索引擎、推荐、广告排序的核心技术;面试常问“Pointwise/Pairwise/Listwise 区别”“LambdaMART 的 λ 是怎么来的”;工程上用 LightGBM/XGBoost 的 rank 目标(lambdarank)直接训练,评估用 NDCG/MRR 等位置敏感指标。 解决的问题: Pointwise 优化单点误差、无视顺序(位置越靠前错误代价越大);Pairwise 只处理两两关系,对“排名 1→2”和“排名 99→100”一视同仁;Listwise/LambdaMART 用 NDCG 让优化目标逼近线上指标——排名越靠前、文档越相关,梯度权重越大,从而直接优化不可导的 NDCG。

核心要点

  • 对比 Pointwise / Pairwise / Listwise 三类范式: 各自的目标函数、优缺点与代表算法?
  • 写出 LambdaMART 的梯度 _ij = - NDCG1 + e^ (s_i - s_j),解释 NDCG 与 的作用,以及负号的含义?
  • 为什么说 LambdaMART 把不可导的 NDCG 变成了可导的回归目标?GBDT 每棵树拟合的到底是什么?
  • RankNet 的 pairwise 损失与 LambdaRank 的 λ 是什么关系(λ 如何从 RankNet 梯度推导出来)?
  • 排序任务为什么用 NDCG/MRR/GAUC 而不是 AUC?位置敏感性与分类指标的本质区别是什么?