# XGBoost: A Scalable Tree Boosting System

XGBoost scales tree boosting to billions of examples on one machine

Tianqi Chen, Carlos Guestrin · arXiv · 2016-3-9

- **Problem** Exact split search sorts every feature over all the data, so it breaks down once the data no longer fits in memory. Sparse data and weighted instances also lacked a fast way to propose split candidates.
- **Method** XGBoost learns a default direction for missing values and proposes candidate splits with a weighted quantile sketch. It also stores data in compressed, pre-sorted blocks that can be read from disk, so training runs out of core.
- **Results** XGBoost ran at 0.826 seconds per tree on Yahoo LTRC, compared to 2.576 for pGBRT, with a similar NDCG@10 score.

## Where exact split search runs out of room

Gradient tree boosting adds regression trees one at a time, and each new tree is chosen to improve the loss the most. The hard step is finding the best split for each node, which means scoring candidate thresholds on every feature. The exact greedy algorithm does this by sorting the instances on each feature and sweeping the sorted values to accumulate gradient sums.

That works while the data fits in memory, but the authors note it becomes very hard to do efficiently once it doesn't, and distributed training faces the same obstacle.

Real data also brings missing values, frequent zeros and one-hot columns, so the feature matrix is often sparse. Approximate methods need candidate thresholds, and the standard quantile sketch assumes equal instance weights. Boosting, however, weights each instance by its second order gradient statistic, and no existing sketch handled such weights.

## Scoring a tree with a regularized objective

XGBoost scores a tree with the loss plus a penalty on the number of leaves and on the squared size of the leaf weights. The penalty smooths the learned leaf weights and pushes the model toward simpler trees, and setting the regularization parameters to zero recovers traditional gradient tree boosting. Once the tree structure is fixed, each leaf's optimal weight follows from the gradient sums in that leaf.

\\\[ w\_j^\* = -\\frac{\\sum\_{i \\in I\_j} g\_i}{\\sum\_{i \\in I\_j} h\_i + \\lambda} \\\] The gain of a candidate split is the score of the two children minus the score of the parent, minus the leaf penalty gamma, and this gain is what the search maximizes. Shrinkage then multiplies each new tree's weights by a factor eta, and column subsampling samples features for each tree as random forests do.

## Learning a default direction for missing values

Instead of treating missing entries as a special case, XGBoost gives each tree node a default direction and learns that direction from the data. The sparsity-aware search sorts only the non-missing instances of a feature and scans them twice, once with missing values sent to the right and once to the left. Because the scan visits only non-missing entries, the computation grows linearly with the number of non-missing entries.

## Approximate proposals and the weighted sketch

The approximate algorithm proposes candidate splits from feature percentiles, groups the instances into buckets, and picks the best split among those proposals. The global variant proposes candidates once per tree, while the local variant proposes again after every split, which lets it refine the candidates. On Higgs 10M, the authors compare exact greedy with global and local proposals at eps 0.3 and eps 0.05, and they find that the local proposal needs fewer candidates.

The weighted quantile sketch makes these proposals correct when instances carry weights, by ranking values with the second order statistics as weights. Its summary supports merge and prune operations, and the appendix proves that merging keeps the larger of the two error bounds and that pruning to a budget b adds 1/b to the error.

## Sorting once with blocks and batching cache access

The data is stored in blocks in compressed column format, with each column sorted by feature value, and this layout is computed once before training. Because the sort is paid once in preprocessing, the per-tree cost of the block structure loses the log n factor of the original sparse algorithm. The split search fetches gradient statistics by row index in feature order, which produces non-contiguous memory access and cache misses.

Cache-aware prefetching gives each thread a buffer, fills it with statistics, and accumulates in mini-batches.

On large datasets with 10 million instances, the cache-aware exact algorithm ran twice as fast as the non cache-aware version. For approximate search, the authors chose 2^16 examples per block, since overly small blocks parallelize poorly and overly large blocks cause cache misses.

## Compressing and sharding blocks for disk-bound training

Out-of-core training keeps blocks on disk, and an independent thread prefetches each block into a memory buffer so that computation overlaps disk reading. Each block is compressed by column and decompressed on the fly, and row indices are stored as 16-bit offsets from the start of the block. On most tested datasets the compression ratio was 26% to 29%.

Block sharding spreads the blocks over several disks, with one pre-fetcher per disk feeding buffers that the training thread reads in turn.

On the Criteo data, the authors replaced ID features with count and average CTR statistics, leaving 1.7 billion instances with 67 features. On one AWS c3.8xlarge machine, compression sped up computation by a factor of three, and sharding into two disks gave a further 2x speedup. The final method processed 1.7 billion examples on that single machine.

## Single machine comparisons with scikit-learn and pGBRT

On the dense Higgs-1M subset with 500 trees, XGBoost trained at 0.6841 seconds per tree, compared to 28.51 for scikit-learn. Its test AUC was 0.8304, compared to 0.8302 for scikit-learn, and the authors report XGBoost running more than 10x faster than scikit-learn. Column subsampling lowered the AUC to 0.8245, which the authors attribute to there being few important features in this dataset.

