PCBSchemaGen: Reward-Guided LLM Code Synthesis for Printed Circuit Boards (PCB) Schematic Design with Structured Verification

huanghaohe zou, Peng Han, Emad Nazerian, Mafu Zhang, Zhicheng Guo, Alex HuangNeurIPS 2026

TL;DR

When Large Language Models (LLMs) write Python code, we can easily verify their work using unit tests—but how do you check an LLM's work when it’s designing a physical Printed Circuit Board (PCB) with no ground-truth reference? PCBSchemaGen solves this without fine-tuning a single model weight, pairing frozen LLMs with automated datasheet extraction and a deterministic, physics-based verifier. By catching exact pin-level wiring mistakes and guiding the model to fix them iteratively, it turns off-the-shelf LLMs into remarkably capable hardware schematic designers.

What Problem Does This Paper Address?

Every modern gadget relies on a PCB, and designing the blueprint—called schematic capture—is a notorious engineering bottleneck. Engineers spend months poring over dense PDF datasheets from chip vendors, selecting real Integrated Circuits (ICs), and wiring dozens of pins together without accidentally shorting power to ground.

Automating this with LLMs hits three brick walls:

  1. Data scarcity: Unlike software or digital chip logic (Verilog), there is no massive open-source corpus of paired specifications and PCB schematics to fine-tune an LLM.
  2. Real, quirky hardware: You aren't connecting idealized textbook resistors; you're wiring specific commercial chips (like an STM32 microcontroller) whose pinouts vary wildly across vendors.
  3. No "unit test" oracle: In software synthesis, you run the code against test cases. In analog circuit design, SPICE simulators test functional behavior, assuming the wiring is already valid—they can't tell if you picked the wrong physical pin on a chip package. Without a golden reference netlist (wiring map) for a brand-new design, how does an AI know if its schematic is valid?

Methods

Instead of training a specialized hardware model, the authors built a training-free, inference-time framework that prompts a frozen LLM to write SKiDL—a Python library that describes circuit connections as code and compiles directly into KiCad-ready PCB projects.

Figure 1: PCBSchemaGen pipeline: schema-induced KG →frozen-LLM SKiDL generation → layered verifier (graded reward, pin-localized errors) →verifier-driven refinement →KiCad-ready schematic and PCB project. Training-free; no per-task golden netlist.

The magic lies in three tightly coupled components:

  • Schema-Induced Knowledge Graph (KG): A three-stage pipeline parses vendor PDF datasheets and maps every IC pin into a closed 32-role ontology (defining what each pin actually is) alongside four constraint-predicate templates (defining how it must connect). At generation time, a Unified Context Assembly (UCA) module retrieves only the ~300-token JSON specs for the chips needed, saving ~37% of prompt tokens.
  • Deterministic Layered Verifier: Acting like a zero-cost Process Reward Model, a Python checker compiles the SKiDL code into a bipartite graph of components and nets, running a hierarchy of checks: syntax/runtime, basic electrical rules (L1, e.g., power-to-ground shorts), power electronics invariants (L4, e.g., gate resistors), pin-role compatibility (L1b), subcircuit templates (L2), and multi-part circuit topologies like synchronous buck converters (L3). It outputs a graded reward from 0.0 to 1.0 based on the deepest check passed, plus exact pin-level error messages.
  • Verifier-Driven Refinement: Using a budget of $T=4$ LLM calls, the system feeds those pin-level errors back to the LLM to repair its code, adjusting generation temperature based on failure severity. By default, it treats candidate drafts as arms in a multi-armed bandit using Thompson Sampling, though simpler greedy selection works just as well.
Figure 2: The verifier. (a) Graded reward of Eq. (2): the score is the constant of the first failing check. (b) Pin-level feedback for an L3 failure: the synchronous-buck detector finds the inductor on VBUS instead of the switch node and names the pin to move.

Datasets

Because PCB schematic generation had no existing generative benchmarks (prior datasets only tested multiple-choice Q&A), the authors created and open-sourced two suites totaling 227 tasks across 22 circuit domains and 480 real ICs:

  • PCBBench: 62 hand-authored tasks (Easy, Medium, Hard) spanning 41 real ICs from 11 vendors, heavily featuring complex power systems.
  • Open-Schematics-Eval (OSE): 165 tasks derived from real open-source hardware projects covering 439 distinct semiconductors. Crucially, the verifier and extraction prompts were completely frozen before OSE evaluation; the system extracted 241 new IC KGs on demand without human intervention.

