What happened
Shopify’s delivery system uses a discrete-time hazard model to estimate the conditional probability that a package arrives on each future date. (shopify.engineering) A forecast scores related rows through the same tree ensemble: shipment features stay fixed while horizon and calendar features vary. (shopify.engineering) At checkout, the system must forecast delivery dates for multiple shipping methods under a small latency budget. (shopify.engineering)
TreeWalker groups rows whose constant features the group’s producer guarantees are equal. (shopify.engineering) It shares decisions on those fixed features and prepares answers for repeated tests on varying features so they can be reused across trees. (shopify.engineering) At model load, it identifies repeated predicates and matching prefixes. (shopify.engineering) For each input group, it sorts values once per varying numeric feature and sweeps distinct thresholds to build reusable predicate masks. (shopify.engineering) Row masks track active subsets with one bit per row; traversal can skip an empty sibling branch when all rows in a subset take the same branch, an optimization Shopify calls the unsplit shortcut. (shopify.engineering) Grouped traversal keeps the learned tests and leaf contributions unchanged. Compact nodes and a preferred child placed next to its parent improve locality and let traversal continue along that path in a loop. (shopify.engineering)
Separately from the internal delivery-model measurement, Shopify’s published paper evaluates the public survival datasets SUPPORT and FLCHAIN. (shopify.engineering)
In Shopify’s internal measurement, TreeWalker scored its delivery model 3.96× faster than the current delivery evaluator, with training, trees and results unchanged. (shopify.engineering)
Why it matters
A promising fit is batch scoring where rows share features that the caller can guarantee are constant, such as forecasts that vary by horizon while retaining shipment attributes. The potential gain depends on group size: sorting and preparing reusable masks can cost more than they save.
Limits and uncertainty
The 3.96× figure is Shopify’s internal comparison, not a general benchmark. Preparation has sorting, threshold-sweeping and mask-storage costs, especially for small groups; wider groups need more mask words, and leaf contributions still have to be added to each active row. (shopify.engineering) Shopify also says a naive implementation that copies row lists at each decision point would be slower than plain LightGBM. (shopify.engineering) The available description does not include the paper’s complete evaluation or results.
Reader takeaway
TreeWalker’s result is a workload-specific case for grouped tree inference: when rows share guaranteed-constant features, decision work can be reused without retraining. Shopify measured a 3.96× speedup on its delivery model, but sorting, mask storage and per-row output updates mean the approach is not automatically faster for small groups or every model.
Open question
How does the speedup vary with group size and model characteristics across the full SUPPORT and FLCHAIN evaluation?