Same boosting idea, built for speed. LightGBM groups values into a few bins, grows each tree by always splitting the most promising leaf, and trains on only the rows that still have something to teach. Each trick is shown next to the classic way.
The classic method sorts every feature and tests a cut between every pair of neighbouring values. LightGBM first drops each value into one of a few bins (once, before training). Then a node only needs to add up the gradients G and hessians H per bin, and test bins − 1 cuts. Bars show G per bin (above zero: leans pink, below: leans cyan); the white line is the gain of cutting after each bin.
Fewer bins means faster and smoother, but cuts can only land on bin edges (switch on Show bin edges above). More bins means finer cuts but more work. A sensible default (255) is almost lossless on big data; here the data is tiny, so try 3 to see the blockiness.
A level-wise tree splits every leaf on a level before going deeper. A leaf-wise tree always splits whichever leaf offers the biggest gain, wherever it is. Both trees below use the same data, the same gradients and the same budget of num leaves. Numbers on the nodes show the order of the splits.
Leaf-wise growth reduces the loss faster for the same number of leaves, but it can grow long lopsided branches that chase a few points. That is why num leaves and min data in leaf are the main brakes in LightGBM.
Points the model already gets right have tiny gradients and little to teach. Gradient-based One-Side Sampling keeps the top a% of all rows by |gradient|, then randomly picks another b% of all rows from the remaining small-gradient ones (so the sample size is b × N, not b × the remainder). Those sampled rows are multiplied by (1−a)/b so the totals stay fair. Fewer rows, almost the same signal.
Only 3 bins per feature. Cuts can only land on 2 edges, so the boundary turns blocky.
16 leaves, no L2 penalty, min data 1, noisy data. Watch validation loss climb as branches chase single points.
Keep only the top 10% of rows by gradient and sample another 5% of all rows from the rest. How little data can a tree live on?