Skip to content

Remove unbiased LambdaRank - #12456

Draft
RAMitchell wants to merge 2 commits into
dmlc:masterfrom
RAMitchell:codex/remove-unbiased-lambdarank
Draft

Remove unbiased LambdaRank#12456
RAMitchell wants to merge 2 commits into
dmlc:masterfrom
RAMitchell:codex/remove-unbiased-lambdarank

Conversation

@RAMitchell

Copy link
Copy Markdown
Member

Summary

  • remove the unbiased LambdaRank implementation and its learned position-bias state from CPU and CUDA paths
  • retain lambdarank_unbiased as a compatibility parameter that warns once and falls back to standard LambdaRank
  • remove the unbiased demo and parameter-generation coverage, and update Python, R, and tutorial documentation
  • replace unbiased behavior tests with fallback and legacy model-config loading coverage

Motivation

Unbiased LambdaRank makes the objective stateful by learning and serializing position-bias vectors. This complicates model I/O, checkpoint/resume behavior, cache dimensions, and parameter changes. Removing the implementation simplifies LambdaRank ahead of separating its CPU and GPU kernels while preserving compatibility for existing configurations.

Closes #12302.

User impact

Setting lambdarank_unbiased=true no longer enables unbiased LambdaRank. XGBoost emits a warning and trains with standard LambdaRank. Existing saved configurations containing the parameter or the old bias vectors continue to load.

Validation

  • CPU testxgboost build
  • ./build/testxgboost --gtest_filter="LambdaRank.*:NDCGCache.*" (9 tests passed)
  • affected CUDA objective and test translation units compiled
  • pre-commit hooks and repository-rooted C++ header lint
  • git diff --check

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes stateful unbiased LambdaRank while preserving lambdarank_unbiased as a warning-and-fallback compatibility option.

Changes:

  • Removes CPU/CUDA position-bias state and kernels.
  • Adds fallback and legacy-config tests.
  • Updates demos and Python/R documentation.
  • XGBoost4J-Spark parameters remain outdated and require changes.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/common/ranking_utils.h Removes bias parameters and cache state.
src/objective/lambdarank_obj.h Simplifies shared gradient interfaces.
src/objective/lambdarank_obj.cuh Removes CUDA bias inputs.
src/objective/lambdarank_obj.cc Implements warning and standard-ranking fallback.
src/objective/lambdarank_obj.cu Removes CUDA unbiased calculations.
tests/cpp/objective/test_lambdarank_obj.h Updates test declarations.
tests/cpp/objective/test_lambdarank_obj.cc Tests fallback and legacy loading.
tests/cpp/objective/test_lambdarank_obj.cu Updates CUDA tests.
tests/cpp/plugin/test_sycl_lambdarank_obj.cc Updates SYCL fallback test.
tests/python/test_ranking.py Removes unbiased behavior test.
python-package/xgboost/testing/params.py Removes unbiased generated parameters.
R-package/R/xgb.train.R Updates R parameter API documentation.
R-package/man/xgb.params.Rd Regenerates R documentation.
doc/parameter.rst Documents compatibility fallback.
doc/tutorials/learning_to_rank.rst Documents feature removal and alternative.
demo/guide-python/learning_to_rank.py Removes click-debiasing demo.
Files not reviewed (1)
  • R-package/man/xgb.params.Rd: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/common/ranking_utils.h
@trivialfis

Copy link
Copy Markdown
Member

I'm not quite sure about this yet. The state seems quite trivial to fix.

@RAMitchell

Copy link
Copy Markdown
Member Author

There are a couple more issues:

  • What happens if the dmatrix changes during training?
  • What happens when you slice the model?

Stateful objectives break everything.

@trivialfis

trivialfis commented Aug 14, 2026

Copy link
Copy Markdown
Member

Both issues are about training continuation:

  • Training continuation with a different DMatrix.
  • Slice the model then continue training?

Does it make sense to do such things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider deprecating/removing lambdarank_unbiased due to stateful objective and model-IO complexity

3 participants