Trainable Bitwise Soft Quantization for Input Feature Compression
Organizations: University of Münster (Germany) · University of Copenhagen (Denmark)
Abstract
The growing demand for machine learning applications in the context of the Internet of Things calls for new approaches to optimize the use of limited compute and memory resources. Despite significant progress that has been made w.r.t. reducing model sizes and improving efficiency, many applications still require remote servers to provide the required resources. However, such approaches rely on transmitting data from edge devices to remote servers, which may not always be feasible due to bandwidth, latency, or energy constraints. We propose a task-specific, trainable feature quantization layer that compresses the input features of a neural network. This can significantly reduce the amount of data that needs to be transferred from the device to a remote server. In particular, the layer allows each input feature to be quantized to a user-defined number of bits, enabling a simple on-device compression at the time of data collection. The layer is designed to approximate step functions with sigmoids, enabling trainable quantization thresholds. By concatenating outputs from multiple sigmoids, introduced as bitwise soft quantization, it achieves trainable quantized values when integrated with a neural network. We compare our method to full-precision inference as well as to several quantization baselines. Experiments show that our approach outperforms standard quantization methods, while maintaining accuracy levels close to those of full-precision models. In particular, depending on the dataset, compression factors of to can be achieved compared to -bit input without significant performance loss.
Figures & tables
| Name | Abbreviation | Source |
|---|---|---|
| Full Precision | FP | Baseline |
| Pre Minmax Quantization | Pr-MQ | Baseline |
| Pre Quantile Quantization | Pr-QQ | Baseline |
| Learnable Step Size Quantization | LSQ | [ 33 ] |
| Learnable Lookup Table with granule 4 | LLT4 | [ 34 ] |
| Learnable Lookup Table with granule 9 | LLT9 | [ 34 ] |
| Dataset | california | fried | superconduct | cpu_act | sulfur | wine | Mean |
|---|---|---|---|---|---|---|---|
| Bw-SQ | |||||||
| SQ | |||||||
| Bw-MQ | |||||||
| Bw-QQ |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Bit Width | Number of | Encoding Latency | Energy Consumption | Energy Consumption |
| Features | ( ) | ( ) | ( ) | |
| 2 | 6 | 10 | 0.00016 | 2.11 |
| 2 | 81 | 50 | 0.00073 | 9.79 |
| 3 | 6 | 10 | 0.00016 | 2.11 |
| 3 | 81 | 70 | 0.00102 | 13.54 |
| 4 | 6 | 10 | 0.00016 | 2.14 |
| Byte size | Latency ( ) | Energy Consumption ( ) | Energy Consumption ( ) |
|---|---|---|---|
| 8 bytes | 21 | 0.6733 | 8968.34 |
| 32 bytes | 140 | 4.0779 | 54318.13 |
| 128 byte | 250 | 8.4043 | 111945.38 |
| Dataset | Short Name | Source | OpenML ID | |||
|---|---|---|---|---|---|---|
| California Housing | california | [ 38 ] | 20640 | 8 | 8880 | 43979 |
| Fried | fried | [ 39 , 40 ] | 40768 | 10 | 1001 | 564 |
| Superconduct | superconduct | [ 42 ] | 21263 | 81 | 7449 | 43174 |
| CPU Activity Database | cpu_act | 8192 | 21 | 2192 | 197 | |
| Sulfur | sulfur | [ 41 ] | 10081 | 6 | 8636 | 23515 |
| Wine Quality | wine | [ 43 ] | 6497 | 11 | 241 | 287 |
| Schedule | |||
|---|---|---|---|
| 0.0001 | 0.001 | 0.01 | |
| Linear | 0.6315 | 0.6515 | 0.6421 |
| Warmup | 0.6425 | 0.6456 | 0.6604 |
| Cosine | 0.6401 | 0.6412 | 0.6320 |
| Cyclical | 0.6526 | 0.6473 | 0.6503 |
| Exponential | 0.6300 | 0.6201 | 0.6412 |
| Schedule | |||
|---|---|---|---|
| 0.0001 | 0.001 | 0.01 | |
| Linear | 0.1615 | 0.1790 | 0.1672 |
| Warmup | 0.1848 | 0.1741 | 0.1737 |
| Cosine | 0.1335 | 0.1336 | 0.1449 |
| Cyclical | 0.1595 | 0.1636 | 0.1896 |
| Exponential | 0.1197 | 0.1112 | 0.1230 |
| Name | Values | Description |
|---|---|---|
| dropout rate | [0.0, 0.2, 0.4, 0.5] | dropout rate for neurons during training |
| learning rate | [0.001, 0.0001] | learning rate for optimizer |
| hidden layers | [5, 6, 8, 10] | number of hidden layers |
| hidden neurons | [32, 64, 128, 256, 512, | number of neurons per hidden layer |
| 1024, 2048, 4096, 8192] | ||
| num epochs | [30, 50, 70] | number of epochs to train |
| dataset | bits | FP | Comparison models | Ours | ||||
|---|---|---|---|---|---|---|---|---|
| Pr-MQ | Pr-QQ | LLT4 | LLT9 | LSQ | Bw-SQ | |||
| california | 2 | 0.186 | 0.593 | 0.338 | 0.424 | 0.396 | 0.356 | 0.290 |
| 3 | 0.186 | 0.376 | 0.279 | 0.278 | 0.273 | 0.259 | 0.210 | |
| 4 | 0.186 | 0.326 | 0.213 | 0.219 | 0.222 | 0.216 | 0.185 | |
| 5 | 0.186 | 0.279 | 0.199 | 0.204 | 0.208 | 0.207 | 0.171 | |
| 6 | 0.186 | 0.254 | 0.189 | 0.197 | 0.197 | 0.195 | 0.173 | |
| dataset | bits | FP | Comparison models | Ours | ||||
|---|---|---|---|---|---|---|---|---|
| Pr-MQ | Pr-QQ | LLT4 | LLT9 | LSQ | Bw-SQ | |||
| california | 2 | [0.163, 0.210] | [0.565, 0.621] | [0.302, 0.374] | [0.387, 0.462] | [0.357, 0.435] | [0.322, 0.389] | [0.257, 0.323] |
| 3 | [0.163, 0.210] | [0.349, 0.402] | [0.248, 0.310] | [0.241, 0.315] | [0.243, 0.303] | [0.226, 0.291] | [0.178, 0.241] | |
| 4 | [0.163, 0.210] | [0.298, 0.354] | [0.188, 0.238] | [0.196, 0.241] | [0.190, 0.254] | [0.189, 0.243] | [0.154, 0.216] | |
| 5 | [0.163, 0.210] | [0.245, 0.313] | [0.171, 0.226] | [0.178, 0.230] | [0.178, 0.239] | [0.177, 0.236] | [0.147, 0.194] | |
| 6 | [0.163, 0.210] | [0.219, 0.289] | [0.164, 0.213] | [0.163, 0.232] | [0.172, 0.221] | [0.163, 0.226] | [0.142, 0.204] | |
| dataset | bits | Comparison models | Ours | ||
|---|---|---|---|---|---|
| SQ | Bw-MQ | Bw-QQ | Bw-SQ | ||
| california | 2 | 0.288 | 0.595 | 0.329 | 0.290 |
| 3 | 0.217 | 0.377 | 0.265 | 0.210 | |
| 4 | 0.214 | 0.312 | 0.207 | 0.185 | |
| 5 | 0.208 | 0.262 | 0.182 | 0.171 | |
| 6 | 0.200 | 0.230 | 0.177 | 0.173 | |
Neural Network Quantization
Neural network quantization represents weights, activations, and states with fewer bits to reduce memory use, computation, and deployment costs.
See all 404 papers