Hardware-efficient tractable probabilistic inference for TinyML Neurosymbolic AI applications

Jelin Leslin, Martin Trapp, Martin Andraud · DOI

Abstract

Neurosymbolic AI (NSAI) combines the perceptual strengths of deep learning with the logical rigor of symbolic reasoning. However, deploying these models on resource-constrained TinyML hardware remains a challenge due to the high numerical precision required for probabilistic inference. This paper presents a novel $n^{th}$-root compression technique designed for deterministic Probabilistic Circuits (det-PCs). By mathematically scaling model parameters, this approach mitigates numerical underflow on low-precision hardware, achieving significant reductions in FPGA resource utilization and substantial speedups on standard microcontrollers without sacrificing mathematical exactness.

1. Introduction

Deep Learning (DL) has revolutionized perception tasks such as image recognition and natural language processing. Despite these successes, DL models often operate as "black boxes," struggling with causal reasoning, explicit logic, and providing reliable uncertainty estimates. Neurosymbolic AI (NSAI) seeks to address these limitations by integrating neural networks with symbolic logic frameworks.

A primary vehicle for symbolic reasoning in this context is the Probabilistic Circuit (PC). While PCs offer tractable inference, they typically require 64-bit floating-point precision to prevent numerical underflow. As probabilities are multiplied across deep computational graphs, values quickly diminish beyond the range of 16-bit or 32-bit hardware. Consequently, edge devices are often forced to rely on slow, software-emulated 64-bit arithmetic, which is prohibitive for real-time TinyML applications. This work introduces a hardware-efficient framework to bridge the gap between complex symbolic logic and constrained edge hardware.

2. Methodology

The proposed framework utilizes a three-stage pipeline to optimize symbolic models for the edge:

2.1 Hardware-Suitable Modeling

The process begins by compiling Bayesian Networks into deterministic Probabilistic Circuits (det-PCs). Determinism is a structural property where, for any given input, only one path through the circuit's sum nodes is active. This property ensures that the computational graph remains mathematically manageable and predictable during inference.

2.2 $n^{th}$-root Compression

The core innovation of this work is the $n^{th}$-root transformation. By applying an $n^{th}$-root to all model parameters, the dynamic range of the probabilities is "squashed." This transformation moves the values further from the underflow floor of low-precision hardware (e.g., float32 or float16). This allows the model to utilize the native, high-speed Floating Point Units (FPUs) available on modern microcontrollers rather than falling back on emulated 64-bit math.

2.3 Exact Recovery

Because the circuits are deterministic, the scaling effect of the $n^{th}$-root transformation is uniform across the active computational path. The true probability can be exactly recovered at the output stage by raising the result back to the power of $n$. This ensures that the hardware-efficient low-precision computation does not introduce the approximation errors typically associated with quantization in standard neural networks.

3. Experimental Evaluation

The framework was evaluated across three distinct benchmarks representing different reasoning challenges:

  • DNA: A genetic sequence modeling task involving 180 variables.
  • BNetFlix: A movie recommendation dataset consisting of 100 variables.
  • colep: A hybrid NSAI task combining CIFAR-10 image classification with a symbolic consistency checker. This task verifies if neural network predictions align with predefined domain knowledge.

4. Results

Experimental results demonstrate that the $n^{th}$-root transformation makes symbolic reasoning practical for edge deployment:

  • FPGA Resource Efficiency: When implemented on a Xilinx Virtex UltraScale+, the framework reduced Flip-Flop (FF) usage by up to 82.3% and Look-Up Table (LUT) usage by 52.6% compared to a 64-bit baseline.
  • Microcontroller Performance: On an ESP32 microcontroller, the ability to use native float32 math resulted in an average inference speedup of 4.67x.
  • Memory Footprint: The approach reduced Flash memory usage by up to 18%, a vital saving for devices with limited storage capacity.
  • Hybrid Latency: In the "colep" NSAI task, the symbolic reasoning component added only 3ms of latency to a total inference time of 624ms, demonstrating that symbolic verification can be integrated with negligible overhead.

5. Discussion and Conclusion

This research proves that the bottleneck for symbolic AI on the edge is not merely computational complexity, but numerical dynamic range. By leveraging the mathematical properties of deterministic PCs, the $n^{th}$-root technique allows high-precision logic to run on "cheap" hardware without losing exactness.

Future work will focus on extending this technique to non-deterministic probabilistic models and exploring extreme quantization, such as 8-bit integer (INT8) representations. Additionally, further research is needed to automate the generation of symbolic attributes which were, in some experiments, provided by an external oracle. Ultimately, this framework provides a scalable path for bringing interpretable, logical AI to the smallest of edge devices.

Summary updated

BibTeX
@inproceedings{leslin2025hardware,
  author = {Jelin Leslin and Martin Trapp and Martin Andraud},
  title = {{Hardware-efficient tractable probabilistic inference for TinyML Neurosymbolic AI applications}},
  booktitle = {COINS},
  year = {2025},
  doi = {10.1109/coins65080.2025.11125733},
}
Figure