Boosted Trees on a Diet: Compact Models for Resource-Constrained Devices

Nina Herrmann, Jan Stenkamp, Benjamin Karic, Stefan Oehmcke, Fabian Gieseke

The "TinyML" revolution aims to bring machine learning directly to the edge—embedding intelligence into smart home sensors, industrial monitors, and wearable health devices. However, these edge devices, such as the Arduino Nano or ESP32, operate under extreme memory constraints, often possessing as little as 32 KB of RAM and 256 KB of flash storage.

Microcontroller running a Tiny Tree model for sensor data

While Gradient Boosted Decision Trees (GBDTs) like XGBoost or LightGBM remain the gold standard for tabular data, they are notoriously memory-hungry. Standard implementations rely on 32-bit or 64-bit pointers to navigate complex tree structures and store redundant feature and threshold values across hundreds of trees. This paper introduces a novel framework called "Trees on a Diet" (ToaD), designed to shrink GBDTs so they can fit onto tiny microcontrollers without sacrificing predictive performance.

The ToaD Framework: How It Works

ToaD achieves massive compression through a two-pronged approach: algorithmic regularization and a highly optimized memory layout.

1. Feature and Threshold Regularization

Standard training algorithms focus solely on maximizing accuracy improvement (gain). ToaD modifies the objective function to introduce a penalty for using new features or new thresholds. Conversely, if a feature or threshold has already been used elsewhere in the ensemble, it becomes "free" to reuse. This forces the model to be frugal, resulting in an ensemble that relies on a small, shared pool of parameters rather than generating unique split points for every node.

2. Specialized Memory Layout

To capitalize on the shared parameter pool, ToaD employs a specialized, pointer-less bit-wise memory layout:

  • Pointer-less Trees: Because the trees are typically shallow (depth < 5), they are stored in a compact array. Child nodes are located via mathematical indexing (e.g., $2i+1$) rather than memory-consuming pointers.
  • Global Lookup Tables: Instead of each node storing its own threshold and leaf value, nodes store small bit-indices that point to global arrays.
  • Bit-wise Encoding: The layout uses the absolute minimum number of bits necessary. For example, if a feature only requires a boolean split, it is stored as a 1-bit threshold rather than a standard 32-bit float.
Pointer-less tree structure mapping to global lookup tables

Key Insights

  • The "Free" Reuse Principle: The authors realized that memory isn't just consumed by the number of nodes, but by the uniqueness of the values within them. By incentivizing the model to reuse a threshold (e.g., "Is temperature > 20°C?") across multiple trees, the storage cost for that threshold is amortized across the entire ensemble.
  • The Reusing Factor (ReF): To quantify efficiency, the paper introduces the ReF metric. A model with an ReF of 2.0 means that, on average, every stored threshold or leaf value is used twice in the ensemble. Peak compression often occurs at "ReF peaks," where accuracy remains high but the parameter pool is exceptionally small.
  • Shallow is Better for TinyML: The research reinforces that for embedded devices, utilizing many shallow trees is often more memory-efficient and easier to compress than relying on a few deep trees, especially when using pointer-less array storage.

Experimental Results

Evaluated across eight diverse public datasets (including Covertype, California Housing, and Mushroom), ToaD demonstrated remarkable efficiency:

  • Massive Compression: ToaD achieved the same accuracy as LightGBM while being 4 to 16 times smaller. On the Covertype dataset, ToaD matched the performance of a 16 KB float32 LightGBM model using only 2 KB.
  • Superiority over Baselines: The framework consistently outperformed other compression techniques, such as FP16 quantization and cost-efficient gradient boosting (CEGB), across almost all memory limits.
  • Real-world Latency: When deployed on an Arduino Nano 33 BLE, a ToaD model took approximately 0.51 milliseconds per prediction. While this is roughly 5x slower than a standard uncompressed model due to the overhead of bit-wise decoding, it remains well within the requirements for real-time sensor processing.

Limitations and Future Directions

While ToaD opens new doors for autonomous edge analytics, it does have limitations. The bit-wise operations required to "unpack" the model during inference add computational latency, which could be a bottleneck for ultra-high-frequency applications. Furthermore, while the model currently shares leaf values, it doesn't explicitly penalize the creation of new ones during training; adding a leaf-value regularizer could yield even higher compression. Finally, scaling to multiclass problems remains a challenge, as GBDTs typically require one ensemble per class, causing memory usage to scale linearly.

Summary updated

BibTeX
@inproceedings{herrmann2026boosted,
  author = {Nina Herrmann and Jan Stenkamp and Benjamin Karic and Stefan Oehmcke and Fabian Gieseke},
  title = {{Boosted Trees on a Diet: Compact Models for Resource-Constrained Devices}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=batDcksZsh},
}
Figure