On Yahoo LTRC with 500 trees, depth 8 and shrinkage 0.1, XGBoost ran at 0.826 seconds per tree with NDCG@10 0.7892. pGBRT ran at 2.576 seconds per tree with NDCG@10 0.7915, so XGBoost was faster while pGBRT ranked slightly better. XGBoost with column subsampling scored 0.7913 NDCG@10 in 0.506 seconds per tree, and pGBRT supports only the approximate algorithm while XGBoost runs exact greedy.

## Distributed comparison and scaling to 1.7 billion examples

On 32 EC2 nodes for 10 iterations, XGBoost ran more than 10 times faster than Spark MLLib per iteration and 2.2 times as fast as the optimized version of H2O. H2O was slow to load the data, so its end-to-end time was worse, and Spark slowed down sharply once its data ran out of memory. Both baselines are in-memory frameworks, while XGBoost switches to out-of-core training when memory runs out, which is why it scaled to all 1.7 billion examples.

When the number of machines grew, time per iteration fell roughly linearly, and XGBoost could handle the full dataset with four machines. The authors note that more machines give more file cache, which makes the trend slightly super linear.

## Limitations

The exact greedy comparison uses a 1M subset of Higgs, because scikit-learn handles only dense input. The learning-to-rank comparison is against pGBRT alone, and pGBRT supports only the approximate algorithm. The out-of-core timings come from one c3.8xlarge machine, and the distributed timings come from 32 EC2 nodes, so the numbers belong to those setups.

## Paper info

- **Authors**: Tianqi Chen, Carlos Guestrin
- **Venue**: arXiv · Preprint
- **First published**: 2016-3-9
- **Added**: 2026-11-11
- **Updated**: 2016-6-10
- **Version**: v3
- **arXiv**: 1603.02754
- **DOI**: 10.1145/2939672.2939785
- **Category**: cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1603.02754v3) · [PDF ↗](https://arxiv.org/pdf/1603.02754v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Tianqi Chen, Carlos Guestrin (2016). XGBoost: A Scalable Tree Boosting System. arXiv:1603.02754v3. https://doi.org/10.1145/2939672.2939785

**BibTeX**

```
@article{chen2016xgboost,
  title = {{XGBoost: A Scalable Tree Boosting System}},
  author = {Tianqi Chen and Carlos Guestrin},
  year = {2016},
  eprint = {1603.02754},
  archivePrefix = {arXiv},
  doi = {10.1145/2939672.2939785},
  url = {https://arxiv.org/abs/1603.02754v3}
}
```

## Other paper commentary

- [Deep Learning-Enabled Semantic Communication Systems with Task-Unaware Transmitter and Dynamic Data](https://refivu.com/en/papers/ebc873df-6d28-4b2d-ac6c-575f5c818afc-deep-learning-enabled-semantic-communication-systems-with.md)
- [Deep Partial Multi-View Learning](https://refivu.com/en/papers/b5d21a74-e2a9-402e-bdd6-20653bb21d8b-deep-partial-multi-view-learning.md)
- [FuXi: A cascade machine learning forecasting system for 15-day global weather forecast](https://refivu.com/en/papers/22238201-8e26-4b50-bb73-ade13aa387ac-fuxi-a-cascade-machine-learning-forecasting-system-for.md)
- [A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning](https://refivu.com/en/papers/08306129-4598-48b6-baf3-9d1af09e03a6-a-reduction-of-imitation-learning-and-structured-prediction.md)
- [NICE: Non-linear Independent Components Estimation](https://refivu.com/en/papers/f56da4f3-4308-4b66-a0bf-e0d6e495195a-nice-non-linear-independent-components-estimation.md)
- [Gaussian Error Linear Units (GELUs)](https://refivu.com/en/papers/264fd129-ba49-4e4c-ac1f-59466a4e43ea-gaussian-error-linear-units-gelus.md)
- [Effective Approaches to Attention-based Neural Machine Translation](https://refivu.com/en/papers/58ab56a7-1cd5-4c5e-be62-69ff9c1387c7-effective-approaches-to-attention-based-neural-machine.md)
- [DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs](https://refivu.com/en/papers/e76226cf-6d58-4173-918d-455579e5374d-deeplab-semantic-image-segmentation-with-deep-convolutional.md)
- [Rich feature hierarchies for accurate object detection and semantic segmentation](https://refivu.com/en/papers/0abb1ab7-a65a-475d-b57e-af628d8620f3-rich-feature-hierarchies-for-accurate-object-detection-and.md)
- [GloVe: Global Vectors for Word Representation](https://refivu.com/en/papers/d4308808-78ba-4fc7-a70c-6e67f906e337-glove-global-vectors-for-word-representation.md)
- [Off-Policy Deep Reinforcement Learning without Exploration](https://refivu.com/en/papers/997f4405-73fe-49b5-a89f-243df2c90604-off-policy-deep-reinforcement-learning-without-exploration.md)
- [Large Scale GAN Training for High Fidelity Natural Image Synthesis](https://refivu.com/en/papers/93f6ad29-8cca-4630-9a3b-d12f9ad91854-large-scale-gan-training-for-high-fidelity-natural.md)

## Terms in this paper

- [nDCG@10](https://refivu.com/en/terms/2d8a23b2a2b1-ndcg-10)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/e3112070-6898-4fad-83b9-27d6d96c62be-xgboost-a-scalable-tree-boosting-system)
