Exact intercepts for absolute error and quantile objectives #12557
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 324 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12557"
general
weight: 0.35
RAMitchell
Summary
Replace the approximate intercept estimation for
reg:absoluteerrorandreg:quantileerrorwith exact float32 weighted quantile selection.The implementation introduces an objective-local radix-selection kernel with
separate CPU and CUDA implementations. Other devices use the existing CPU
kernel fallback.
Motivation
The optimal intercept for absolute error is a weighted median. More generally,
each quantile objective has a weighted quantile as its optimal intercept.
The previous implementation approximated these intercepts using a mean followed
by one gradient/Hessian update. The result was not generally the optimum.
Sorting the labels would find the optimum, but requires
O(n log n)work and isawkward on GPUs and distributed workers. Since labels are stored as float32, the
selected value can instead be recovered in four 8-bit radix passes.
Each pass:
1. Builds a weighted 256-bin histogram for the next byte of each candidate.
2. Sums the histogram across distributed workers.
3. Selects the bin containing the requested cumulative weight.
4. Retains that prefix and refines the remaining rank.
After four passes, the selected 32-bit key identifies the exact input value.
The input is never sorted or modified.
The output count is passed independently of the local label shape. This allows
workers holding an empty, label-less DMatrix to allocate matching histograms
and participate in every collective operation.
Performance
Measured on 20 million rows with one feature. Intercept cost is the difference
between one-round training with automatic estimation and training with an
explicit
base_score.| Device | Label distribution | Objective | Intercept cost |
|---|---|---|---:|
| GPU | Clustered in
[100, 1000)|reg:absoluteerror| 15 ms || GPU | Clustered in
[100, 1000)|reg:quantileerror, 3 alphas | 18 ms || GPU | Spread,
N(0, 1e10)|reg:absoluteerror| 7 ms || CPU, 32 threads | Clustered in
[100, 1000)|reg:absoluteerror| 27 ms || CPU, 32 threads | Clustered in
[100, 1000)|reg:quantileerror, 3 alphas | 65 ms |The clustered distribution is a difficult case for the CUDA implementation
because many rows contend for the same pass-0 histogram bins.
Tests
0 x 0label matrix