Introduction
In modern high-performance CPU design, branch prediction is a critical mechanism for maintaining pipeline efficiency. Processors must speculate on the outcome of conditional statements (e.g., if-else blocks) to keep the execution units busy. A misprediction results in a pipeline flush, which wastes significant clock cycles and energy.
While traditional predictors and perceptron-based neural models have reached high levels of accuracy, they often require computationally expensive floating-point multiplications or massive input feature sets to capture complex, non-linear code execution patterns. This paper explores an alternative approach using Weightless Neural Networks (WNNs), specifically the WiSARD (Wilkie, Stoneham, and Aleksander’s Recognition Device) model, to achieve high accuracy with hardware-friendly logic.
The WiSARD Architecture
Unlike conventional neural networks that rely on weighted connections and complex activation functions, WiSARD uses RAM nodes as its fundamental processing units. These nodes act as look-up tables (LUTs) that store information about seen patterns.
As shown in the figure above, the process involves:
- Input Mapping: Input data is partitioned into $n$-bit chunks called $n$-tuples.
- Addressing: Each $n$-tuple serves as a direct address to a specific RAM node.
- Training and Inference: During training, the counter at the addressed location is incremented. During prediction, the model accesses these nodes and employs a "bleaching" process—a thresholding technique—to determine the output. This allows the network to learn non-linear functions naturally without the need for linear separability required by perceptrons.
Predictor Design and Implementation
The proposed predictor integrates various architectural features into the WiSARD framework. The input vector is a linear combination of the Program Counter (PC), Global History Register (GHR), Local History Registers (LHR), and the Global Path History Register.
The architecture utilizes two distinct discriminators: one for the "Taken" branch and one for the "Not Taken" branch. Each discriminator consists of multiple RAM nodes ($RAM_0$ to $RAM_{N-1}$). The final prediction is determined by which discriminator yields the highest cumulative response after the bleaching process. This design is inherently hardware-efficient because it replaces arithmetic multipliers with simple RAM lookups, which are faster and consume less area in silicon.
Experimental Results
The researchers evaluated the WiSARD-based predictor (labeled "W") using the 3rd Championship Branch Prediction (CBP-3) dataset, which covers Integer, Multimedia, and Server workloads. The model was compared against two state-of-the-art predictors: TAGE-SC-L (T) and the Multiperspective Perceptron (MP).
Key findings include:
- Superior Accuracy: WiSARD achieved an average accuracy of 96.04%, outperforming TAGE-SC-L (96.00%) and the Multiperspective Perceptron (95.95%).
- Input Efficiency: The WiSARD model utilized an input size of 2,158 bits, which is significantly smaller than the 3,127 bits used by TAGE-SC-L and 2,329 bits used by the Multiperspective Perceptron.
- Optimal Configuration: An $n$-tuple size of 25 was identified as the ideal balance for accuracy across diverse workloads.
Conclusion and Future Work
The WiSARD-based predictor demonstrates that Weightless Neural Networks can provide a high-accuracy, low-complexity alternative for branch prediction. By leveraging RAM-based look-up tables, the model achieves natural non-linearity and high input efficiency. Future research will focus on reducing the memory footprint of the RAM nodes—potentially using Bloom filters—and conducting detailed timing analyses for real-world silicon implementations.
Summary updated