[Paper Review] Template-Based Posit Multiplication for Training and Inferring in Neural Networks
This paper presents a template-based posit multiplication algorithm supporting zero exponent bits (es=0), enabling efficient sigmoid computation and integration into the FloPoCo framework. It demonstrates for the first time that training neural networks with 8-bit posits (⟨8,0⟩) achieves convergence comparable to floating-point, with 8-bit posits matching 32-bit float accuracy on MNIST and showing promise despite accuracy loss on CIFAR-10.
The posit number system is arguably the most promising and discussed topic in Arithmetic nowadays. The recent breakthroughs claimed by the format proposed by John L. Gustafson have put posits in the spotlight. In this work, we first describe an algorithm for multiplying two posit numbers, even when the number of exponent bits is zero. This configuration, scarcely tackled in literature, is particularly interesting because it allows the deployment of a fast sigmoid function. The proposed multiplication algorithm is then integrated as a template into the well-known FloPoCo framework. Synthesis results are shown to compare with the floating point multiplication offered by FloPoCo as well. Second, the performance of posits is studied in the scenario of Neural Networks in both training and inference stages. To the best of our knowledge, this is the first time that training is done with posit format, achieving promising results for a binary classification problem even with reduced posit configurations. In the inference stage, 8-bit posits are as good as floating point when dealing with the MNIST dataset, but lose some accuracy with CIFAR-10.
Motivation & Objective
- Address the lack of efficient posit arithmetic support in existing frameworks, particularly for low-precision configurations with zero exponent bits.
- Enable training and inference in neural networks using the posit number system, which promises better accuracy and hardware efficiency than IEEE 754 floating-point.
- Develop a generic, synthesizable posit multiplier algorithm that supports all ⟨n,es⟩ configurations, including es=0, to facilitate deployment in hardware.
- Evaluate the performance of posits in both training and inference stages of neural networks, focusing on accuracy, convergence, and resource efficiency.
- Demonstrate that posits can be viable alternatives to floating-point in deep learning workloads, especially in low-precision scenarios with reduced memory and area footprint.
Proposed method
- Design a generic posit multiplication algorithm that handles variable-length regimes and supports zero exponent bits (es=0), enabling fast sigmoid approximation.
- Implement the algorithm as a reusable template within the FloPoCo framework, allowing automatic synthesis and integration into hardware designs.
- Use the template-based multiplier in a neural network training pipeline with mean squared error (MSE) loss and stochastic gradient descent, comparing convergence across formats.
- Train a small feedforward neural network using 8-bit to 32-bit posits and 32/64-bit floats, tracking loss over 2500 epochs to assess convergence behavior.
- For inference, convert pre-trained floating-point models (LeNet-5) to 8-bit posits (⟨8,0⟩), simulating inference with a NumPy-based posit library and evaluating accuracy on MNIST and CIFAR-10.
- Explore a hybrid posit-float architecture where only additions are performed in posit format to mitigate accuracy loss on complex datasets.
Experimental results
Research questions
- RQ1Can a generic posit multiplication algorithm be designed and synthesized that supports zero exponent bits (es=0), enabling efficient sigmoid computation in neural networks?
- RQ2Does training neural networks with low-precision posits (e.g., ⟨8,0⟩) lead to convergence and performance comparable to 32-bit floating-point training?
- RQ3How do 8-bit posits (⟨8,0⟩) perform in inference on standard datasets like MNIST and CIFAR-10 compared to 32-bit floating-point models?
- RQ4Can hybrid posit-float architectures improve inference accuracy while retaining the memory and area benefits of posits?
- RQ5What is the trade-off between precision, convergence speed, and accuracy when using different posit configurations (⟨8,0⟩, ⟨10,0⟩, ⟨16,1⟩, etc.) in deep learning workloads?
Key findings
- The proposed template-based posit multiplier successfully supports all ⟨n,es⟩ configurations, including es=0, and is integrated into the FloPoCo framework for hardware synthesis.
- Training with ⟨8,0⟩ posits converges to a stable loss (0.1530 at epoch 1250), though with slower convergence than 32-bit float or higher-precision posits.
- 8-bit posits (⟨8,0⟩) achieve 99.40% Top-1 accuracy on MNIST, slightly outperforming 32-bit floating-point (99.22%), indicating strong suitability for low-precision inference.
- On CIFAR-10, 8-bit posits suffer a 12% drop in Top-1 accuracy (56.11% vs. 68.04% for float), highlighting limitations in complex image recognition tasks.
- A hybrid architecture where only additions are computed in posit format improves accuracy on CIFAR-10 (58.92% Top-1) but still underperforms full-precision float.
- Posits with 16 or 32 bits (⟨16,1⟩ and ⟨32,2⟩) show convergence and accuracy levels nearly identical to 32-bit float, suggesting viability for high-accuracy workloads.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.