Key Insights and Ideas

  • Datasheet grounding is non-negotiable: Removing the datasheet-induced KG causes Gemma-4-31B's pass rate on PCBBench to plummet from 81.3% to 26.8% (and from 47.1% to 2.0% on Hard tasks). LLMs simply do not have commercial chip pinouts memorized reliably.
  • Tell the LLM which pin failed, not just that it failed: Replacing exact pin-level error localization with a binary "pass/fail" signal drops performance by 23.6 percentage points. Detailed structural diagnostics turn blind guessing into targeted debugging.
  • The loop matters more than the search algorithm: Iterative refinement adds +22 to +26pp across models compared to single-shot generation. Surprisingly, while the authors designed a clever Thompson Sampling bandit to pick which draft to refine, their own ablations revealed that simply refining the latest candidate actually performs slightly better (81.6% vs. 75.9%)! The heavy lifting comes from the KG and the deterministic verifier, not fancy search heuristics or self-reflection prompts.
  • Standard CAD checks aren't enough: Relying solely on standard Electrical Rule Checks (ERC) lets 10–13% of structurally broken schematics slip through—errors that the deeper topology and template layers successfully catch.

Key Results

Evaluating 11 open-weight and closed-source LLMs (4 calls per trajectory):

  • Frontier vs. Open-Weight: Closed-source giants GPT-5.4 (94.0%) and Gemini-3.1-Pro (94.3%) nearly saturate PCBBench. Impressively, open-weight models DeepSeek-V3.2 (81.6%) and Gemma-4-31B (81.3%) aren't far behind—crushing a Circuitron prompting baseline on the same Gemma backbone (41.9% overall, 10.2% Hard).
  • Zero-Shot Transfer: Running unchanged on OSE, GPT-5.4 hits 79.3% (70.7% Hard) and Gemma-4-31B reaches 69.8%, proving the datasheet-to-verifier recipe generalizes to hundreds of unseen chips.
  • Human & Real-World Validation: Blind audits by senior PCB engineers showed strong agreement with the verifier ($\kappa = 0.91$, 6.7% false-accept rate). To prove it works in the physical world, the team generated a 5,000 W AC-DC converter schematic across five subsystems, laid out and fabricated the board, and confirmed it converted power on its very first power-up!

Limitations and Future Work

  • Structure $\neq$ Physics: The verifier guarantees valid structural wiring, not functional analog performance, thermal safety, or electromagnetic interference (EMI) compliance—and it still has a 6.7% false-accept rate. Downstream engineering sign-offs remain essential, and schematic visual layout for human readability still requires manual adjustment.
  • Ontology blind spots & rigid part choices: About 5.1% of pins in OSE (mostly communication buses like USB, $\text{I}^2\text{C}$, and SPI) fall outside the current 32-role ontology. Furthermore, when trajectories fail, models rarely swap out incompatible chips (only 8.2% of attempts change the part set), making dynamic IC re-selection a prime target for future work, alongside adapting this datasheet-plus-verifier blueprint to other unit-test-free engineering fields.

Summary updated

Abstract

Most LLM code-synthesis benchmarks rely on unit tests as the reward oracle, but PCB schematic design has none: correctness is defined by structural constraints over real IC packages and pin-level connections, per-task golden netlists are unavailable, and SPICE simulation does not check schematic-level correctness. We introduce PCBSchemaGen, a training-free inference-time framework that turns a frozen LLM into a verifiable, repairable PCB schematic generator. Its core is a domain schema induced from IC datasheets (a 32-role pin ontology and four constraint-predicate templates) that grounds decoding in real pin constraints. A deterministic layered verifier returns a graded reward with pin-level error localization, and a propose-verify-refine loop repairs candidates from that feedback, with Thompson Sampling over candidates as the default selection policy. We evaluate on two benchmarks with 227 real-IC tasks: PCBBench (62 hand-authored tasks) and Open-Schematics-Eval (165 tasks derived from public schematics). The schema, the verifier, and the PCBBench KG library are frozen before evaluation; Open-Schematics-Eval per-IC entries are populated on demand by the same frozen extraction pipeline. With an open-weight 31B model (Gemma-4-31B), the framework passes 81.3% of PCBBench tasks; removing the schema lowers this to 26.8%, and replacing pin-level feedback with a pass/fail signal lowers it to 57.7%. The same verifier code runs on both suites unchanged, and a Circuitron-style inference-time prompting baseline on the same Gemma-4-31B backbone collapses on hard system-level designs. These results support inference-time refinement under a deterministic structural verifier as a practical approach to PCB schematic design, a domain without unit-test oracles. Code: https://github.com/HZou9/PCBSchemaGen_v2; benchmarks: https://huggingface.co/datasets/Hzou9/PCBSchemaGen-Benchmarks.
BibTeX
@inproceedings{zou2026pcbschemagen,
  author = {huanghaohe zou and Peng Han and Emad Nazerian and Mafu Zhang and Zhicheng Guo and Alex Huang},
  title = {{PCBSchemaGen: Reward-Guided LLM Code Synthesis for Printed Circuit Boards (PCB) Schematic Design with Structured Verification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=tSDSSdj4mC},
}
Figure