Table of Contents
Fetching ...

BRIDGES: Bridging Graph Modality and Large Language Models within EDA Tasks

Wei Li, Yang Zou, Christopher Ellis, Ruben Purdy, Shawn Blanton, José M. F. Moura

TL;DR

BRIDGES introduces an end-to-end framework that bridges graph modality with large language models for EDA tasks by automating graph-aware RTL/netlist data generation and deploying a lightweight cross-modal projector to feed graph information into an LLM. It combines a NetlistGNN-based graph encoder with a Q-Former cross-modal bridge and a LLama3 backbone, trained in two stages to learn graph-text representations and then align them with the language model for task-specific generation. Across design retrieval, type classification, function description, and area/power estimation, BRIDGES delivers 2x–10x improvements over text-only baselines with low overhead, thanks to graph-guided prompts and joint multimodal optimization. The framework is validated on a large, graph-rich dataset containing hundreds of thousands of graphs and over 1.5 billion tokens, and the authors plan open-sourcing the data, models, and training flow to spur graph-aware AI-assisted EDA tooling.

Abstract

While many EDA tasks already involve graph-based data, existing LLMs in EDA primarily either represent graphs as sequential text, or simply ignore graph-structured data that might be beneficial like dataflow graphs of RTL code. Recent studies have found that LLM performance suffers when graphs are represented as sequential text, and using additional graph information significantly boosts performance. To address these challenges, we introduce BRIDGES, a framework designed to incorporate graph modality into LLMs for EDA tasks. BRIDGES integrates an automated data generation workflow, a solution that combines graph modality with LLM, and a comprehensive evaluation suite. First, we establish an LLM-driven workflow to generate RTL and netlist-level data, converting them into dataflow and netlist graphs with function descriptions. This workflow yields a large-scale dataset comprising over 500,000 graph instances and more than 1.5 billion tokens. Second, we propose a lightweight cross-modal projector that encodes graph representations into text-compatible prompts, enabling LLMs to effectively utilize graph data without architectural modifications. Experimental results demonstrate 2x to 10x improvements across multiple tasks compared to text-only baselines, including accuracy in design retrieval, type prediction and perplexity in function description, with negligible computational overhead (<1% model weights increase and <30% additional runtime overhead). Even without additional LLM finetuning, our results outperform text-only by a large margin. We plan to release BRIDGES, including the dataset, models, and training flow.

BRIDGES: Bridging Graph Modality and Large Language Models within EDA Tasks

TL;DR

BRIDGES introduces an end-to-end framework that bridges graph modality with large language models for EDA tasks by automating graph-aware RTL/netlist data generation and deploying a lightweight cross-modal projector to feed graph information into an LLM. It combines a NetlistGNN-based graph encoder with a Q-Former cross-modal bridge and a LLama3 backbone, trained in two stages to learn graph-text representations and then align them with the language model for task-specific generation. Across design retrieval, type classification, function description, and area/power estimation, BRIDGES delivers 2x–10x improvements over text-only baselines with low overhead, thanks to graph-guided prompts and joint multimodal optimization. The framework is validated on a large, graph-rich dataset containing hundreds of thousands of graphs and over 1.5 billion tokens, and the authors plan open-sourcing the data, models, and training flow to spur graph-aware AI-assisted EDA tooling.

Abstract

While many EDA tasks already involve graph-based data, existing LLMs in EDA primarily either represent graphs as sequential text, or simply ignore graph-structured data that might be beneficial like dataflow graphs of RTL code. Recent studies have found that LLM performance suffers when graphs are represented as sequential text, and using additional graph information significantly boosts performance. To address these challenges, we introduce BRIDGES, a framework designed to incorporate graph modality into LLMs for EDA tasks. BRIDGES integrates an automated data generation workflow, a solution that combines graph modality with LLM, and a comprehensive evaluation suite. First, we establish an LLM-driven workflow to generate RTL and netlist-level data, converting them into dataflow and netlist graphs with function descriptions. This workflow yields a large-scale dataset comprising over 500,000 graph instances and more than 1.5 billion tokens. Second, we propose a lightweight cross-modal projector that encodes graph representations into text-compatible prompts, enabling LLMs to effectively utilize graph data without architectural modifications. Experimental results demonstrate 2x to 10x improvements across multiple tasks compared to text-only baselines, including accuracy in design retrieval, type prediction and perplexity in function description, with negligible computational overhead (<1% model weights increase and <30% additional runtime overhead). Even without additional LLM finetuning, our results outperform text-only by a large margin. We plan to release BRIDGES, including the dataset, models, and training flow.

Paper Structure

This paper contains 35 sections, 2 equations, 7 figures, 5 tables.

Figures (7)

  • Figure 1: Automatic dataset generation workflow based on extensions of RTLCoder and MG-Verilog.
  • Figure 2: Left: Example of an enriched multi-modal data instance in $\mathsf{BRIDGES}$. Right: Statistics of the dataset.
  • Figure 3: Histogram of node count for netlist graphs in $\mathsf{BRIDGES}$. The stacked bars represent different circuit type labels, while Inconsistent represents different circuit-type label predictions between LLaMA-3-70B and GPT-4o.
  • Figure 4: Left: The graph-supported LLM architecture in $\mathsf{BRIDGES}$. Right: Stage 1 pre-training of $\mathsf{BRIDGES}$. The graph encoder and the cross-modal projector (Q-Former) are optimized together through three cross-modal tasks. Modules with the same color share the same parameters.
  • Figure 5: Accuracy of Function2Design on the full test set (25,569 graphs) with varying model and data scales. Training is stopped early if the accuracy on the validation set decreases for two consecutive epochs. The legend $d_1\_x$ denotes the dimension of node embeddings in the graph encoder, and $x \times 100\%$ represents the proportion of training data used. The red dotted line shows the accuracy (1.98%) when using RTL code to represent the design instead of a netlist graph.
  • ...and 2 more figures