BeFit: Shifting Complexity from Weights to Bernstein Activations for Resource-Constrained Sensing

Malak Gamal El-Din, Yasser Shoukry, Salma ElmalakiarXiv 2026 · arXiv

TL;DR

BeFit is an end-to-end framework that enables high-performance deep learning on tiny microcontrollers by shifting model complexity from weights to learnable Bernstein polynomial activations. By projecting weights to multiplication-free codes and using lookup-table-based activations, it achieves massive speedups (up to 5.9x) and memory reductions with minimal accuracy loss compared to standard tinyML baselines.

What Problem Does This Paper Address?

Deploying neural networks on resource-constrained microcontrollers (MCUs) is a constant battle against limited memory and compute power. To fit these "TinyML" budgets, researchers often use aggressive compression like quantization or pruning, but this typically leads to significant accuracy drops.

Furthermore, many low-power MCU cores lack hardware multipliers or find multiplication operations computationally expensive. While "multiplication-free" networks (using ternary or power-of-two weights) exist, they often struggle to maintain high accuracy in the very small models required for sensing tasks like human activity recognition or keyword spotting. The authors identify a key gap: existing methods keep activations fixed, forcing the restricted weights to carry all the model's representational capacity.

Methods

The core innovation of BeFit is shifting model capacity from weights to activations. The framework consists of four main stages:

  1. Hardware-Aware Neural Architecture Search (NAS): BeFit searches for a compact student architecture (BeCNN) that fits within specific MCU memory and instruction limits. Crucially, it treats the degree of the Bernstein polynomial activation as a "free" dimension—higher degrees increase capacity during training but don't increase inference cost on the device.
  2. Knowledge Distillation (KD): The selected BeCNN is trained using a large, high-accuracy "teacher" model to maximize its performance.
  3. Weight Projection and Recovery: Convolutional weights are projected onto multiplication-free codes (like ternary values $\{-1, 0, 1\}$ or powers of two). Instead of the standard approach of retraining weights to recover accuracy, BeFit freezes the weights and retrains the learnable Bernstein activations.
  4. Projection-Aware Kernel Generation: The framework generates specialized C code for the target MCU. Convolutions are implemented using only shifts and additions, and the flexible Bernstein curves are precomputed into 64-entry lookup tables (LUTs), making activation evaluation a single memory load.
Figure 1: BeFit pipeline. A hardware-aware NAS finds a compact BeCNN, and a high-accuracy teacher helps train it via KD. The BeCNN’s convolutional weights are projected to multiplication-free codes, the learnable activations recover the lost accuracy, and a generated kernel exploits these codes for MCU deployment. Weights and curves are illustrative.

Datasets

The authors evaluated BeFit across six diverse sensing tasks:

  • Human Activity Recognition (HAR): UCI-HAR, HHAR, and PAMAP2 datasets.
  • Keyword Spotting (KWS): Google Speech Commands v2 (evaluated on both 12-word and 35-word tasks).
  • Wi-Fi Localization: UJIIndoorLoc (used to test the framework on Multi-Layer Perceptrons).

Key Insights and Ideas

  • Capacity Trade-off: By making weights "dumb" (simple codes) and activations "smart" (learnable polynomials), BeFit exploits the fact that on MCUs, memory loads (for LUTs) and shifts/adds are much cheaper than multiplications.
  • The "Free" Degree: Because any Bernstein polynomial, regardless of its degree, compiles into the same size lookup table, developers can increase model expressiveness without any penalty to deployed latency or flash usage.
  • Activation-Led Recovery: The most surprising finding is that retraining only the activation curves can recover the vast majority of accuracy lost when weights are aggressively compressed to just a few bits.
Inside a BeCNN: standard activations are replaced by flexible, learnable Bernstein curves.

Key Results

  • Accuracy: BeCNNs are, on average, 2.75 percentage points (pp) more accurate than standard ReLU-based CNNs of the same size.
  • Speed and Efficiency: On a TI CC3220SF (Cortex-M4), BeFit models ran 2.2x faster than their unprojected versions. Compared to the MLPerf Tiny reference model (DS-CNN), BeFit achieved 1.0 pp higher accuracy while being 5.9x faster and using 6.4x less flash memory.
  • Multiplier-less Performance: In simulations of a RISC-V core without a hardware multiplier, BeFit reduced instruction counts by a staggering 147x compared to standard models.
  • Teacher Proximity: Across all tasks, the final compressed, multiplication-free models stayed within 1.56 pp of their original, high-compute float32 teacher models.

Limitations and Future Work

While BeFit significantly optimizes the convolutional backbone, the authors note a few remaining hurdles:

  • The Final Layer: The final fully-connected classifier layer still uses standard int8 multiplications.
  • Transformers: In transformer architectures, the "attention" mechanism involves multiplying two activations together, which currently cannot be projected into multiplication-free codes using this method.
  • On-Device Adaptation: The authors suggest that because the weights are frozen, future work could involve "fine-tuning" only the activation LUTs on the device itself to adapt to new users or sensor drift without needing heavy re-training.

Summary updated

Abstract

Time-series sensing increasingly relies on neural networks, yet deployment on resource-constrained microcontrollers remains challenging. Aggressive model compression can reduce accuracy, while restricting weights to multiplication-free representations introduces further losses. We present BeFit, an end-to-end framework that shifts model capacity from weights to learnable Bernstein polynomial activations. BeFit (i) finds compact Bernstein-activated convolutional neural networks (BeCNNs) through hardware-aware neural architecture search and trains them via knowledge distillation; (ii) projects their weights to multiplication-free codes, freezes the codes, and recovers the resulting accuracy loss through the learnable activations; and (iii) generates model-specific kernels that exploit the projected weights for multiplication-free convolutions. On human activity recognition, BeCNNs are 2.75 percentage points (pp) more accurate on average than ReLU CNNs of identical architecture. On a TI CC3220SF (Cortex-M4), weight projection speeds BeCNNs up by 2.2x on average while losing 0.8 pp, compared with 2.4 pp for ReLU CNNs. Against the MLPerf Tiny DS-CNN reference model running on TensorFlow Lite Micro with CMSIS-NN, the unprojected BeCNN achieves 1.0 pp higher accuracy, 2.2x lower latency, and 6.4x lower flash, while the projected model remains within 1.0 pp of the reference accuracy and runs 5.9x faster. In emulation on a RISC-V core without a hardware multiplier, the instruction-count reduction relative to the DS-CNN increases from 5.2x on the Cortex-M4 to 147x. BeFit also extends to transformers and MLPs, and across all tasks the final models stay within 1.56 pp of their float32 teachers on average.
BibTeX
@misc{eldin2026befit,
  author = {Malak Gamal El-Din and Yasser Shoukry and Salma Elmalaki},
  title = {{BeFit: Shifting Complexity from Weights to Bernstein Activations for Resource-Constrained Sensing}},
  year = {2026},
  eprint = {2611.23520},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23520},
}
Figure