LIVE · Thursday 3 December

Best Decision Model for Edge Devices With No GPU: Boosted Trees in C First, a Small LLM Only for Text

On CPU-only edge hardware, gradient-boosted trees compiled to C answer sensor and tabular decisions in microseconds. A 3 to 4B model at 4 bits is worth its cost only when the decision depends on text or images.

By Nick10 min read

The best decision model for edge devices with no GPU is a small gradient-boosted tree ensemble (LightGBM or XGBoost) compiled to plain C, as long as the inputs are sensor readings, tabular fields or events. A small language model of 3 to 4 billion parameters at 4-bit quantization is worth its cost only when the decision depends on free text or images. No published benchmark has yet compared these model families, or compact decision models, on the same CPU-only device for decision accuracy. Any team that is choosing between them should run that comparison on its own chip.

A tree ensemble makes a decision with a few comparisons, so it needs no GPU

A decision tree reaches a prediction by following a short path of if/else comparisons on the input features. There is no matrix multiplication, which is the operation that GPUs are built to speed up. A boosted ensemble repeats this for a few dozen or a few hundred trees and adds up the scores. On a CPU, that work takes very little time and memory.

The published measurements match that description. InTreeger, a 2025 paper from Bart and colleagues, ran 14.5 million tree inferences on a Raspberry Pi ARMv7 core. The integer version took 7.79 seconds at an average of 2.81 W, and the floating-point version took 19.36 seconds at the same power. That works out to about half a microsecond and about 1.5 microjoules per decision in integer code. Those per-decision figures are arithmetic on the paper's totals, not numbers that the paper prints. The paper's tests used random forests, and it names XGBoost and LightGBM among the supported training libraries.

Trees also fit on hardware that is far smaller than a Raspberry Pi. On the RISC-V FE310 microcontroller, which runs at 16 MHz, the same paper reports 0.6 seconds per inference and a total memory footprint of 43,542 bytes.

Integer-only C code removes the need for a floating-point unit

Some microcontrollers have no floating-point unit (FPU), so every floating-point comparison is emulated in software. The GAP8 chip that Daghero and colleagues used in their 2023 study is one example, and the authors call it an "FPU-less target." Even chips with an FPU have limits. Espressif's documentation states that the ESP32 has a single-precision FPU, while double-precision calculations are emulated in software and are very slow.

InTreeger addresses this by generating C code that uses only integers. It is built on tl2cgen, the model compiler that turns tree models from XGBoost, LightGBM and scikit-learn into C source that can be built into a native binary. The authors report that the integer and floating-point models gave identical predictions on every test sample across 10 random data splits. The integer code was faster in every case that they tested, with speedups that ranged from a 4.8% runtime reduction to 2.1 times as fast.

Trees can be shrunk to a few kilobytes, but that result has been calculated rather than measured

When flash or RAM is measured in kilobytes, model size becomes the main constraint. "Boosted Trees on a Diet," by Stenkamp, Herrmann and colleagues at the universities of Münster and Rostock, trains boosted trees that reuse the same features and thresholds. It then stores them in a compact bit-wise layout. The University of Münster lists the paper as accepted at ICLR 2026.

The authors report the same accuracy as LightGBM in 4 to 16 times less memory. On Covertype, a 581,012-row dataset that predicts forest cover type from map data, a 2 KB model reached 69% accuracy. Quantized LightGBM needed 8 KB to match it, and float32 LightGBM needed 16 KB.

These sizes come from the proposed memory layout. They were not measured on a microcontroller, and the authors list deployment to different microcontrollers as future work. The result is a strong reason to try the method, but it does not guarantee the same size on a specific board.

Running fewer trees on easy inputs cuts energy without losing accuracy

