Random forests are a cornerstone of modern nonparametric regression, prized for their robustness and ability to handle high-dimensional data without extensive tuning. However, they possess a fundamental limitation: their predictions are inherently "blocky." Because random forests estimate values by averaging observations within terminal nodes, the resulting function is a jagged step function that struggles to capture smooth underlying signals.
In "Local Linear Forests," Friedberg et al. address this limitation by reframing random forests as an adaptive kernel method. By pairing the forest’s ability to identify local neighborhoods with a local linear regression adjustment, the authors introduce a method that captures smoothness, improves asymptotic convergence rates, and provides more reliable statistical inference.
Addressing the "Blockiness" of Random Forests
Standard random forests operate as neighborhood-averaging estimators. To predict at a point $x$, the forest identifies a set of "nearby" training observations and computes their average. While effective for many applications, this approach faces two primary challenges:
- Smooth Signals: When the true relationship is smooth, a step-function approximation introduces significant bias.
- Boundary Effects: Near the edges of the covariate space, neighborhoods become asymmetric. Standard forests cannot extrapolate, leading to increased error at the boundaries.
Local Linear Forests (LLF) overcome these issues by using the forest to generate weights ($\alpha_i$) for training points, which are then used in a locally weighted least squares problem:
$$\min_{\mu, \theta} \left\{ \sum_{i=1}^{n} \alpha_i(x_0)(Y_i - \mu - (X_i - x_0)\theta)^2 + \lambda\|\theta\|_2^2 \right\}$$
This formulation allows the model to fit a local trend rather than a local constant, smoothing out the "edges" of the forest.
Technical Innovations: Residual Splitting and Regularization
A key challenge in combining forests with linear regression is ensuring the forest splits on the "right" features. If a variable has a strong linear effect, a standard forest might exhaust its splitting capacity trying to approximate that line. LLF introduces residual splitting: the forest fits a ridge regression in the parent node and splits based on the resulting residuals. This encourages the forest to focus on non-linearities and interactions that the linear component cannot easily capture.
Additionally, the use of ridge regularization ($\lambda$) in the local optimization is critical for stability and for proving the method's mathematical consistency. The trees are also constructed to be "honest"—using separate data subsets for structure determination and estimation—which facilitates the derivation of a Central Limit Theorem for the estimator.
Empirical Performance and Real-World Application
The authors evaluated LLF against standard random forests, XGBoost, and BART across various benchmarks. In synthetic tests like the Friedman function, LLF consistently achieved lower Mean Squared Error (MSE), particularly as the smoothness of the underlying signal increased.
The method was also applied to real-world data from the Current Population Survey (CPS) to predict log-wages. LLF outperformed competing models, demonstrating its ability to handle high-dimensional data while maintaining precision in sparse regions of the covariate space.
Beyond regression, LLF shows promise in causal inference. In a study using General Social Survey (GSS) data, LLF effectively estimated heterogeneous treatment effects, revealing how public attitudes toward the social safety net vary smoothly with political affiliation and income based on specific word choices (e.g., "welfare" vs. "assistance to the poor").
Conclusion and Software
Local Linear Forests represent a significant step forward in nonparametric regression, successfully merging the high-dimensional adaptivity of random forests with the precision of local linear methods. By improving boundary behavior and capturing smoothness, LLF provides a more accurate and statistically grounded tool for data analysis.
Researchers and practitioners can access these methods through the grf (Generalized Random Forests) package for R, which includes a computationally efficient implementation of Local Linear Forests.
Summary updated