← Back to Pull requests

Add normal distribution regression objective #12550

Closed
unknown closed this pull request without merging on Sep 15, 2026 10:46 UTC
View on GitHub
unknown unknown commented on Sep 09, 2026 20:20 UTC
Author

Summary

Adds reg:normal, a distributional regression objective that predicts two values per row:

  • conditional mean

  • log variance
  • The objective supports both one-tree-per-output and shared-topology vector trees. It also adds the normal-nloglik evaluation metric.

    Stable variance updates

    For log variance $s$, define

    $$
    z = \left((y-\mu)^2 + \epsilon\right)e^{-s},
    $$

    where $\epsilon$ is float epsilon. The gradient and pseudo-Hessian are

    $$
    g_s = \frac{w}{2}(1-z),
    \qquad
    h_s = \frac{w}{6}(1+2z).
    $$

    The observed Hessian $wz/2$ vanishes when the residual approaches zero. This can produce an arbitrarily large Newton update for log variance.

    The proposed curvature instead gives the fixed-mean leaf update

    $$
    d = \frac{3(R-1)}{1+2R},
    $$

    where $R$ is the leaf-average standardized squared residual. This update is bounded to $(-3, 3/2)$, moves toward the exact optimum $\log R$, and provides a conservative quadratic gain estimate.

    Adding float epsilon gives the variance a finite optimum when the mean interpolates the observations. It prevents training from continually driving the variance toward zero without introducing a user parameter.

    The vector intercept is initialized exactly as the weighted response mean and

    $$
    \log(\text{weighted residual variance}+\epsilon).
    $$

    Results

    The comparison used shared-topology vector trees on four public regression datasets, with three deterministic train/validation splits.

    At eta=0.3, lambda=1, depth 4, and 100 rounds:

    | Dataset | Newton validation NLL | Bounded-step validation NLL |
    |---|---:|---:|
    | Ailerons | 0.3648 | 0.3573 |
    | CPU Activity | -0.6502 | -0.7033 |
    | Kin8nm | 0.8479 | 0.8218 |
    | Wine Quality | 1.2002 | 1.1956 |

    In a zero-regularization stress test at eta=0.1, all 12 observed-Newton runs became non-finite. All 12 bounded-step runs completed 100 rounds without a training-loss increase.

    A separate interpolation stress test used eta=1, depth 12, and no regularization. All eight combinations of four synthetic datasets and the two multi-output strategies completed 100 rounds with finite predictions. Constant-label leaves settled at float epsilon variance.

    Implementation

  • CPU and CUDA objective kernels

  • exact vector-valued intercept

  • normal-nloglik metric

  • support for multi_output_tree and one_output_per_tree

  • parameter documentation

  • CPU, CUDA compilation, metric, and Python integration tests
  • Diff: 305 lines (+228 / -77) across 3 files Reviewer: RAMitchell Review duration: 8066m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 305 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.342
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #12550"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%
    Repository