TL;DR
SGLayout is a self-refining framework that enables Large Language Models (LLMs) to generate complex physical layouts by bridging the fundamental gap between code and geometry. By using an execution-derived schema to map spatial errors (like spacing violations) back to specific code parameters, it transforms "blind refactoring" into targeted, surgical repairs, boosting success rates in automated layout generation from 50.89% to 76.79%.
What Problem Does This Paper Address?
Large Language Models have become surprisingly adept at writing code, but they are effectively "blind" when that code describes physical objects. In Electronic Design Automation (EDA), we often use parameterized layout generation—writing code (e.g., in Python using GDSFactory) that instantiates components and defines their spatial relationships.
The challenge is that while an LLM can write the code, it cannot easily predict the geometric consequences. A slight miscalculation in a spacing parameter might lead to a Design Rule Check (DRC) violation where two wires are too close to manufacture. Standard EDA tools will flag the error at specific coordinates, but the LLM operates in "code space." Without a way to link those coordinates back to a specific line of code, the LLM is forced into blind refactoring: guessing which parameter to change, often fixing a symptom rather than the root cause.
Methods
The authors propose SGLayout, a closed-loop framework that uses a "schema-guided" mechanism to provide the missing link between code and geometry.
- Execution & Schema Construction: When the LLM-generated code runs, SGLayout doesn't just produce a layout; it intercepts the execution to build a structured schema. This schema acts as a bidirectional lookup table, recording exactly which code snippet and parameters created which geometric instance and where it sits in the physical coordinate space.
- Multi-Dimensional Evaluation: Instead of relying on a single check, SGLayout emulates a human engineer's review process:
- Structural Intent Checker: Uses LLM-instantiated templates to verify if the circuit topology (e.g., port counts, hierarchical nesting) matches the user's prompt.
- Vision-Language Assessment (VLM): Uses a Vision-Language Model to perform a "sanity check" on the macro-level visual plausibility (e.g., detecting gross asymmetry or malformed shapes).
- Design Rule Checking (DRC): A standard industry engine checks for physical manufacturing violations.
- Error Back-Projection: This is the core innovation. When an evaluator finds a violation at coordinate $(x, y)$, SGLayout uses the schema to "back-project" that error. It identifies the specific code anchor responsible for the object at those coordinates.
- Orchestration & Surgical Repair: An "Orchestrator" agent takes these localized findings, considers the history of previous attempts (via a "constraint ledger"), and synthesizes a targeted repair plan. Instead of rewriting the whole script, it applies a "surgical patch" to the specific faulty parameters.
Datasets
The authors introduced a new, curated benchmark of 112 parameterized layout generation tasks implemented in GDSFactory.
- Diversity: Tasks cover Geometric Shape Synthesis, Connectivity/Routing, and Hierarchical Composition.
- Complexity: Tasks are categorized into three levels, ranging from single-device setups to complex, globally coupled multi-instance designs.
- Evaluation: Each task includes a natural-language query and a corresponding executable evaluation protocol.
Key Insights and Ideas
- The Representation Gap is the Real Bottleneck: The paper argues that the failure of LLMs in EDA isn't just about "reasoning" but about the disconnect between symbolic code and physical realization. The schema provides the "eyes" the LLM needs.
- Surgical vs. Global Edits: Blindly refactoring an entire script often introduces new bugs. By constraining the LLM to edit only the "responsible" code block identified by the schema, the refinement process becomes much more stable.
- Stateful Refinement: By maintaining a "schema diff" and a "constraint ledger," the system avoids oscillating between two different errors (e.g., fixing a spacing issue only to break a connectivity requirement).
- Visual "Sanity Checks" Matter: While DRC catches tiny spacing errors, VLMs are better at catching "holistic" failures that are hard to describe with pure logic, such as a routing path taking a bizarre, unnecessary detour.
Key Results
- Overall Performance: SGLayout achieved a 76.79% pass rate, a massive jump over the strongest baseline (50.89%) and specialized one-shot pipelines like PhIDO (41.96%).
- Scaling with Difficulty: The advantage of SGLayout grows with task complexity. On the hardest "Level 3" tasks, SGLayout reached a 42.50% success rate, while the best baseline stalled at 27.50%.
- Convergence: As shown in the convergence plots, SGLayout continues to improve significantly across repair rounds, whereas baselines often plateau early because they lack the feedback precision to solve deep-rooted geometric conflicts.
Limitations and Future Work
The authors note that while the current implementation is built on GDSFactory, the methodology is designed to be framework-agnostic. However, some limitations are apparent:
- PDK Specificity: The current evaluation uses a generic Process Design Kit (PDK). Performance might vary with more restrictive, proprietary industrial PDKs.
- Computational Overhead: The iterative loop (execution -> DRC -> VLM -> LLM repair) is more computationally expensive than one-shot generation.
- Future Directions: The authors suggest that this schema-guided approach could be extended beyond layout to other cross-modal EDA tasks where code-to-physical alignment is critical.
Summary updated