Evolving Graph Structured Programs for Circuit Generation with Large Language Models

Yinqi Bai, Jie Wang, Lei Chen, Zhihai Wang, Yumeng Li, Mingxuan Yuan, Jianye Hao, Defu Lian, Enhong ChenICLR 2026

TL;DR

CircuitEvo is a novel framework that leverages Large Language Models (LLMs) within an evolutionary loop to automate logic synthesis—the process of translating a truth table into a compact digital circuit. By combining the creative structural generation of LLMs with a formal "function optimizer" to correct logical errors, CircuitEvo produces circuits that are 100% accurate and roughly 6.7% smaller than current state-of-the-art methods.

The Challenge of Logic Synthesis

In chip design, Logic Synthesis (LS) is the critical step of transforming a behavioral description (like a truth table) into a gate-level circuit. The objective is two-fold: the circuit must be 100% functionally correct, and it must be as "compact" as possible to minimize physical space (area) and power consumption on the silicon.

LS is an NP-hard combinatorial optimization problem. Traditional tools rely on human-designed heuristics, while newer machine learning approaches often struggle to find the perfect balance between a minimal circuit and one that is functionally exact. While LLMs excel at generating structured code, they are notoriously prone to hallucinations—a critical flaw in circuit design where a single flipped bit renders the entire design useless. This paper tackles how to harness LLM creativity for circuit structure optimization without sacrificing formal correctness.

The CircuitEvo Methodology

The authors introduce CircuitEvo, treating circuit design as an iterative evolutionary process. Its architecture consists of several main pillars:

CircuitEvo Framework Overview
  1. Graph-Structured Program Representation: Instead of feeding the LLM raw netlists or long Boolean strings, circuits are represented as "programs." Each line defines a node and its dependencies (e.g., node3 = !node1 * node2). This format is highly LLM-friendly, allowing the model to easily parse the hierarchy and topology of the graph.
Graph-Structured Program Representation
  1. Evolutionary LLM Generator: The framework maintains a population of circuit designs. In each iteration, the LLM acts as the evolutionary engine. Guided by domain-specific prompts, it performs Crossover (combining parts of two parent circuits) and Mutation (refining a single circuit) to explore new structures.
  2. Structure-Aware Function Optimization: Because LLMs cannot guarantee 100% logical accuracy, CircuitEvo employs a formal optimizer based on Shannon decomposition as a safety net. It identifies functional discrepancies between the LLM's output and the target truth table, then appends necessary "patch" substructures to ensure the final circuit is perfectly accurate.
  3. Local Program Search: To keep the patched circuits compact, a greedy search identifies the most promising sub-part of the LLM's generated code before the final optimization step, stripping away redundant logic.

Datasets and Evaluation

CircuitEvo was evaluated on 16 diverse benchmark circuits from four widely recognized sources:

  • Arithmetic: Standard mathematical logic functions.
  • Random: Complex, "random-looking" functions that are notoriously difficult for heuristics to solve.
  • LogicNets: Circuits derived from neural network-to-hardware mapping projects.
  • Espresso: A classic set of logic minimization benchmarks.

These benchmarks range from simple designs to complex cases with up to 16 inputs and 69 outputs, representing a massive search space of $2^{69 \times 2^{16}}$ possible solutions.

Key Insights

  • The "Architect vs. Builder" Paradigm: LLMs should not be asked to build a perfect circuit from scratch. Instead, they act as "architects" proposing novel, compact structures, while formal logic tools act as "builders" that fix technical errors.
  • Logic Sharing: CircuitEvo excels at identifying sub-expressions that can be reused across different parts of a circuit. This logic sharing significantly reduces the total gate count.
  • The "Triangle" Structure: The most compact circuits consistently exhibit a "triangle structure," where the number of nodes decreases from inputs to outputs. CircuitEvo naturally converged on this pattern.
  • Iterative Refinement: Unlike one-shot LLM generation attempts, the evolutionary approach allows the model to learn from "near-misses" in the population, yielding much higher quality results.

Key Results

  • 100% Accuracy: The function optimizer ensures every circuit generated perfectly matches the target truth table.
  • Superior Compactness: CircuitEvo outperformed state-of-the-art methods like DNAS and ICSR, achieving an average 6.74% reduction in circuit size. In some "Random" benchmarks, improvements reached up to 20%.
  • Hardware Efficiency: When mapped to a standard cell library (mcnc.genlib), CircuitEvo's designs showed significantly smaller physical area and lower signal delay than all baselines.
  • Search Efficiency: The framework converged to solutions faster than other search-based methods, averaging 1.48 hours compared to 3.91 hours for DSR and nearly 17 hours for DNAS.

Limitations and Future Work

  • Input Scaling: While handling 16 inputs is impressive for an LLM approach, modern industrial chips have thousands. Future work will require hierarchical decomposition to break massive circuits into manageable blocks.
  • Prompt Sensitivity: Performance is tied to the quality of evolutionary prompts. Automated prompt tuning or meta-prompting could yield further improvements.
  • LLM Choice: Relying on API-based models (like GPT-3.5 and DeepSeek) incurs cost and latency. Exploring smaller, fine-tuned local models specifically for circuit programs is a logical next step.

Summary updated

BibTeX
@inproceedings{bai2026evolving,
  author = {Yinqi Bai and Jie Wang and Lei Chen and Zhihai Wang and Yumeng Li and Mingxuan Yuan and Jianye HAO and Defu Lian and Enhong Chen},
  title = {{Evolving Graph Structured Programs for Circuit Generation with Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=DUtS9K9HH6},
}
Figure