A second technique adjusts the work to each input. The GAP8 study stops evaluating the ensemble early once its running score passes a set confidence margin. On an 8-core RISC-V chip at 100 MHz, this cut energy per inference by up to 37.9% for boosted trees, from 14.20 to 8.82 microjoules, with no accuracy loss. Accepting a 1% drop in score raised the savings to between 46.5% and 60% across the three datasets.

The same idea of acting only on confident cases explains why calibration matters for every model family. A model whose confidence scores match its real accuracy can safely hand its uncertain cases to something else.

A small LLM is needed when the decision depends on text or images

Trees need numeric features. When the input is a support ticket, a driver's note or a photo of a damaged parcel, someone must first turn that input into features, and that step is often the hard part. A small language model reads the raw text directly and can be asked to pick one label from a fixed list.

The cost of that flexibility is large on a CPU. Meta's model card for Llama 3.2 3B reports that a 4-bit SpinQuant version on a OnePlus 12 phone CPU decodes 19.7 tokens per second and processes prompts at 89.7 tokens per second. It uses 3,726 MB of memory while running. A separate llama.cpp benchmark suite on GitHub does not name its hardware. It reports 3 to 6 tokens per second for 3 to 7B models on four threads, with peak RAM of 3.5 to 12 GB.

The 3 to 4B models that fit this role have different licences and strengths:

  • Qwen3.5-4B is released under Apache 2.0 and accepts images as well as text, according to its Hugging Face model card. Its thinking mode is on by default, so a decision task should switch it off with enable_thinking: False to avoid long outputs.
  • Phi-4-mini-instruct has 3.8 billion parameters under the MIT licence, and Microsoft lists memory-constrained and compute-constrained environments among its intended uses.
  • Llama 3.2 3B Instruct has 3.21 billion parameters under Meta's Llama 3.2 Community License, which is a custom licence rather than a standard open-source one.

At the Q4_K_M setting in llama.cpp, which stores 4.89 bits per weight, a 3.21-billion-parameter model needs about 1.96 GB for its weights alone. That figure is arithmetic, not a measured file size. Together with the runtime's own memory use, a board with 4 GB is tight and a board with 8 GB is more comfortable. The Raspberry Pi 5 is sold with 1 to 16 GB of LPDDR4X memory.

Memory bandwidth limits how fast a small LLM runs on a CPU

Every generated token requires the CPU to read the model's weights from memory again. For that reason, memory bandwidth limits speed more than core count does. A December 2025 paper from the University of Cantabria ran 11 small models in llama.cpp on an Intel i5-12400 and on the ARM cores of an NVIDIA Jetson Orin Nano Super. Both CPUs reached around half of the Jetson GPU's throughput. The ARM CPU drew about 10 W against about 75 W for the x86 system, and its tokens per joule came close to the GPU's.

The GitHub suite shows the same limit from another angle. Going from one to four threads roughly doubled decoding speed, while going from four to eight threads gave almost no gain or made it worse. Buying more cores therefore helps less than buying faster memory.

None of these sources measured decision accuracy. They report tokens per second and energy, which describe chat speed rather than how often a model picks the right label.

A worked example shows that a tree decision costs millions of times less than an LLM decision

The gap between the two families can be estimated from the published figures, with every assumption shown. These figures come from different devices, so they show orders of magnitude rather than a benchmark result.

  1. A tree decision costs what InTreeger measured on a Raspberry Pi core: 7.79 seconds for 14.5 million inferences, or about 0.54 microseconds. At 2.81 W, that is about 1.5 microjoules.
  2. An LLM decision uses an assumed 400-token prompt and a 5-token answer at the OnePlus 12 rates for 4-bit Llama 3.2 3B. That is 400 / 89.7 = 4.46 seconds plus 5 / 19.7 = 0.25 seconds, or about 4.7 seconds.
  3. The board is assumed to run one LLM request at a time and to draw about 10 W, the level that the Cantabria paper reports for its ARM CPU. These LLM rates were measured on other ARM devices, not on a Raspberry Pi 5.

