What is the purpose of the weighted quantile sketch algorithm in XGBoost?

Quick Overview

Asks what the weighted quantile sketch does in XGBoost and why it weights each row by its hessian. Tests understanding of approximate split finding, the second-order objective as a weighted squared error, mergeable sketches for distributed data, and global versus local candidate proposals.

What is the purpose of the weighted quantile sketch algorithm in XGBoost?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the purpose of the weighted quantile sketch algorithm in XGBoost? ```hint Cost of exact search Think about what exact greedy split finding costs when the data has billions of rows or does not fit in memory. ``` ```hint Which weight per row Rewrite the second-order objective for one tree as a weighted least-squares problem and see what plays the role of the weight. ``` ### What a Strong Answer Covers - Why approximate split finding needs a small set of candidate thresholds, and when exact greedy search becomes impractical. - Which per-instance weight the sketch uses and the derivation that justifies it. - What separates this sketch from a classical unweighted quantile summary, including how it works on distributed data and what error guarantee it keeps. - The difference between global and local candidate proposals and the trade-off between them. ### Follow-up Questions - How would you choose the approximation parameter $\epsilon$, and what happens to accuracy and training time as it shrinks? - For squared-error loss every hessian equals 1. What does the weighted sketch reduce to in that case? - How does the binning used by the `hist` tree method differ from the sketch used by `approx`? - Why would local proposals suit deeper trees better than global ones?

Overview: Asks what the weighted quantile sketch does in XGBoost and why it weights each row by its hessian. Tests understanding of approximate split finding, the second-order objective as a weighted squared error, mergeable sketches for distributed data, and global versus local candidate proposals.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What is the purpose of the weighted quantile sketch algorithm in XGBoost?

What a Strong Answer Covers Guidance

  • Why approximate split finding needs a small set of candidate thresholds, and when exact greedy search becomes impractical.
  • Which per-instance weight the sketch uses and the derivation that justifies it.
  • What separates this sketch from a classical unweighted quantile summary, including how it works on distributed data and what error guarantee it keeps.
  • The difference between global and local candidate proposals and the trade-off between them.

Follow-up Questions Guidance

  • How would you choose the approximation parameter ϵ\epsilon , and what happens to accuracy and training time as it shrinks?
  • For squared-error loss every hessian equals 1. What does the weighted sketch reduce to in that case?
  • How does the binning used by the hist tree method differ from the sketch used by approx ?
  • Why would local proposals suit deeper trees better than global ones?