Retrieval-Guided Reinforcement Learning for Boolean Circuit Minimization

Animesh Basak Chowdhury, Marco Romanelli, Benjamin Tan, Ramesh Karri, Siddharth Garg

Abstract

Logic synthesis is a foundational step in digital design, where high-level hardware descriptions are optimized into efficient Boolean logic gate networks. Finding the optimal sequence of optimization heuristics, known as a synthesis recipe, is a complex combinatorial problem. While Reinforcement Learning (RL) and Monte Carlo Tree Search (MCTS) have shown promise in automating this process, they often suffer from performance degradation when encountering out-of-distribution (OOD) circuit designs. This paper introduces ABC-RL, a retrieval-guided framework that adaptively modulates the influence of a pre-trained RL policy based on the novelty of the input circuit. By utilizing a lightweight similarity check, ABC-RL achieves up to a 9x speedup in runtime and a 24.8% improvement in Area-Delay Product (ADP) over state-of-the-art baselines.

Introduction

In Electronic Design Automation (EDA), logic synthesis transforms high-level code (e.g., Verilog) into a netlist of Boolean gates. To minimize the area and delay of the resulting hardware, engineers apply a sequence of optimization heuristics. However, the search space for these recipes is vast—exceeding $10^7$ combinations for even a short 10-step sequence.

Traditional methods like Monte Carlo Tree Search (MCTS) are effective but computationally expensive. Recent efforts to accelerate this search using pre-trained RL agents have encountered a significant hurdle: distribution shift. When an agent trained on specific circuit types (e.g., arithmetic units) is applied to novel configurations (e.g., memory controllers), it often provides "confident but wrong" guidance. This leads to sub-optimal results that can be worse than a search performed without any AI assistance.

Methodology

ABC-RL addresses the distribution shift problem by balancing the "intuition" of a pre-trained agent with the "exploration" capabilities of a raw search algorithm. The framework consists of three primary components:

1. Dual-Branch Policy Agent

The system employs a specialized neural network architecture to encode the state of the synthesis process:

  • Graph Convolutional Network (GCN): Encodes the structural features of the circuit, represented as an And-Inverter Graph (AIG).
  • BERT-based Transformer: Encodes the sequence of synthesis steps already applied, allowing the model to understand the context of each operation (e.g., recognizing that a "rewrite" operation is more effective at specific stages of the recipe).

2. Retrieval-Guided Tuning

To determine how much to trust the policy agent, ABC-RL performs a lightweight similarity check. When a new circuit is presented, the system computes its embedding and identifies its "nearest neighbor" in the training database using cosine similarity.

3. The $\alpha$ Modulation Parameter

The core innovation of ABC-RL is the $\alpha$ parameter, which modulates the search based on the similarity score:

  • Familiar Designs ($\alpha \to 0$): If the circuit is similar to the training data, the system relies heavily on the RL agent's recommendations.
  • Novel Designs ($\alpha \to 1$): If the circuit is novel, the system down-weights the RL agent and defaults to a pure MCTS search to prevent the agent from leading the search astray.

This $\alpha$-weighted policy is integrated into the Upper Confidence Tree (UCT) formula, ensuring the search remains productive regardless of the circuit's familiarity.

Experimental Setup

The framework was evaluated using 56 netlists from three standard logic synthesis benchmark suites:

  • MCNC: 38 netlists ranging from 100 to 8,000 nodes.
  • EPFL Arithmetic: Complex designs including adders and multipliers (up to 44k nodes).
  • EPFL Random Control: Finite-state machines and memory controllers (up to 46k nodes).

These benchmarks were split into training, validation, and test sets to rigorously test the model's ability to handle both in-distribution and out-of-distribution hardware.

Results and Discussion

ABC-RL demonstrated significant improvements over existing methods such as DRiLLS and SA+Pred:

  • Quality of Result (QoR): The system achieved up to a 24.8% improvement in Area-Delay Product (ADP) compared to standard synthesis baselines.
  • Efficiency: ABC-RL reached target quality levels 3.75x faster on average than competing methods, with some cases showing a 9x reduction in runtime.
  • Robustness: The authors empirically confirmed the "Confident but Wrong" trap, showing that standard learning-augmented searches performed worse than simple searches on 11 out of 20 test designs. ABC-RL avoided this pitfall, consistently ranking as the top performer across diverse hardware types.
  • Low Overhead: The retrieval mechanism is highly efficient, accounting for only approximately 1.5% of the total runtime.

Conclusion and Future Work

ABC-RL proves that in EDA, the most effective use of AI is not just "more learning," but "smarter trust." By acknowledging the limitations of pre-trained models through retrieval-guided tuning, ABC-RL provides a robust and efficient solution for Boolean circuit minimization.

Future research directions include exploring dynamic $\alpha$ schedules that adjust during the search process as the circuit structure evolves, as well as developing more sophisticated circuit representations that capture functional logic beyond simple graph structures. While training remains computationally intensive (approximately 9 days), the significant gains in inference speed and result quality represent a major step forward for automated hardware design.

Summary updated

BibTeX
@inproceedings{chowdhury2024retrieval,
  author = {Animesh Basak Chowdhury and Marco Romanelli and Benjamin Tan and Ramesh Karri and Siddharth Garg},
  title = {{Retrieval-Guided Reinforcement Learning for Boolean Circuit Minimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=0t1O8ziRZp},
}
Figure