The Graph's Apprentice: Teaching an LLM Low-Level Knowledge for Circuit Quality Estimation

Reza Moravej, Saurabh Bodhe, Zhanguang Zhang, Didier Chételat, Dimitrios Tsaras, Yingxue Zhang, Hui-Ling Zhen, Jianye Hao, Mingxuan Yuan

Introduction

In modern semiconductor design, the transition from high-level Register-Transfer Level (RTL) code, such as Verilog, to a physical implementation is governed by logic synthesis. This process determines critical "Quality of Result" (QoR) metrics, including circuit area and signal delay. However, full logic synthesis is computationally intensive and time-consuming, often requiring hours or days for complex designs. This latency creates a significant bottleneck in the iterative design cycle.

To address this, researchers have developed QoR estimators to provide rapid feedback. Traditional approaches typically rely on low-level structural representations like netlists or Look-Up Table (LUT) graphs. While accurate, these representations are only available after the synthesis process has begun, limiting their utility for early-stage design. Conversely, Large Language Models (LLMs) can process raw Verilog code directly but often lack the "physical intuition" required to predict low-level hardware performance accurately. This "semantic gap" between high-level code and low-level physical realization remains a primary challenge in hardware design automation.

Methodology: The VeriDistill Framework

The researchers propose VeriDistill, a novel framework that bridges this semantic gap by distilling structural knowledge from a Graph Neural Network (GNN) into an LLM-based estimator.

Overview of the VeriDistill training and inference pipeline.

Architecture and Knowledge Distillation

The VeriDistill architecture consists of two main components: a "frozen" LLM encoder and an auxiliary GNN teacher.

  1. LLM Encoder: The framework utilizes state-of-the-art code LLMs (e.g., DeepSeek-Coder or CodeV) to extract high-level semantic features from raw Verilog. To maintain efficiency and reduce computational overhead, the LLM parameters are kept frozen during training, and its internal hidden states are used as features.
  2. GNN Teacher: A GNN is pretrained on LUT graphs—intermediate representations that capture the structural logic of the circuit. This GNN serves as a "teacher" that possesses the low-level physical context missing from the raw code.
  3. Knowledge Distillation (KD): The core innovation is the use of structural regularization via KD. During training, a specialized loss function aligns the internal representations of the LLM with those of the GNN. This forces the LLM to learn how high-level code constructs translate into physical gate structures, preventing it from being distracted by coding style or comments.
Detailed architecture of VeriDistill, highlighting the alignment between the LLM and the auxiliary GNN via knowledge distillation.

Once trained, the GNN is discarded. During inference, the designer provides only the Verilog code, and the model produces near-instantaneous predictions of area and delay.

Experimental Evaluation

The framework was evaluated using a customized dataset of ~24,000 Verilog examples synthesized with the OpenROAD (7nm) toolchain, as well as the OpenABCD benchmark for out-of-distribution (OOD) testing on complex designs like cryptographic accelerators and processors.

Key Results

  • Predictive Accuracy: VeriDistill achieved an R² of 0.872 for area and 0.781 for delay, significantly outperforming traditional AST-GNN baselines (0.661 and 0.604, respectively).
  • Generalization: On complex, unseen designs in the OpenABCD benchmark, the inclusion of knowledge distillation reduced the Mean Absolute Error (MAE) by approximately 30% compared to models without structural alignment.
  • Efficiency: By leveraging frozen LLMs and a lightweight Feed-Forward Network (FNN) for prediction, the model offers a highly efficient training path with lower GPU memory requirements than full fine-tuning.

Discussion and Future Work

While VeriDistill represents a significant advancement, it currently requires functionally correct and synthesizable Verilog code; it cannot yet estimate the quality of incomplete code snippets. Additionally, while the current focus is on area and delay, expanding the scope to include power consumption (the third pillar of the PPA triad) and routing congestion is a natural next step. The researchers also noted that while freezing the LLM is efficient, partial fine-tuning might further enhance accuracy in future iterations.

Summary updated

BibTeX
@inproceedings{moravej2025graph,
  author = {Reza Moravej and Saurabh Bodhe and Zhanguang Zhang and Didier Chételat and Dimitrios Tsaras and Yingxue Zhang and Hui-Ling Zhen and Jianye Hao and Mingxuan Yuan},
  title = {{The Graph's Apprentice: Teaching an LLM Low-Level Knowledge for Circuit Quality Estimation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/1033},
}
Figure