LightGBM

Machine Learning
Introduced by
Ke, G. et al. (Microsoft)
Year
2017
Type
Gradient boosting decision tree ensemble

What does it do?

LightGBM is a gradient boosting decision tree implementation developed by Ke and colleagues at Microsoft and introduced in 2017.

Its design rests on two features, histogram-based binning of continuous features and leaf-wise (best-first) tree growth, both aimed at reducing training time and memory use on large datasets. Its speed relative to level-wise implementations such as XGBoost depends on the data and the chosen settings.

The intuition behind the method

Gradient boosting builds an ensemble one tree at a time, where each new tree is trained to reduce the loss that the current ensemble still leaves behind. LightGBM keeps this idea but changes how each tree is built to make it faster. Continuous feature values are grouped into a fixed number of histogram bins, so the algorithm searches fewer candidate split points, and each tree grows by repeatedly splitting whichever leaf gives the largest loss reduction. These two choices underlie its efficiency on large tabular data, and they also make it more prone to overfitting when the sample is small. Because the learning rate shrinks each tree's contribution, the number of boosting rounds is usually chosen with early stopping on a validation set, since training loss keeps falling after validation performance has stopped improving.

History

LightGBM was introduced by Guolin Ke and colleagues at Microsoft in a 2017 NeurIPS paper, 'LightGBM: A Highly Efficient Gradient Boosting Decision Tree'. Its design centres on histogram-based feature binning and leaf-wise (best-first) tree growth, both aimed at reducing training time and memory use on large datasets. The original paper is the primary reference for the method and its design.

When to use it

Choose LightGBM for prediction, classification, or forecasting on large tabular datasets with continuous, categorical, binary, or ordinal features, where training speed matters and you can tune regularisation. Use it with cross-sectional, panel, or time-series data only when you can validate in a way that respects time order. Leaf-wise growth can overfit small samples, so on small datasets constrain num_leaves and min_data_in_leaf and compare against a level-wise method such as XGBoost or a Random Forest before settling on LightGBM.

Limitations and considerations

  • Leaf-wise growth overfits small samples unless num_leaves and min_data_in_leaf are constrained.
  • Its speed advantage over level-wise methods depends on data size and settings, so it cannot be assumed for every dataset.
  • Like other boosted-tree ensembles, predictions come from many trees combined, so there are no coefficients that can be read directly as effects.
  • Results depend on the regularisation settings, and default values are not guaranteed to suit a given sample.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Histogram-based splitting reduces the number of candidate splits evaluated per feature, which is the basis of its speed on large tabular data.
  • Leaf-wise growth can reach low loss with relatively few splits, which often shortens training.
  • Categorical features can be passed to the model directly, which avoids the extra columns created by one-hot encoding; check the library documentation for how categories are encoded internally.
  • The same boosting framework covers classification, regression, and forecasting on cross-sectional, panel, and time-series data.

Applications

  • Prediction and classification on large tabular datasets.
  • Forecasting on cross-sectional, panel, and time-series data, using validation that respects time order.
  • Faster alternative to level-wise boosting implementations when training time is a constraint.
  • Modelling datasets with many categorical features without a separate one-hot encoding step.

How it works

How it works

1

Trees are added sequentially. Each new tree is fit to the negative gradient of the loss with respect to the current predictions, and its output is added with a learning-rate shrinkage (η in the formula above), so the model reduces its loss in small steps. Categorical features can be passed to LightGBM directly, without manual one-hot encoding.

Formula
F_m(x) = F_{m-1}(x) + \eta\, h_m(x)
2

Continuous feature values are bucketed into a fixed number of discrete histogram bins before splitting. The algorithm then searches for the best split over these bins rather than over every raw value. This reduces the number of candidate splits evaluated per feature, which is the main source of its speed on large data; XGBoost also offers a histogram-based method, so the size of the gain depends on the implementation and settings used.

3

Rather than expanding all leaves at the same depth (level-wise), LightGBM grows leaf-wise: at each step it splits the leaf that yields the largest loss reduction. This can reach low loss with fewer splits, but on small samples it can carve the data into too many leaves. The number of leaves (num_leaves) and the minimum data per leaf (min_data_in_leaf) are the main controls used to regularise the trees.

Common pitfalls

  • Fitting LightGBM on a small sample while keeping num_leaves and min_data_in_leaf permissive.
  • One-hot encoding categorical variables before passing them, which discards the direct handling of categories.
  • Judging performance on training data instead of a held-out or cross-validated evaluation.
  • Shuffling time-ordered rows before splitting, which lets information from the future leak into the training set when forecasting.

Frequently asked questions

How is LightGBM different from XGBoost?

Both are gradient boosting decision tree libraries. LightGBM is designed around histogram-based splitting and leaf-wise (best-first) tree growth. XGBoost's default growth is level-wise. Both offer histogram-based methods, so the speed difference depends on the data and settings.

Why does LightGBM overfit on small datasets?

Its leaf-wise growth splits the leaf with the largest loss reduction at each step, which can divide a small dataset into too many leaves. On small samples this makes overfitting a serious risk. Constrain the tree complexity with num_leaves and min_data_in_leaf, validate with cross-validation, and compare against a level-wise method or a Random Forest.

Do I need to one-hot encode categorical variables?

Not necessarily. LightGBM can take categorical features directly, so a separate one-hot encoding step is often not required. Check the library documentation for how categories are encoded internally before relying on this.

Which settings control overfitting?

The number of leaves (num_leaves) and the minimum data per leaf (min_data_in_leaf) are the main regularisation controls; tightening them limits tree complexity relative to the dataset size.

Related methods

Sources

  1. Ke, G., Meng, Q., Finley, T., Wang, T., Chen, W., Ma, W., Ye, Q. & Liu, T.-Y. (2017). LightGBM: A Highly Efficient Gradient Boosting Decision Tree. Advances in Neural Information Processing Systems (NeurIPS) 30, 3146–3154.

    Open publication reference