Bern2Edge: A Neurosymbolic Compiler for Edge Deployment via Bernstein Polynomial Networks
Organizations: Department of Electrical Engineering and Computer Science, University of California, Irvine, CA 92697 USA
Abstract
Deploying high-accuracy neural networks on resource-constrained edge devices remains challenging, as existing approaches treat training, compression, and hardware synthesis as separate stages, leaving a gap between software-trained models and efficient end-to-end deployment with limited support for interpretability. We propose Bern2Edge, an end-to-end framework that uses knowledge distillation to convert a pretrained teacher feed-forward network into hardware-efficient representations via Bernstein polynomial activations. This representation enables two deployment paths: (i) a high-fidelity LUT-based realization that preserves model fidelity under compression, and (ii) a symbolic rule-based representation derived from Bernstein activation geometry, enabling interpretable inference with explicit input-space constraints. The resulting BNNs achieve up to 2.12 percentage-point (pp) accuracy improvement over ReLU under identical compression constraints. At the system level, Bern2Edge achieves up to 99.8% latency reduction and 95.2% BRAM reduction relative to a W8A8 quantized teacher on an AMD Xilinx KV260 FPGA, while maintaining accuracy within 0.5 pp, and further deploys on a low-power Spartan-7 XC7S15 FPGA. The rule-based path reduces DSP usage by up to 89.0% at a cost of 1.5 pp in total accuracy.
Figures & tables
| Dataset | Arch. | Act. | Acc. (%) | CE Loss | Acc / CE | Latency | DSPs | BRAMs | LUTs |
| HIGGS-Small | ReLU | 70.98 0.20 | 0.553 | / | 85 | 108 | 0 | 5397 | |
| Bern | 71.92 0.26 | 0.540 | 87 | 106 | 2 | 5682 | |||
| ReLU | 71.84 0.24 | 0.540 | / | 121 | 156 | 0 | 6852 | ||
| Bern | 72.32 0.18 | 0.532 | 125 | 135 | 3 | 7294 | |||
| ReLU | 72.08 0.27 | 0.524 | / | 337 | 108 | 34 | 5114 | ||
| Bern | 72.53 0.18 | 0.512 | 339 | 103 | 44 | 5410 |
| Latency | BRAMs | Bernstein | ReLU | Acc | ||
| (cyc) | Acc (%) | (cyc, BRAM) | Acc (%) | (cyc, BRAM) | (pp) | |
| 76.50 0.44 | (189, 26) | 74.93 0.08 | (188, 25) | |||
| 82.98 0.16 | (397, 52) | 81.87 0.37 | (396, 49) | |||
| 91.09 0.27 | (963, 105) | 88.97 0.82 | (960, 113) | |||
| 95.05 0.05 | (2481, 136) | 93.53 0.18 | (2477, 137) | |||
| 96.39 0.02 | (7433, 179) | 95.62 0.12 | (7429, 169) | |||
| Arch | BNN Acc. (%) | Rules | Cov. (%) | Cov. Acc. (%) | Acc t (%) | ||
| 84.33 | 0.5 | 37 | 1.76 | 78.2 | 86.8 | 82.6 | |
| 0.1 | 45 | 1.67 | 91.5 | 84.5 | 81.7 | ||
| 84.42 | 0.5 | 45 | 2.04 | 84.9 | 87.2 | 83.2 | |
| 0.1 | 53 | 2.02 | 94.0 | 85.3 | 82.1 | ||
| 84.63 | 0.5 | 61 | 1.64 | 89.5 | 85.9 | 82.8 | |
| 0.1 | 85 | 1.75 | 95.8 | 85.3 | 82.0 |
| Arch | Method | Acc (%) | Latency | DSP | BRAM | LUT | FF |
| LUT | 84.33 | 77 | 77 | 2 | 4,329 | 5,582 | |
| Rules | 82.59 | 183 | 30 | 5 | 2,997 | 2,290 | |
| LUT | 84.42 | 119 | 109 | 4 | 6,019 | 8,333 | |
| Rules | 83.16 | 215 | 30 | 8 | 3,009 | 2,218 | |
| LUT | 84.63 | 376 | 301 | 28 | 15,609 | 22,865 | |
| Rules | 82.76 | 279 | 30 | 8 | 3,002 | 2,217 |
| Type | Method | Rules | Acc (%) | Fid (%) | |
| Decompositional | DeepRED [ 19 ] | 5.43 | 78.7 | 89.3 | |
| REM-D [ 35 ] | 5.41 | 78.6 | 89.4 | ||
| ECLAIRE [ 20 ] | 3.82 | 84.6 | 89.4 | ||
| Bern2Edge | no-KD ( ) | 1.84 | 84.2 | 91.8 | |
| no-KD ( ) | 82.9 | 94.3 | |||
| KD ( ) |
| Method | Acc (%) | Latency (cycles) | DSPs | BRAMs | URAMs |
| HIGGS-Small | |||||
| Teacher (W8A8) | 72.3 | 6,981 | 186 | 50 | – |
| Bern2Edge (LUT) | 72.3 | 125 ( 98.2%) | 135 ( 27.4%) | 3 ( 94.0%) | – |
| Covertype | |||||
| Teacher (W8A8) | 96.9 | 91,634 | 389 | 128 | 52 |
| Bern2Edge (LUT) | 96.4 | 7,433 ( 91.9%) | 326 ( 16.2%) | 149 ( 16.4%) | 3 ( 94.2%) |
| Model | Config. | LUT | FF | DSP | BRAM | Lat. | Pwr | Acc | Acc fp |
| 18K | (cyc) | (mW) | (%) | (%) | |||||
| Rules | R50 | 1,086 | 844 | 16 | 6 | 340 | 62 | 83.02 | — |
| R29 | 710 | 765 | 16 | 4 | 156 | 59 | 83.01 | — | |
| Bern. | 553 | 883 | 18 | 1 | 61 | 51 | 84.18 | 84.25 | |
| 635 | 804 | 19 | 1 | 82 | 63 | 84.57 | 84.64 | ||
| 662 | 777 | 19 | 1 | 115 | 63 | 84.88 | 84.86 |
| Conf. | Cov. (%) | Cov. Acc. (%) | Acc t (%) | Rules | |||
| 0.1 | 0.1 | 308 | 94.01 | 85.26 | 82.10 | 53 | 2.02 |
| 1.0 | 0.1 | 156 | 92.60 | 84.67 | 82.39 | 50 | 2.06 |
| 0.1 | 0.3 | 136 | 87.15 | 86.72 | 83.16 | 53 | 2.06 |
| 1.0 | 0.3 | 111 | 86.99 | 86.77 | 83.16 | 52 | 2.04 |
| 0.1 | 0.5 | 121 | 84.86 | 87.18 | 83.16 | 45 | 2.04 |
| 1.0 | 0.5 | 106 | 84.42 | 87.18 | 83.39 | 46 | 2.09 |
| Fallback | Acc. | Acc | Fid | LUT | FF | DSP | Lat. |
| Linear Regression | 81.67 | 67.4 | 84.1 | 1749 | 520 | 10 | 13 |
| Full BNN | 82.91 | 71.9 | 100.0 | 1887 | 2318 | 40 | 68 |
| Small BNN | 82.23 | 71.3 | 90.5 | 1129 | 2178 | 38 | 46 |
| CART | 83.02 | 72.1 | 87.7 | 714 | 471 | 0 | 26 |
| Empirical (%) | Certified (%) | ||||
| Rule Acc. | Fid. | Rules | BNN | ReLU | |
| 0.00 | 100.0 | 98.2 | 100.0 | 100.0 | 100.0 |
| 0.01 | 99.6 | 97.8 | 83.4 | 82.1 | 80.1 |
| 0.03 | 99.0 | 97.2 | 59.4 | 41.3 | 27.1 |
| 0.05 | 98.4 | 96.4 | 42.7 | 16.0 | 12.4 |
| 0.10 | 97.0 | 94.7 | 22.7 | 6.6 | 4.8 |
| Geographic shift | Temporal shift (CA) | |||||||||||
| System | Metric | ID (CA-18) | GEO-AVG | MS | WY | WV | TEMP-AVG | 2019 | 2021 | 2022 | ||
| ReLU Teacher | Acc. (%) | 81.28 0.09 | 74.32 0.64 | 7.0 | 73.73 | 74.61 | 74.61 | 80.00 0.09 | 1.3 | 80.74 | 79.82 | 79.44 |
| ReLU | Acc. (%) | 80.55 0.15 | 74.10 0.76 | 6.5 | 73.42 | 74.45 | 74.43 | 79.37 0.19 | 1.2 | 80.03 | 79.23 | 78.84 |
| BNN | Acc. (%) | 80.89 0.29 | 74.45 0.69 | 6.4 | 73.79 | 74.77 | 74.79 | 79.81 0.36 | 1.1 | 80.49 | 79.67 | 79.26 |
| Rules | Coverage (%) | 90.09 0.86 | 85.82 1.38 | 4.3 | 86.10 | 85.07 | 86.29 | 90.24 0.78 | 0.2 | 90.01 | 90.35 | 90.35 |
| Covered acc. (%) | 80.29 0.20 | 76.41 1.07 | 3.9 | 77.31 | 74.82 | 77.09 | 78.67 0.42 | 1.6 | 79.38 | 78.62 | 78.00 | |
| TinyBERT4 | ||||||
| Scope | Metric | GeLU | Bern | GeLU | Bern | |
| SST-2 Acc. (%) | 90.37 | 90.02 | 90.48 | 89.11 | 90.02 | |
| FFN | Lat. (cycles) | 6,413,520 | 3,282,640 ( 48.8%) | 3,278,288 ( 48.9%) | 1,789,648 ( 72.1%) | 1,785,296 ( 72.2%) |
| DSP | 121 | 121 (0.0%) | 80 ( 33.9%) | 121 (0.0%) | 80 ( 33.9%) | |
| BRAM | 155 | 82 ( 47.1%) | 128 ( 17.4%) | 80 ( 48.4%) | 108 ( 30.3%) | |
| FF | 17,746 | 19,580 ( 10.3%) | 15,654 ( 11.8%) | 19,528 ( 10.0%) | 15,568 ( 12.3%) | |
Edge Inference
Edge inference runs trained AI models on nearby devices such as phones, cameras, robots, and embedded computers under tight resource and latency limits.
See all 228 papers