What are the inference latency bottlenecks of a large gradient-boosted ensemble compared to a linear model?

Quick Overview

Compares the inference cost of a large gradient-boosted tree ensemble with that of a linear model. Tests whether you can explain where prediction time goes on real hardware, including branches, caches and vectorization, and how to cut ensemble latency for online serving.

What are the inference latency bottlenecks of a large gradient-boosted ensemble compared to a linear model?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What are the inference latency bottlenecks of a large gradient-boosted ensemble compared to a linear model? Explain where the time goes in a single prediction for each model and how you would bring the ensemble's latency down. ```hint Count the work Write down what one prediction costs for each model. Does it grow with the number of features, or with something else? ``` ```hint Think about the hardware Operation counts are only part of it. Ask how each model's work runs on a modern CPU: the branch predictor, the caches and the SIMD units. ``` ### What a Strong Answer Covers - How the per-row cost of each model scales, with a rough size estimate for a large ensemble - The hardware effects of tree traversal: branch mispredictions, cache misses and poor vectorization - Overhead outside the model itself, such as per-call framework cost and feature fetching - Concrete ways to reduce ensemble latency and what each one gives up ### Follow-up Questions - How do oblivious trees, as in CatBoost, make evaluation branch-free, and what do they cost in accuracy? - How does compiling trees to native code with `treelite` change the memory access pattern compared with walking node arrays? - Under a p99 latency target, how would you decide between batching requests and serving one row at a time? - When would you distill a GBDT into a smaller model, and how would you check that the smaller model is good enough to ship?

Overview: Compares the inference cost of a large gradient-boosted tree ensemble with that of a linear model. Tests whether you can explain where prediction time goes on real hardware, including branches, caches and vectorization, and how to cut ensemble latency for online serving.

PracHub logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What are the inference latency bottlenecks of a large gradient-boosted ensemble compared to a linear model?

Explain where the time goes in a single prediction for each model and how you would bring the ensemble's latency down.

What a Strong Answer Covers Guidance

  • How the per-row cost of each model scales, with a rough size estimate for a large ensemble
  • The hardware effects of tree traversal: branch mispredictions, cache misses and poor vectorization
  • Overhead outside the model itself, such as per-call framework cost and feature fetching
  • Concrete ways to reduce ensemble latency and what each one gives up

Follow-up Questions Guidance

  • How do oblivious trees, as in CatBoost, make evaluation branch-free, and what do they cost in accuracy?
  • How does compiling trees to native code with treelite change the memory access pattern compared with walking node arrays?
  • Under a p99 latency target, how would you decide between batching requests and serving one row at a time?
  • When would you distill a GBDT into a smaller model, and how would you check that the smaller model is good enough to ship?