Trainable Bitwise Soft Quantization for Input Feature Compression

Karsten Schrödter, Jan Stenkamp, Nina Herrmann, Fabian Gieseke

Abstract

The proliferation of Internet of Things (IoT) applications necessitates efficient machine learning solutions for resource-constrained edge devices. While model compression is well-studied, input feature compression remains a critical bottleneck for applications requiring data transmission to remote servers. We propose Bitwise Soft Quantization (Bw-SQ), a task-specific, trainable quantization layer that compresses input features by approximating step functions with differentiable sigmoids. This approach enables learning optimal quantization thresholds and values directly within the neural network training pipeline. Our experiments across six regression datasets demonstrate that Bw-SQ achieves compression factors of 5x to 16x compared to 32-bit precision while maintaining near-original accuracy, significantly reducing bandwidth and energy consumption for IoT deployments.

Introduction: The IoT Data Dilemma

Microcontrollers at the edge often lack the memory and compute power to execute complex neural networks locally. Consequently, many systems rely on offloading inference to remote servers. However, transmitting high-precision sensor data (typically 32-bit floats) is costly in terms of battery life and bandwidth. Standard "task-agnostic" compression methods, such as uniform rounding, often discard information critical to the specific prediction task. There is a clear need for a compression scheme that is both hardware-friendly for low-power devices and optimized for the downstream neural network's performance.

Methods: Bitwise Soft Quantization (Bw-SQ)

The core of our proposal is the Bw-SQ layer, designed to be integrated into a neural network during training and then decomposed for efficient edge execution.

Overview of the Bw-SQ framework showing (a) the training phase with a differentiable quantization layer and (b) the inference phase with on-device encoding and server-side decoding.

1. Differentiable Soft Step Functions

Standard quantization functions are non-differentiable, preventing gradient-based optimization. We overcome this by using sigmoid functions to approximate step functions. By adjusting a "temperature" parameter during training, the sigmoid gradually hardens into a step function, allowing the model to learn optimal thresholds through backpropagation.

2. Bitwise Concatenation

Unlike traditional soft quantization that sums outputs, Bw-SQ concatenates the results of multiple sigmoids into a bitwise vector. This allows the neural network to interpret each unique bit combination as a distinct state, effectively learning a task-specific lookup table for what each quantized state should represent.

3. Hardware-Friendly Inference

Post-training, the learned sigmoid thresholds are converted into simple decision trees. As shown in the figure above, a microcontroller can perform this encoding with minimal overhead, transmitting only a few bits per feature to the server. The server then decodes these bits into the learned representative values before passing them to the main neural network.

Experimental Evaluation

We evaluated Bw-SQ on six diverse regression datasets, including California Housing, Superconduct, and Wine Quality. The method was compared against full-precision (32-bit) models and standard quantization baselines like Minmax and Quantile quantization.

Key Results

  • Superior Accuracy: Bw-SQ consistently outperformed standard baselines, matching full-precision accuracy in many cases with as few as 3 or 4 bits per feature.
  • Massive Compression: The method achieved data reduction factors of 5x to 16x. For instance, reducing a 32-bit feature to 2 bits represents a 16x reduction in transmission volume.
  • Efficiency: Deployment tests on an ESP32-S3 microcontroller confirmed that the encoding process is extremely lightweight, consuming negligible energy compared to the savings gained from reduced radio transmission.

Conclusion

Bitwise Soft Quantization provides a robust framework for task-specific input compression in IoT environments. By making the quantization process trainable, we ensure that only the most relevant information is transmitted, bridging the gap between edge data collection and cloud-based inference. Future work will explore applying this technique to more complex architectures like CNNs and Transformers, as well as implementing dynamic bit-allocation across different features.

Summary updated

BibTeX
@inproceedings{schrodter2026trainable,
  author = {Karsten Schrödter and Jan Stenkamp and Nina Herrmann and Fabian Gieseke},
  title = {{Trainable Bitwise Soft Quantization for Input Feature Compression}},
  booktitle = {CPAL (Proceedings Track)},
  year = {2026},
  url = {https://openreview.net/forum?id=AhrDRUlzeD},
}
Figure