cs.LGOct 2, 2026

TreeWalker: Partial Evaluation for Grouped Tree-Ensemble Inference

Authors: Durmus Karatay, Richard Newman

Organizations: Shopify

Abstract

Many prediction tasks evaluate a trained tree ensemble on groups of rows that share feature values: discrete-time survival models expand each patient into GG time steps, click-through-rate models score every item in a search session, and scenario analyses vary a few inputs while holding the rest fixed. Standard inference treats each row independently and ignores this input-side correlation. We present TreeWalker, which instantiates partial evaluation for grouped tree-ensemble inference: constant features are static, varying features dynamic. TreeWalker walks each tree once per group, partitions a row bitmask at varying splits, and skips empty subtrees via an unsplit shortcut. It reads standard LightGBM and XGBoost models; training is unchanged. We prove a structural work decomposition: per-tree work splits into the constant-projected subtree size ∣Tc∣|T_c|, GG leaf writes, and a predicate-mask provisioning cost QQ. For the trace evaluator, per-row work approaches (dv+1)/(d+1)(d_v+1)/(d+1) as G→∞G \to \infty, giving asymptotic speedup 1/(1−ρˉG)1/(1-\barρ_G). On Intel, TreeWalker is ∼3×{\sim}3\times faster than a row-independent traversal at the reference model size (T=500T{=}500, L=8L{=}8; G=16G{=}16 for SUPPORT/FLCHAIN and empirical groups for Expedia) and 7.77.7--9.1×9.1\times faster at G=128G{=}128 on the survival datasets; on Arm, 2.52.5--2.9×2.9\times and 5.55.5--6.0×6.0\times. On a scenario-analysis benchmark it is faster in all 1616 configurations on both machines. For f64 models, outputs match treelite GTIL up to tree-ordering roundoff; for f32 models, TreeWalker's f64 leaf accumulation is closer than native f32 to an exactly rounded reference on every audited row.

Figures & tables

Appendix figures & tables13 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Vectorized Dynamic Histograms for Sparse Oblique Forests

    Feb 27, 2026Ariel Lubonja, Jungsang Yoon, Haoyin Xu +6Gradient-Boosted Decision TreesTabular ML

  2. MotherTree: Meta-learning on synthetic data improves decision tree training

    Oct 7, 2026Ziyuan Wang, Fredrik D. JohanssonDecision Tree LearningMeta-Learning