GBNet: Gradient Boosting packages integrated into PyTorch
Michael T. Horrell · The Journal of Open Source Software · 2025
GBNet is a Python software package that integrates the powerful Gradient Boosting Machines (GBMs) (Friedman, 2001) packages XGBoost (Chen & Guestrin, 2016) and LightGBM (Ke et al., 2017) with PyTorch (Paszke et al., 2019), a widely-used deep learning library.Gradient boosting is a popular machine learning technique known for its accuracy in predictive modeling.XGBoost and LightGBM are industry-standard implementations of GBMs recognized for their speed and strong performance across numerous applications (Kaggle, 2021).However, these libraries primarily handle standard machine learning tasks and present challenges when applied to complex or non-standard modeling scenarios.For example, using non-standard loss functions with either XGBoost or LightGBM requires manual computation of gradients and Hessians, a prohibitively difficult requirement for even moderately complex losses.PyTorch is popular for its ease of defining and training neural networks.Its computational graph provides automatic differentiation capabilities.GBNet leverages these capabilities, linking gradient and Hessian calculations from PyTorch to XGBoost or LightGBM models.This integration allows users to construct and train complex hybrid models that combine gradient boosting with neural network architectures.GBNet significantly broadens the scope of problems that can be solved with the world-leading gradient boosting software packages.