# 梯度提升

**梯度提升**（Gradient boosting）是一种机器学习方法，它将预测模型构建为简单基学习器的加性展开，每个新学习器都拟合损失函数相对于当前模型预测的负梯度。斯坦福大学的杰罗姆·H·弗里德曼（Jerome H. Friedman）在2001年发表于《统计年鉴》（*The Annals of Statistics*）的论文中将该方法形式化，将函数逼近视为函数空间而非参数空间中的数值优化，并将逐阶段加性展开与最速下降最小化联系起来<sup>[1](https://www.researchgate.net/publication/2424824_Greedy_Function_Approximation_A_Gradient_Boosting_Machine)</sup>。当基学习器为决策树时，所得模型即为梯度提升决策树（GBDT），几乎所有实用系统采用的都是这种形式。

| 关键事实 | 详情 |
|---|---|
| 奠基论文 | 弗里德曼，《贪心函数逼近：一种梯度提升机》，《统计年鉴》29(5)，2001年10月<sup>[1](https://www.researchgate.net/publication/2424824_Greedy_Function_Approximation_A_Gradient_Boosting_Machine)</sup> |
| 核心更新 | 每次迭代通过最小二乘法将基学习器拟合到伪残差——即损失相对于当前模型预测的负梯度——然后逐阶段更新模型<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup><sup> • </sup><sup>[16](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingRegressor.html)</sup> |
| 损失函数 | 给出了回归中最小二乘、最小绝对偏差和Huber-M损失的特定算法，以及分类中多类逻辑似然的特定算法<sup>[1](https://www.researchgate.net/publication/2424824_Greedy_Function_Approximation_A_Gradient_Boosting_Machine)</sup> |
| 随机变体 | 弗里德曼（2002）在每次迭代中抽取不放回的随机子样本，可提高逼近精度和执行速度<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup> |
| 主要实现 | XGBoost（2016）、LightGBM（2017）、CatBoost（2018），以及scikit-learn的GradientBoosting估计器<sup>[3](https://arxiv.org/abs/1603.02754)</sup><sup> • </sup><sup>[4](https://proceedings.neurips.cc/paper/6907-a-highly-efficient-gradient-boosting-decision-tree.pdf)</sup><sup> • </sup><sup>[5](https://proceedings.neurips.cc/paper/7898-catboost-unbiased-boosting-with-categorical-features.pdf)</sup> |
| 典型默认值（scikit-learn） | learning_rate 0.1，n_estimators 100，max_depth 3，subsample 1.0<sup>[6](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html?trk=article-ssr-frontend-pulse_little-text-block)</sup> |
| 在表格数据上的地位 | 在NeurIPS 2022一项涵盖45个数据集的基准测试中，基于树的模型在中等规模表格数据（约10,000个样本）上仍保持最先进水平<sup>[7](https://proceedings.neurips.cc/paper_files/paper/2022/hash/0378c7692da36807bdec87ab043cdadc-Abstract-Datasets_and_Benchmarks.html)</sup> |

## 算法工作原理

提升法通过基学习器h(x; a)的加性展开来逼近目标函数F*(x)，以向前逐阶段的方式拟合：从初始猜测F₀(x)出发，每一阶段添加一个新项，使其在训练数据上的损失最小化<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup>。对于任意可微损失函数，精确的逐阶段最小化是不可行的，因此梯度提升分两步近似。首先，计算伪残差，即损失相对于当前模型输出在每个训练点上的负梯度。其次，通过最小二乘法将基学习器（通常为回归树）拟合到这些伪残差上，然后更新模型<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup>。

由于回归树在每个终端区域内预测一个常数值，步长的[线搜索](https://www.edgepedia.org/zh/line-search)简化为每个区域的简单位置估计，当前近似在每个区域中分别更新<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup>。弗里德曼的2001年论文推导了回归中最小二乘、最小绝对偏差和Huber-M损失以及分类中多类逻辑似然的特定算法，并提出了用于解释所得“TreeBoost”模型的工具<sup>[1](https://www.researchgate.net/publication/2424824_Greedy_Function_Approximation_A_Gradient_Boosting_Machine)</sup>。

## 正则化：收缩与子采样

**收缩**（Shrinkage）以小于1.0的学习率缩放每棵树的贡献。在scikit-learn的正则化示例中，收缩显著改善了测试离差，将其与子采样结合通过Bagging降低方差从而产生更准确的模型；不使用收缩的子采样通常表现不佳<sup>[8](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_regularization.html)</sup>。方差也可以通过子采样特征来降低，类似于随机森林中的随机分裂，通过max_features参数实现<sup>[8](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_regularization.html)</sup>。

**随机梯度提升**由弗里德曼于2002年提出，将随机化作为过程的组成部分：每次迭代随机抽取一个不放回的子样本，替代全样本用于拟合基学习器和计算更新。这还增强了对基学习器过容量的鲁棒性并节省计算<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup>。在弗里德曼的模拟中，改进程度取决于样本量、目标函数、误差分布和基学习器容量；接近最优的采样比例在几乎所有回归目标上给出了最佳或接近最佳的误差，尽管在少数目标上不采样比任何采样比例都好<sup>[2](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)</sup>。当子采样比例低于1.0时，可以利用未包含在每个子样本中的样本即时计算测试离差的袋外估计；scikit-learn指出这些估计偏悲观，建议在条件允许时使用交叉验证<sup>[9](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_oob.html)</sup>。

## 可扩展实现

**XGBoost**由陈天奇和卡洛斯·格斯特林（华盛顿大学）于2016年描述，是一个可扩展的端到端树提升系统，被数据科学家广泛用于在机器学习竞赛中取得最先进的结果。其算法贡献包括针对稀疏数据的稀疏感知算法和用于近似树学习的具有理论依据的加权分位数摘要，其中分裂候选点从加权特征分布的分位数中提出，每个样本按其损失贡献的黑塞矩阵加权<sup>[3](https://arxiv.org/abs/1603.02754)</sup><sup> • </sup><sup>[10](https://xgboost.org/papers/chen-guestrin-2016-annotated/)</sup>。在系统方面，缓存感知块结构、数据压缩和分片使XGBoost能够以比现有系统更少的资源扩展到数十亿样本以上，在单机上运行速度比现有流行方案快十倍以上<sup>[3](https://arxiv.org/abs/1603.02754)</sup>。

**LightGBM**来自[微软研究院](https://www.edgepedia.org/zh/microsoft-research)，针对GBDT的主要成本——寻找最佳分裂点——采用两种技术。基于梯度的单边采样（GOSS）保留梯度大的实例并随机采样其余部分，在保留集上使用方差增益估计；互斥特征捆绑（EFB）捆绑互斥的稀疏特征，将捆绑问题归约为图着色问题，用具有常数近似比的贪心算法求解。在公开数据集上，LightGBM将训练速度提升最多超过20倍，同时达到几乎相同的精度<sup>[4](https://proceedings.neurips.cc/paper/6907-a-highly-efficient-gradient-boosting-decision-tree.pdf)</sup>。LightGBM以叶节点方式而非深度方式生长树，收敛更快，但在没有适当参数（如num_leaves和min_data_in_leaf）时可能过拟合<sup>[11](https://lightgbm.readthedocs.io/_/downloads/en/v3.3.3/pdf/)</sup>。

**CatBoost**由Yandex开发并在NeurIPS 2018上展示，指出了作者认为存在于所有现有梯度提升实现中的一个统计问题：经过若干提升步骤后构建的模型依赖于所有训练样本的目标值，使训练点上的预测分布偏离测试点上的分布，这是一种由特殊类型的目标泄漏引起的预测偏移。CatBoost的有序提升——一种由排列驱动的经典算法替代方案——以及其将类别特征转换为目标统计量的有序算法，都旨在消除这种泄漏<sup>[5](https://proceedings.neurips.cc/paper/7898-catboost-unbiased-boosting-with-categorical-features.pdf)</sup>。在论文的实验中，CatBoost在多种流行的机器学习任务上优于XGBoost和LightGBM<sup>[5](https://proceedings.neurips.cc/paper/7898-catboost-unbiased-boosting-with-categorical-features.pdf)</sup>。其类别特征处理将类别转换为仅从随机排列中先前见过的样本计算的目标统计量，公式中包含先验平滑项<sup>[12](https://catboost.ai/docs/en/concepts/algorithm-main-stages_cat-to-numberic)</sup>。

## 库中的正则化与实践

scikit-learn的GradientBoostingClassifier展示了经典配方：loss（log_loss或exponential，后者可恢复AdaBoost）、learning_rate默认为0.1、n_estimators默认为100、subsample默认为1.0、max_depth默认为3<sup>[6](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html?trk=article-ssr-frontend-pulse_little-text-block)</sup>。learning_rate和n_estimators之间存在权衡，低于1.0的子采样降低方差同时增加偏差<sup>[6](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html?trk=article-ssr-frontend-pulse_little-text-block)</sup>。CatBoost增加了过拟合检测器，在触发时停止构建树，并在小数据集上（GPU上最多50,000个对象）默认使用有序提升，而在较大数据集上使用普通经典方案<sup>[13](https://catboost.ai/docs/en/concepts/algorithm-main-stages)</sup><sup> • </sup><sup>[14](https://catboost.ai/docs/en/references/training-parameters/common)</sup>。

## 梯度提升与深度学习在表格数据上的对比

梯度提升的主要舞台是表格数据，基准测试一再将其与神经网络进行比较。NeurIPS 2022一项涵盖45个表格数据集的基准测试发现，XGBoost和随机森林等基于树的模型在约10,000个样本的中等规模数据上仍保持最先进水平，甚至还未计入其速度优势，并将差距归因于归纳偏置：树模型对无信息特征具有鲁棒性，保持数据的方向性，更容易学习不规则函数<sup>[7](https://proceedings.neurips.cc/paper_files/paper/2022/hash/0378c7692da36807bdec87ab043cdadc-Abstract-Datasets_and_Benchmarks.html)</sup>。

2023年一项研究是迄今为止最大规模的表格数据比较，涵盖176个数据集上的19种算法，发现“神经网络对GBDT”的争论被过度强调：在许多数据集上性能差异可以忽略不计，或者对GBDT进行轻度超参数调优比选择模型族更重要。GBDT在处理偏斜或重尾特征分布及其他数据集不规则性方面远优于神经网络，作者的实际建议是先尝试简单基线，然后对CatBoost进行轻度超参数调优<sup>[15](https://arxiv.org/abs/2305.02997)</sup>。

## References

1. [Jerome H. Friedman (2001). Greedy Function Approximation: A Gradient Boosting Machine. The Annals of Statistics 29(5).](https://www.researchgate.net/publication/2424824_Greedy_Function_Approximation_A_Gradient_Boosting_Machine)
2. [Jerome H. Friedman (2002). Stochastic Gradient Boosting. Computational Statistics & Data Analysis 38, 367–378.](https://cafri-labs.github.io/lab-manual/papers/gbm_2.pdf)
3. [Tianqi Chen, Carlos Guestrin (2016). XGBoost: A Scalable Tree Boosting System. arXiv:1603.02754.](https://arxiv.org/abs/1603.02754)
4. [Guolin Ke et al. (2017). LightGBM: A Highly Efficient Gradient Boosting Decision Tree. NeurIPS 2017.](https://proceedings.neurips.cc/paper/6907-a-highly-efficient-gradient-boosting-decision-tree.pdf)
5. [Liudmila Prokhorenkova et al. (2018). CatBoost: unbiased boosting with categorical features. NeurIPS 2018.](https://proceedings.neurips.cc/paper/7898-catboost-unbiased-boosting-with-categorical-features.pdf)
6. [sklearn.ensemble.GradientBoostingClassifier, scikit-learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html?trk=article-ssr-frontend-pulse_little-text-block)
7. [Leo Grinsztajn, Edouard Oyallon, Gael Varoquaux (2022). Why do tree-based models still outperform deep learning on typical tabular data? NeurIPS 2022 Datasets and Benchmarks Track.](https://proceedings.neurips.cc/paper_files/paper/2022/hash/0378c7692da36807bdec87ab043cdadc-Abstract-Datasets_and_Benchmarks.html)
8. [Gradient Boosting regularization, scikit-learn example](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_regularization.html)
9. [Gradient Boosting Out-of-Bag estimates, scikit-learn example](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_oob.html)
10. [Chen & Guestrin 2016, Annotated Reading of the XGBoost Paper](https://xgboost.org/papers/chen-guestrin-2016-annotated/)
11. [LightGBM documentation, Release 3.3.3](https://lightgbm.readthedocs.io/_/downloads/en/v3.3.3/pdf/)
12. [Transforming categorical features to numerical features, CatBoost documentation](https://catboost.ai/docs/en/concepts/algorithm-main-stages_cat-to-numberic)
13. [How training is performed, CatBoost documentation](https://catboost.ai/docs/en/concepts/algorithm-main-stages)
14. [Common parameters, CatBoost documentation](https://catboost.ai/docs/en/references/training-parameters/common)
15. [Duncan McElfresh et al. (2023). When Do Neural Nets Outperform Boosted Trees on Tabular Data? arXiv:2305.02997.](https://arxiv.org/abs/2305.02997)
16. [GradientBoostingRegressor](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingRegressor.html)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Ensemble, boosting, and transfer methods › Boosting algorithms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gradient-boosting

English original: https://www.edgepedia.org/gradient-boosting
