HomeAI & Machine LearningXGBoost vs LightGBM: Leaf-Wise Growth and the Speed Trade-off

🌳 XGBoost vs LightGBM: Leaf-Wise Growth and the Speed Trade-off

Watch two gradient-boosted decision trees grow side by side — XGBoost's balanced level-wise splitting versus LightGBM's greedy leaf-wise splitting — and see how the strategy changes tree shape, loss reduction and training speed.

AI & Machine Learning3DAdvanced60 FPS
xgboost-vs-lightgbm-gradient-boosting-tree-growth-lab ↗ Open standalone

Two gradient-boosted decision trees grow side by side in 3D — XGBoost's balanced, level-wise splitting on the left and LightGBM's greedy, leaf-wise splitting on the right — so you can see exactly why the same leaf budget produces two very different tree shapes.

🔬 What It Demonstrates

XGBoost's default strategy splits every leaf at the current depth before going deeper, producing a wide, symmetric tree. LightGBM always splits whichever leaf has the highest loss-reduction ("gain"), producing a narrower, lopsided tree that chases the biggest wins first.

🎮 How to Use

Set the target leaf count and the shared max-depth cap, then watch both trees regrow. Slide the dataset-size control to see how the simulated training-time gap between the two libraries widens as row count grows.

💡 Did You Know?

LightGBM's leaf-wise growth can reach a lower training loss with fewer leaves than XGBoost's level-wise growth — but the same greediness makes it more prone to overfitting small datasets without a tight depth or leaf-count cap.

⚙ Under the hood

Watch two gradient-boosted decision trees grow side by side — XGBoost's balanced level-wise splitting versus LightGBM's greedy leaf-wise splitting — and see how the strategy changes tree shape, loss reduction and training speed.

machine learninggradient boostingdecision treesxgboostlightgbmalgorithmsartificial intelligenceThree.js

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)