Comparing The Gradient Boosting Decision Tree Packages: XGBoost vs LightGBM

Gradient Boosting Decision Tree is a widely-used machine learning algorithm for classification and regression problems. This is not a new topic for machine learning developers. 

GBDT achieves state-of-the-art performance in various machine learning tasks due to its efficiency, accuracy, and interpretability. GBDT is an ensemble model of decision trees which learns the decision trees by finding the best split points. 


Sign up for your weekly dose of what's up in emerging technology.

Finding the best split points while learning a decision tree is supposed to be a time-consuming issue. This issue can be overcome by packages such as XGBoost and LightGBM. XGBoost and LightGBM are the packages belong to the family of gradient boosting decision trees (GBDTs). In this article, we list down the comparison between XGBoost and LightGBM. 

Understanding The Basics

XGBoost or eXtreme Gradient Boosting is an efficient implementation of the gradient boosting framework. It uses pre-sort-based algorithms as a default algorithm. This open-source software library provides a gradient boosting framework for languages such as C++, Java, Python, R, and Julia.

Introduced by Microsoft, Light Gradient Boosting or LightGBM is a highly efficient gradient boosting decision tree algorithm. It is similar to XGBoost and varies when it comes to the method of creating trees. LightGBM uses histogram-based algorithms which helps in speeding up training as well as reduces memory usage. This algorithm constructs trees leaf-wise in a best-first order due to which there is a tendency to achieve lower loss. 


The features of XGBoost are mentioned below:

  • XGBoost is generally over 10 times faster than a gradient boosting machine. 
  • It can automatically do parallel computation on Windows and Linux, with openmp.
  • This framework takes several types of input data including local data files.
  • XGBoost accepts sparse input for both tree booster and linear booster and is optimized for sparse input. 
  • It supports customised objective function as well as an evaluation function.
  • The performance is also better on various datasets.

The features of LightGBM are mentioned below

  • This framework reduces the cost of calculating the gain for each split.
  • It reduces memory usage by replacing the continuous values with discrete bins.
  • There is no need to store additional information for pre-sorting feature values.
  • It reduces communication costs for parallel learning.
  • LightGBM provides better performance than point-to-point communication.
  • LightGBM supports various applications such as multi classification, cross-entropy, regression, binary classification, etc. 


Advantages of XGBoost are mentioned below

  • XGBoost is also known as the regularised version of GBM. This framework includes built-in L1 and L2 regularisation which means it can prevent a model from overfitting.
  • Traditionally, XGBoost id slower than lightGBM but it achieves faster training via Histogram binning.
  • It supports user-defined objective functions with classification, regression and ranking problems.
  • This framework utilises multiple CPU cores and performs parallel processing.
  • It allows the user to run cross-validation at each iteration dung the boosting process.

Advantages of lightGBM are mentioned below

  • LightGBM uses histogram-based algorithms which results in faster training efficiency.
  • Due to the use of discrete bins, it results in less memory usage.
  • It supports parallel as well as GPU learning.
  • It deals with large scale data with better accuracy.
  • Supports various metrics and applications.


LightGBM is a newer tool as compared to XGBoost. Hence, it has fewer users and thus a narrow user base than XGBoost and contains less documentation.


XGBoost and LightGBM are very powerful and effective algorithms. These methods provide interpretable results while requiring little data preprocessing. These algorithms are constantly being updated by the respective communities. In case of wondering which algorithm to choose, it solely depends on the data you are going to use for the model.

More Great AIM Stories

Ambika Choudhury
A Technical Journalist who loves writing about Machine Learning and Artificial Intelligence. A lover of music, writing and learning something out of the box.

Our Upcoming Events

Masterclass, Virtual
How to achieve real-time AI inference on your CPU
7th Jul

Masterclass, Virtual
How to power applications for the data-driven economy
20th Jul

Conference, in-person (Bangalore)
Cypher 2022
21-23rd Sep

Conference, Virtual
Deep Learning DevCon 2022
29th Oct

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM

What can SEBI learn from casinos?

It is said that casino AI technology comes with superior risk management systems compared to traditional data analytics that regulators are currently using.