Every time the target Spec changes, most methods start over. CktGen doesn't β it generates circuits directly from the new requirements, then optimizes without retraining.
We are the first to formulate analog circuit synthesis as Spec-conditioned generation (Spec2Ckt): given a target Spec, directly generate the corresponding circuit. Three key contributions:
- New problem formulation. The first to cast analog circuit synthesis as Spec-conditioned generation, moving beyond repeated fixed-target optimization.
- One-to-many mapping via joint alignment. Triple alignment (contrastive learning + classifier guidance + feature alignment) maps Specs and circuits into a shared latent space, preserving the one-to-many diversity of valid designs.
- Test-time optimization without retraining. A multi-armed bandit algorithm searches the learned latent space for designs satisfying new target Specs β no retraining required.
CktGen achieves 47.57% Spec-Acc on Ckt-Bench-101 where all baselines stay below 3%, and reaches up to 87.09% Spec-Acc in automated design.
If you find this work useful, please cite our paper:
@article{hou2025cktgen,
title = {CktGen: Automated Analog Circuit Design with Generative Artificial Intelligence},
journal = {Engineering},
year = {2025},
issn = {2095-8099},
doi = {https://doi.org/10.1016/j.eng.2025.12.025},
url = {https://www.sciencedirect.com/science/article/pii/S2095809925008148},
author = {Yuxuan Hou and Hehe Fan and Jianrong Zhang and Yue Zhang and Hua Chen and Min Zhou and Faxin Yu and Roger Zimmermann and Yi Yang},
}- Project Structure
- Installation
- Datasets
- Evaluate with Pre-Trained models
- Train from scratch
- Acknowledgments
- Contact
π Click to expand
CktGen/
βββ checkpoints/ # Pre-trained models (download from HuggingFace)
β βββ cktgen/ # CktGen models
β βββ evaluator/ # Performance evaluators
β βββ baselines/ # Baseline models (CktGNN, LDT, PACE, CVAEGAN)
βββ dataset/OCB/ # Open Circuit Benchmark datasets
β βββ CktBench101/ # 10k circuit samples
β βββ CktBench301/ # 50k circuit samples
βββ models/ # Model implementations
β βββ architectures/ # Encoders & decoders
β βββ modeltype/ # VAE, CktGen, LDT, CVAEGAN
βββ scripts/ # Experiment scripts
β βββ train/ # Training scripts
β βββ test/ # Evaluation scripts
βββ train/ # Training source code
βββ test/ # Testing source code
βββ evaluation/ # Evaluation metrics
βββ utils/ # Utility functions (including model download)
βββ options/ # CLI argument definitions
The environment.yml file contains all required dependencies (Python 3.9, PyTorch 1.13.1, CUDA 11.7, etc.) and has been tested to work out-of-the-box.
# Step 1: Clone the repository
git clone https://github.com/hhyxx/CktGen.git
cd CktGen
# Step 2: Create and activate environment (all dependencies included)
conda env create -f environment.yml
conda activate cktgenAll experiments in this work are conducted on the Open Circuit Benchmark (OCB) dataset. To facilitate easy reproducibility and provide a seamless "ready-to-run" experience, we have included the complete OCB datasets directly within this repository.
-
The OCB dataset was originally introduced as a foundational benchmark by the authors of CktGNN (Dong et al., 2023). We are deeply grateful for their pioneering contribution to the analog circuit design community, which established essential standards for benchmarking in this field.
-
When using this dataset, please cite the original CktGNN paper to properly acknowledge the foundational work of its authors. The data is redistributed here under the MIT License for research convenience.
dataset/OCB/
βββ CktBench101/ # Ckt-Bench-101 analog circuits
β βββ ckt_bench_101_igraph.pkl # Circuit graphs (10k samples)
β βββ perform101.csv # Performance specifications
βββ CktBench301/ # Ckt-Bench-301 analog circuits
βββ ckt_bench_301_igraph.pkl # Circuit graphs (50k samples)
βββ perform301.csv # Performance specifications
To run the evaluation tests, you need to download the pre-trained models:
-
Download from Hugging Face (No authentication required):
π‘ Tip: Run
python utils/load_pretrained.py --listto see all available files.Model Command All checkpoints python utils/load_pretrained.pyCktGen python utils/load_pretrained.py --folder cktgenEvaluator python utils/load_pretrained.py --folder evaluatorπ¦ Download individual baseline models:
Baseline Model Command Baselines (all) python utils/load_pretrained.py --folder baselinesLDT (Latent Diffusion Transformer) python utils/load_pretrained.py --folder baselines/ldtCVAEGAN (Conditional VAE-GAN) python utils/load_pretrained.py --folder baselines/cvaeganCktGNN python utils/load_pretrained.py --folder baselines/cktgnnPACE python utils/load_pretrained.py --folder baselines/pace
-
Download from Baidu Netdisk:
Download and extract the folders into
checkpoints/to use with the provided scripts:checkpoints/ βββ cktgen/ βββ evaluator/ βββ baselines/ βββ ldt/ βββ ...
After downloading the pretrained models into checkpoints folder, run these test scripts to reproduce the experimental results of CktGen in our paper:
β οΈ Note: Our experiments were conducted on NVIDIA RTX 4090. Due to differences in GPU architecture and floating-point precision, results on other hardware may vary slightly.
| Experiment | Dataset | Command |
|---|---|---|
| Auto Design | CktBench-101 | bash scripts/test/cktgen/cktgen_auto_design_101.sh |
| CktBench-301 | bash scripts/test/cktgen/cktgen_auto_design_301.sh |
|
| Conditional Generation | CktBench-101 | bash scripts/test/cktgen/cktgen_cond_gen_101.sh |
| CktBench-301 | bash scripts/test/cktgen/cktgen_cond_gen_301.sh |
|
| Reconstruction & Random Generation |
CktBench-101 | bash scripts/test/cktgen/cktgen_recon_101.sh |
| CktBench-301 | bash scripts/test/cktgen/cktgen_recon_301.sh |
|
| t-SNE Visualization | - | bash scripts/test/cktgen/cktgen_tsne.sh |
| Auto Design Visualization | - | bash scripts/test/auto_design_visualize.sh |
π¦ Baseline models evaluation scripts
| Model | Experiment | Dataset | Command |
|---|---|---|---|
| CktGNN | Auto Design | CktBench-101 | bash scripts/test/baselines/cktgnn/cktgnn_auto_design_101.sh |
| CktBench-301 | bash scripts/test/baselines/cktgnn/cktgnn_auto_design_301.sh |
||
| Conditional Generation | CktBench-101 | bash scripts/test/baselines/cktgnn/cktgnn_cond_gen_101.sh |
|
| CktBench-301 | bash scripts/test/baselines/cktgnn/cktgnn_cond_gen_301.sh |
||
| Reconstruction | CktBench-301 | bash scripts/test/baselines/cktgnn/cktgnn_recon_301.sh |
|
| t-SNE | - | bash scripts/test/baselines/cktgnn/cktgnn_tsne.sh |
|
| LDT | Auto Design | CktBench-101 | bash scripts/test/baselines/ldt/ldt_auto_design_101.sh |
| CktBench-301 | bash scripts/test/baselines/ldt/ldt_auto_design_301.sh |
||
| Conditional Generation | CktBench-101 | bash scripts/test/baselines/ldt/ldt_cond_gen_101.sh |
|
| CktBench-301 | bash scripts/test/baselines/ldt/ldt_cond_gen_301.sh |
||
| t-SNE | - | bash scripts/test/baselines/ldt/ldt_tsne.sh |
|
| PACE | Auto Design | CktBench-101 | bash scripts/test/baselines/pace/pace_auto_design_101.sh |
| CktBench-301 | bash scripts/test/baselines/pace/pace_auto_design_301.sh |
||
| Conditional Generation | CktBench-101 | bash scripts/test/baselines/pace/pace_cond_gen_101.sh |
|
| CktBench-301 | bash scripts/test/baselines/pace/pace_cond_gen_301.sh |
||
| Reconstruction | CktBench-101 | bash scripts/test/baselines/pace/pace_recon_101.sh |
|
| CktBench-301 | bash scripts/test/baselines/pace/pace_recon_301.sh |
||
| t-SNE | - | bash scripts/test/baselines/pace/pace_tsne.sh |
|
| CVAEGAN | Auto Design | CktBench-101 | bash scripts/test/baselines/cvaegan/cvaegan_auto_design_101.sh |
| CktBench-301 | bash scripts/test/baselines/cvaegan/cvaegan_auto_design_301.sh |
||
| Conditional Generation | CktBench-101 | bash scripts/test/baselines/cvaegan/cvaegan_cond_gen_101.sh |
|
| CktBench-301 | bash scripts/test/baselines/cvaegan/cvaegan_cond_gen_301.sh |
||
| t-SNE | - | bash scripts/test/baselines/cvaegan/cvaegan_tsne.sh |
Prerequisites: Training CktGen with conditional generation requires a pre-trained evaluator model for guided optimization. The evaluator must be downloaded and placed in checkpoints/ before training:
python utils/load_pretrained.py --folder evaluatorAlternatively, train your own evaluator using scripts in scripts/train/evaluator/.
With the evaluator loaded, the training script will automatically evaluate performance at the end of training.
| Training Task | Dataset | Command |
|---|---|---|
| Conditional Generation (requires evaluator) |
CktBench-101 | bash scripts/train/cktgen/cktgen_cond_gen_101.sh |
| CktBench-301 | bash scripts/train/cktgen/cktgen_cond_gen_301.sh |
|
| Reconstruction Only (no evaluator needed) |
CktBench-101 | bash scripts/train/cktgen/cktgen_recon_101.sh |
| CktBench-301 | bash scripts/train/cktgen/cktgen_recon_301.sh |
| Dataset | Command |
|---|---|
| CktBench-101 | bash scripts/train/evaluator/evaluator_101.sh |
| CktBench-301 | bash scripts/train/evaluator/evaluator_301.sh |
π¦ Baseline models training scripts
| Model | Training Task | Dataset | Command |
|---|---|---|---|
| CktGNN | Conditional Generation | CktBench-101 | bash scripts/train/baselines/cktgnn/cktgnn_cond_gen_101.sh |
| CktBench-301 | bash scripts/train/baselines/cktgnn/cktgnn_cond_gen_301.sh |
||
| Reconstruction | CktBench-301 | bash scripts/train/baselines/cktgnn/cktgnn_recon_301.sh |
|
| LDT | Conditional Generation | CktBench-101 | bash scripts/train/baselines/ldt/ldt_cond_gen_101.sh |
| CktBench-301 | bash scripts/train/baselines/ldt/ldt_cond_gen_301.sh |
||
| PACE | Conditional Generation | CktBench-101 | bash scripts/train/baselines/pace/pace_cond_gen_101.sh |
| CktBench-301 | bash scripts/train/baselines/pace/pace_cond_gen_301.sh |
||
| Reconstruction | CktBench-101 | bash scripts/train/baselines/pace/pace_recon_101.sh |
|
| CktBench-301 | bash scripts/train/baselines/pace/pace_recon_301.sh |
||
| CVAEGAN | Conditional Generation | CktBench-101 | bash scripts/train/baselines/cvaegan/cvaegan_cond_gen_101.sh |
| CktBench-301 | bash scripts/train/baselines/cvaegan/cvaegan_cond_gen_301.sh |
- We express our profound gratitude to Zehao Dong, Weidong Cao, Xuan Zhang, and the CktGNN team for open-sourcing the OCB dataset and their pioneering work. Our research significantly benefited from the high-quality benchmarks and insights established in their work.
- Thanks to the authors of PACE for their foundational architectural research.
- Author: Yuxuan Hou
- Email: yuxuan.hou.x@gmail.com