SGLayout: Schema-Guided Closed-Loop Refinement for LLM-Driven Parameterized Layout Generation
Authors: Siyang Chen, Yuan Pu, Yuhan Qin, Zhaotan Lin, Siyuan Liang, Zhuolun He, Lining Zhang, Bei Yu
Organizations: School of Electronic and Computer Engineering, Peking University, Shenzhen, China · ChatEDA Tech, Shenzhen, China · Department of Computer Science and Engineering, The Chinese University of Hong Kong, Hong Kong SAR
Large Language Models (LLMs) have shown strong potential in parameterized layout generation via tool-augmented code synthesis. However, LLMs lack spatial awareness, making one-shot generation unreliable. While layout quality can be evaluated with established techniques, a critical gap remains: geometric-domain evaluation outcomes cannot be directly translated into actionable code-level fixes, trapping iterative refinement in blind refactoring. We propose SGLayout, a self-refining framework that closes this gap via a schema-guided mechanism. Upon code execution, a structured schema captures the correspondence between each code-level instance and its geometric attributes, establishing a bidirectional link between code space and geometry space. Emulating engineer review practices, SGLayout evaluates layouts along two complementary dimensions: intent compliance through quantitative structural checking and qualitative vision-language assessment, and rule compliance through DRC. All identified violations are then back-projected through the schema onto precise code targets, enabling surgical repair. This closed-loop process iterates until layout convergence. On a curated benchmark of 112 parameterized layout generation tasks using GDSFactory, SGLayout achieves a 76.79% pass rate, compared with 50.89% for the strongest baseline.
Figures & tables
Figure 1. Examples of failures in LLM-driven parameterized layout generation due to the limited spatial awareness. (a) One-shot generation. (b) Raw DRC feedback leads to blind refactoring.
Figure 2. Illustration of the schema-guided mechanism.
Figure 3. Overview of the SGLayout framework.
Figure 4. Orchestration Layer: From Normalized Findings to Targeted Repair Plan.
Semantic Group
Total
Level 1
Level 2
Level 3
Geometric Shape Synthesis
26
9
14
3
Connectivity and Routing Construction
56
13
28
15
Hierarchical and Parametric Composition
30
4
4
22
Total
112
26
46
40
Table 1. Distribution of the benchmark.
Method
Model
Level 1 Pass Rate (%)
Level 2 Pass Rate (%)
Level 3 Pass Rate (%)
Overall Pass Rate (%)
Pass@1
Pass@3
Final
Pass@1
Pass@3
Final
Pass@1
Pass@3
Final
Pass@1
Pass@3
Final
Naive
Qwen3-Coder-Plus
73.08
92.31
96.15
23.91
34.78
45.65
7.50
25.00
27.50
29.46
44.64
50.89
Naive
DeepSeek-V3.2
65.38
76.92
80.77
28.26
39.13
45.65
12.50
22.50
25.00
31.25
41.96
46.43
Naive
GPT-5.1
53.85
57.69
65.38
23.91
32.61
34.78
17.50
25.00
25.00
28.57
35.71
38.39
PhIDO
Qwen3-Coder-Plus
42.31
61.54
65.38
36.96
41.30
41.30
17.50
25.00
27.50
31.25
40.18
41.96
PhIDO
DeepSeek-V3.2
34.62
46.15
46.15
30.43
36.96
39.13
10.00
20.00
20.00
24.11
33.04
33.93
Table 2. Performance of SGLayout, naive baselines, and PhIDO on the 112-task benchmark. Final denotes Pass@5, corresponding to up to 5 repair rounds for SGLayout and the naive baselines, and 5 independent runs for PhIDO.
Figure 5. Convergence by repair round for SGLayout, best naive baseline, and best PhIDO baseline across complexity levels.
Evaluator
# Samples
Accuracy (%)
Precision (%)
Recall (%)
Structural Checker
100
94.00
95.12
97.50
VLM Evaluator
56
98.21
100.00
96.43
Table 3. Reliability statistics of the Structural Checker and VLM Evaluator.
Figure 6. Ablation study of the LLM-based feedback orchestrator on samples that fail in the initial generation round.
Figure 7. Case study of iterative refinement on an 8-way splitter tree layout.
Analog layout remains largely manual and hard to automate. Generator frameworks such as gLayout express layouts as programs, producing layouts from parameterized, design-rule-aware generators; however, writing such generators still takes expert effort. Large language models (LLMs) could now write generator code, and frontier models can even draw layout geometry from design intent. This raises a practical question: if a model can draw the layout itself, what does a generator framework still contribute, and is applying these models to a generator framework better than having them draw a layout from scratch? Through controlled experiments on gLayout in SKY130, we find that the main obstacle to drawing a layout directly is its time and token cost, and that the main advantage of a model building on a generator framework is reusability. Its verified primitives keep each model edit small enough to check, and its parameters allow a single edit to be evaluated across an entire family of layouts. Accordingly, a model is most effective when it develops the layout from the generator source of the family that the design intent belongs to, and tests each edit on the family members most likely to fail, so that one verified change improves every layout the generator produces. The results of these family tests can then serve as supervision for a local model, which learns edits that hold across the family at a fraction of the inference cost.
Minxing Chu, Anhang Li, Martins Atilla +2
Brown University, Providence, RI, USA · University of Michigan, Ann Arbor, MI, USA
Understanding and generating spatially coherent layouts from natural language remains a fundamental yet challenging task for large language models (LLMs). Existing LLMs often struggle to capture explicit geometric relationships and structural dependencies between objects. To address this issue, we propose SG-Layout, a graph-guided layout generation framework that explicitly incorporates structured spatial knowledge into LLMs. SG-Layout follows a two-stage training paradigm: (1) a graph-language feature alignment stage, where a relational graph encoder and a projector are trained to map scene-graph embeddings into the LLM's linguistic space; and (2) an instruction tuning stage, where LoRA-based adapters enable efficient fine-tuning for instruction-driven layout generation while keeping the backbone frozen. We evaluate SG-Layout on image layout generation, indoor scene synthesis and robotic object rearrangement tasks. Experimental results show that SG-Layout improves spatial reasoning accuracy and geometric consistency over the compact open-source backbone, with particularly clear advantages in relation-dense and compositionally complex scenes. These results highlight the effectiveness of graph-structured feature alignment for enhancing controllable layout generation.
Analog layout generators provide a programmable interface for design reuse and process migration, but their coverage is limited by handcrafted libraries. The designer knowledge embedded in complete layouts remains implicit in their geometry, making it difficult to capture in reusable generator libraries. We present ReLay, a bidirectional layout-code framework that recovers generator programs from existing layouts, enabling cross-PDK portability and parametric resizing of existing designs. Constructions that recur across recovered programs are promoted to library functions, so the library evolves as layouts accumulate. We also introduce the first layout-code benchmark: 1,050 hand-drawn layouts from 27 circuit families across three open-source PDKs, ranging from primitive cells to full chips. Learned functions account for 53-66% of layout-building calls in held-out layouts, demonstrating reuse beyond the learning corpus. Frontier LLM agents use ReLay to produce new layouts at 64-77% lower API cost per completed task than direct geometry generation, with comparable completion rates and electrical quality.
Minxing Chu, Quan Cheng, Anhang Li +5
∗Brown University, Providence, RI, USA · †University of Michigan, Ann Arbor, MI, USA