A Graph Enhanced Symbolic Discovery Framework For Efficient Logic Optimization

Yinqi Bai, Jie Wang, Lei Chen, Zhihai Wang, Yufei Kuang, Mingxuan Yuan, Jianye Hao, Feng Wu

TL;DR

Logic Optimization (LO) is a major computational bottleneck in modern chip design, often slowed down by heuristics applying useless transformations to circuit nodes. This paper introduces CMO, a novel framework that uses Monte Carlo Tree Search and knowledge distillation from Graph Neural Networks (GNNs) to discover lightweight, interpretable symbolic scoring functions. These functions efficiently predict and prune ineffective operations, speeding up LO heuristics by up to 2.5x on standard CPUs without sacrificing optimization quality.

The Challenge in Logic Optimization

In Electronic Design Automation (EDA), Logic Optimization (LO) aims to reduce the size and depth of a circuit (represented as a directed acyclic graph) without changing its functionality. This is a computationally heavy, NP-hard problem. Standard tools use heuristics (like the widely used Mfs2 algorithm) that traverse the circuit and apply transformations node-by-node.

The problem is that a massive number of these node-level transformations are ineffective—they don't actually improve the circuit, but they waste immense amounts of compute time.

Recent machine learning approaches try to "predict and prune" these useless nodes. However, they face a trilemma:

  1. GNNs are highly accurate but act as uninterpretable "black boxes" and are far too slow for inference on standard CPU-based EDA tools.
  2. Human-designed scoring functions are fast and interpretable but struggle to generalize to unseen circuits, leading to poor optimization quality.

The authors tackle this gap by asking: How can we automatically discover a scoring function that is as fast and interpretable as a human-designed equation, but generalizes as well as a heavy GNN?

Proposed Methodology: CMO

The authors propose the CMO (Circuit Symbolic Learning Framework), which discovers concise mathematical and boolean expressions to score circuit nodes.

Overview of the CMO framework and Graph Enhanced Symbolic Discovery.

Key techniques include:

  • Structural-Semantic Feature Decomposition: Circuit nodes have complex, 69-dimensional features. To make symbolic search tractable, the authors split these into 5 continuous structural features (e.g., fanin/fanout, node level) and 64 binary semantic features (the node's truth table).
  • Graph Enhanced Symbolic Discovery (GESD): The core engine of CMO. It uses Monte Carlo Tree Search (MCTS) to explore the vast space of mathematical operators ($+, -, \times, \div, \sin, \cos$) and boolean logic to build expression trees.
  • Knowledge Distillation from GNNs: Symbolic regression alone often overfits training data. To solve the generalization problem, GESD uses a teacher-student setup. A heavy, well-generalizing GNN (the teacher) is trained first. During the MCTS simulation phase, the reward function forces the symbolic expression (the student) to mimic the GNN's continuous output (using Mean Squared Error), while also accurately predicting the true labels (using Focal Loss to handle extreme class imbalance).

Key Insights

  • High-performance symbolic functions do exist in circuit data: The authors empirically proved that incredibly concise, one-line mathematical expressions can predict ineffective nodes with >99% accuracy. The challenge was simply finding them.
  • GNNs hold the "dark knowledge" for generalization: By forcing a simple symbolic equation to mimic the continuous output probabilities of a GNN (rather than just binary ground-truth labels), the equation inherits the GNN's ability to generalize to entirely unseen circuit architectures.
  • Interpretability validates human intuition: The discovered symbolic functions heavily rely on the node's "level" (depth in the graph). This perfectly aligns with the intuition behind traditional, painstakingly hand-crafted heuristics, proving the ML model learned genuine physical properties of the circuits.

Experimental Results

The framework was evaluated on 69 circuits across three benchmarks: EPFL, IWLS (2005), and an Industrial Benchmark of 27 real-world circuits (including massive circuits with up to 20 million nodes).

Inference time and generalization performance comparisons.
  • Inference Efficiency: Because the learned policies are simple one-line equations (e.g., $\sin(x_0 * x_2 + x_0 - \cos(x_1))/x_0$), inference on purely CPU-based machines is hundreds of times faster than GNNs.
  • Generalization: CMO achieved an average 36% improvement in prediction recall on unseen circuits compared to state-of-the-art human-designed functions (Effisyn).
  • End-to-End Speedup: When integrated into the heavy Mfs2 heuristic, CMO reduced runtime by an average of 44%, achieving up to 2.5x faster runtime on a massive 16-million node circuit (cutting processing time by hours).
  • Better Quality of Results (QoR): Because CMO makes Mfs2 so fast, engineers can afford to run the heuristic twice in the same time budget. Running CMO-Mfs2 sequentially reduced overall circuit size/depth by ~10% while still finishing 18% faster than running the default Mfs2 just once.

Limitations and Future Work

  • Training Overhead: Discovering these lightweight functions requires first training a complex GNN teacher and then running a computationally expensive MCTS process. While inference is virtually free, the upfront discovery cost is high.
  • Hyperparameter Sensitivity: The "predict and prune" framework relies on a hyperparameter $k$ (selecting the top $k\%$ of nodes to optimize). This requires manual tuning depending on whether the user wants to prioritize absolute speed (lower $k$) or maximum circuit optimization (higher $k$).

Future work naturally points toward applying this Graph-Enhanced Symbolic Discovery framework to other combinatorial optimization problems in EDA beyond just the Mfs2 heuristic.

Summary updated

BibTeX
@inproceedings{bai2025graph,
  author = {Yinqi Bai and Jie Wang and Lei Chen and Zhihai Wang and Yufei Kuang and Mingxuan Yuan and Jianye HAO and Feng Wu},
  title = {{A Graph Enhanced Symbolic Discovery Framework For Efficient Logic Optimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=EG9nDN3eGB},
}
Figure