Suppose that a site needs 1 million decisions a day on Raspberry Pi 5 boards with 16 GB, which the product page lists at $305. With trees, 1 million decisions take about 0.54 seconds of processor time and about 1.5 joules, so one board handles the load. With the LLM, one board completes 86,400 / 4.7 = about 18,400 decisions a day. Handling 1 million decisions would need about 55 boards, or about $16,800 in boards. Each LLM decision uses about 47 joules, so 1 million decisions use about 47 megajoules, or about 13 kWh a day.

A small LLM is therefore worth running only for the share of decisions that trees cannot make. A practical design sends numeric cases to the tree model and sends only the text or image cases to the language model.

Compact decision models offer calibrated choices, but none has published CPU results

A third family sits between the two. A decision model takes the input and a fixed list of options and returns a probability for each option instead of generating text. That design makes deferral simple: the device acts on confident cases and passes the rest to a larger model or a person.

Parsec's TOD is one released example. Parsec describes it as a "universal decision model" that reads text and images and ranks the next action from a supplied list, with a confidence gate that hands uncertain turns to a parent model. The open release is LoRA adapters on Google's Gemma 4 12B model plus a retriever. Every published latency figure is from a data-center GPU, such as a median of 69 ms on one H100. Neither Parsec's page nor its repository mentions CPU or edge deployment. The repository warns that 8-bit quantization through bitsandbytes flips 8% of picks, which is relevant because edge use depends on quantization. Whether TOD runs acceptably on a Raspberry Pi has not been measured.

Literal Labs makes a separate claim for its Tsetlin machine, which is a logic-based model rather than a tree or a neural network. Its benchmark page reports 250 times faster inference than XGBoost and 130 kB less memory on an ESP32 across seven datasets. That page is the vendor's own benchmark, it does not report accuracy, and its method is in a whitepaper behind a sign-up form.

The right choice depends on the input type and the device

The published results support one choice for each situation:

  1. Choose boosted trees compiled to C when the inputs are numbers, such as sensor readings, counters or tabular fields. This holds on every device class, from a microcontroller to an x86 box. Use integer thresholds through InTreeger or similar code when the chip has no FPU.
  2. Add toad-style compression or early stopping when the model must fit in a few kilobytes or run on a battery. Measure the result on the board, because the published sizes were calculated.
  3. Choose a 3 to 4B model at 4 bits only when the decision depends on free text or images. The device also needs several gigabytes of RAM, such as a Raspberry Pi 5 with 8 or 16 GB or a small x86 machine. Expect decisions to take seconds rather than microseconds.
  4. Consider a calibrated decision model that defers when wrong decisions are costly and a larger model or a person is available for the uncertain cases. Check first that the model has published or reproducible CPU numbers for your hardware.

A fair test on your own device should measure accuracy, calibration and cost together

Because no cross-family benchmark exists, a team that is choosing a model should run a small one. A useful test covers these points:

  1. Run each candidate on the actual hardware matrix that you might ship: a microcontroller (trees only, with its FPU status recorded), a Raspberry Pi 5 or similar ARM board, and a low-power x86 machine. Record the RAM of each device.
  2. Use two task tracks: one tabular or sensor task, such as Covertype or your own maintenance data, and one text or image task with a fixed option list, such as ticket routing. This shows where trees stop being enough.
  3. Record decision accuracy, expected calibration error and accuracy at a deferral threshold for each model. Add p50 and p95 latency, peak RAM, size on disk and energy per decision where a power meter is available.
  4. Fix the versions and settings of each baseline. Export LightGBM or XGBoost through tl2cgen in float and integer form. Run Qwen3.5-4B, Phi-4-mini and Llama 3.2 3B at Q4_K_M in llama.cpp, and run any decision model under the same conditions.
  5. Publish the harness, data splits, raw logs and test date so that the result can be re-run when new versions appear.

Sources

More in Research

All Research →