Use bounded-step curvature for Tweedie objectives - #12538
Open
RAMitchell wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The broad training-behavior change and its mathematical split-gain guarantees warrant final human validation.
Pull request overview
Updates Poisson, Tweedie, and Gamma objectives to use bounded-step pseudo-Hessian curvature while retaining exact gradients and existing APIs.
Changes:
- Implements family-consistent bounded curvature across all three objectives.
- Removes the obsolete
GammaDeviancewrapper. - Updates gradient-pair expectations and adds Tweedie’s Poisson-endpoint coverage.
File summaries
| File | Description |
|---|---|
src/objective/poisson_obj.h |
Applies bounded Poisson curvature. |
src/objective/tweedie_obj.h |
Implements generalized Tweedie curvature. |
src/objective/gamma_obj.h |
Applies Gamma endpoint curvature and simplifies helpers. |
src/objective/gamma_obj.cc |
Inlines removed wrapper functionality. |
tests/cpp/objective/test_regression_obj.cc |
Updates expected Hessians and tests power 1. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The Poisson, compound Poisson-Gamma Tweedie, and Gamma objectives form one continuous power-variance family under the log-mean parameterization.
The Taylor Hessian can produce very large leaf updates when its local curvature is small. The bounded Halley curvature added to Poisson in #12431 fixes the leaf-update instability, but its ordinary
G^2/Hscore can still overestimate the loss reduction used to justify a split.This PR uses a bounded-step pseudo-Hessian across the complete Poisson-Tweedie-Gamma segment. It retains the exact gradient and does not change the tree builder, leaf formula, split-gain formula, or public parameters.
Proposed curvature
Let
The exact gradient and proposed curvature are
The endpoints are:
count:poissonw * (y + 2*mu) / 3reg:tweediew * (p*y*mu^(1-p) + (3-p)*mu^(2-p)) / 3reg:gammaw * (2*y/mu + 1) / 3At
p=1.5, this is exactly the existing Taylor Hessian.Derivation and guarantees
For one leaf, put
A=sum(A_i),B=sum(B_i), andR=A/B. The exact constant-leaf optimum islog(R). For an affine row-additive curvatureH_c=c*A+(1-c)*B, the quadratic reduction in loss units isCalibrating this expression to the exact optimized leaf-loss reduction through cubic order uniquely gives
c=p/3and the curvature above.For nonnegative labels and weights,
1 <= p <= 2, and the unregularized full-step problem:abs(d) <= 3;0 < eta <= 1;The last property is important for XGBoost: the curvature controls both the leaf update
-G/Hand split scoreG^2/H. This is an optimized-score guarantee, not a claim that the quadratic is a pointwise MM majorizer.Previous synthetic results
A paired stress study evaluated powers
{1, 1.1, 1.5, 1.9, 2}, four signal/initialization conditions, and 30 datasets per condition. Each method trained 50 depth-three histogram trees witheta=1,min_child_weight=0, and all regularization disabled.The values below are median round-50 mean unit deviance divided by round-zero deviance; lower is better. "Taylor Newton" is a common comparator over the whole family, not the current Poisson implementation from #12431.
Across the 480 off-midpoint datasets, bounded-step curvature finished below Taylor Newton in every paired run. Bounded-step and Halley were close: bounded-step won 291/480 paired endpoints, and their condition-level median endpoints differed by at most about 1.75%.
The large endpoint values are deliberately adversarial unit-step stability results; they should not be interpreted as expected production magnitudes.
A separate Poisson study evaluated 36 candidate partitions for each of 1,000 synthetic parents:
Bounded-step curvature therefore retained split ranking close to Newton while eliminating score overstatement in this corpus, consistent with the analytical split certificate.
Implementation
GammaDeviancewrapper.reg:tweediepower-1 endpoint regression check.Validation
./build/testxgboost --gtest_filter='Objective.*': 32/32 passed.Limitations
The analytical split certificate assumes the unregularized full-step problem. The synthetic study is a mechanism and stability test, not a held-out generalization benchmark or a hyperparameter-tuned comparison.