An Agent-Driven, Cross-Validated Inverse-Design Pipeline for Dielectric Metasurfaces

arXiv:2611.08127 · physics.optics · Submitted 2026-11-05 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Physics. The day in general physics: instruments, methods and results across the field.

Kai: I'm Kai.

Mira: And I'm Mira, here with Lev.

Kai: We're looking at the paper: "An Agent-Driven, Cross-Validated Inverse-Design Pipeline for Dielectric Metasurfaces".

Mira: Here's the gist of the paper. Inverse design of dielectric metasurfaces is powerful but labour-intensive: each new target requires choosing a parameterization and a figure of merit, managing compute resources, and critically assessing results that may be numerically unconverged, sensitive to fabrication errors or trapped in local optima The present work belongs to the third role: the agent runs a rigorous three-dimensional solver in the loop and, bound by a written protocol, every reported result is verified by an independent method This approach is complementary to agents based on neural surrogates because a surrogate can propose candidates that the protocol of this work then optimizes rigorously, robustifies and validates Agent-Driven Workflow The core of the pipeline involves an artificial intelligence (AI) coding agent that transforms a plain-language specification into metasurface optimization runs This agent follows a written protocol stored in AGENTS.md, which dictates steps like checking physical feasibility, writing configuration files, estimating computational cost, and proposing the next iteration The agent never connects to computing resources itself; it only writes one-line requests to a queue folder via a minimal file-based bridge A watcher process started by the user validates these requests against a whitelist and executes them on the local GPU or an HPC cluster Optimization and Robustness Designs are optimized with differentiable three-dimensional rigorous coupled-wave analysis (RCWA), including robustness to fabrication tolerances The optimization uses a gradient-based topology optimization where the update of the design is computed by the algorithm, not by the agent Fabrication robustness is imposed geometrically through a second Gaussian kernel and thresholding to enforce exact edge shifts of ±d nm, mimicking fabricated features that are narrower or wider than designed The loss channel analysis dictates the next change in the protocol Cross-Solver Validation Every reported design passes a fixed checklist and a three-dimensional FDTD re-simulation to ensure trustworthiness The validation protocol compares the results from RCWA and FDTD, assigning a verdict of agree, inconclusive, marginal, or disagree based on predefined tolerances For instance, for the robust metagrating v4 s2 in x polarization, the two solvers agreed to within 0.5 points over the whole resolution study Case Studies and Findings The pipeline was demonstrated on three case studies at a wavelength of 1550 nm: a freeform silicon metagrating, a polarization-independent meta-atom library assembled into supercells, and metalenses built from the same library In the metagrating case, the independent FDTD verification revealed a 5% overestimate of the efficiency by the optimization model that a conventional convergence test had not detected The robust design retained most of its efficiency under ±10 nm fabrication errors In the second case, a global robust optimization of the whole 12-atom supercell raised its worst-case efficiency for edge shifts up to ±10 nm from 75% to 85%, at the cost of 1.4% of nominal efficiency The work concludes that coupling an AI agent to a differentiable 3D solver with exact fabrication robustness and a mandatory independent full-wave verification yields designs whose reported figures can be trusted Limitations and Future Directions The paper notes four main limitations, including the lack of enforcement of a minimum feature size in the robust formulation The metalenses are validated but not optimized with full-wave simulations, and beyond one additional specification, the agent was not systematically evaluated across different specifications or language models The reliability of all results rests on convergence within each solver and on the agreement between two independent methods The agents' contribution lies in the systematic application of checks that a careful designer would make but rarely makes for every run Process Record and Cost The process record shows that on one V100S GPU a single metagrating optimization takes 6–19 min (non-robust and robust), a meta-atom 5 min, a 12-atom supercell refinement 50 min The agent executed 84 bridge requests and submitted 134 cluster jobs, including 96 optimizations (11.2 GPU-hours) and 14 FDTD validation jobs The total GPU wall time of the optimization runs was 11.2 h Positioning in Design Frameworks The pipeline is positioned among three categories, including LLM scripting assistants, surrogate/generative frameworks, and this work which uses a solver in the loop This approach differs from surrogates where accuracy is limited by the training distribution and does not certify a design The agents' evidence for their role is shown through process records of Tables S5 and S6 Command Reference The pipeline utilizes several commands, such as submit to run an optimization, array to execute sweeps or libraries, and meep to perform FDTD validations The command design run topopt.py --config c.json

--init f: is used for any periodic cell summary with all orders, convergence, robustness, features The command validation/compare fields.py field comparison near fields, beam and order spectra of both solvers is used to compare the results The command paper/make figures.py after the runs all figures of this paper from the run directories is used to generate all figures Transfer to a New Problem To test protocol transferability, a new agent session was asked to design a TM quasi-bound state in the continuum (quasi-BIC) with Q ≈ 1000 near 1550 nm The agent added a spectral scanning tool based on the same RCWA solver to find λ0 and Q from a complex Fano fit The independent FDTD verification exposed a numerical artifact, this time on the FDTD side, where grid-induced symmetry breaking distorted the quality factor of a quasi-BIC This suggests that crossvalidation between independent methods should become part of the loop rather than an afterthought The work shows that coupling an AI agent to a differentiable 3D solver with exact fabrication robustness and a mandatory independent full-wave verification yields designs whose reported figures can be trusted The independent verification detected numerical artifacts in both solvers, such as a polarization-dependent truncation error in RCWA that had passed a standard convergence test As agents take over more of the simulation loop, crossvalidation between independent methods should become part of the loop rather than an afterthought The work has four main limitations, including the lack of enforcement of a minimum feature size in the robust formulation The agents do not know more physics than an experienced designer, but the difference is that the checks are applied to every run by a fixed and documented protocol Acknowledgements G.E.L thanks the CINECA projects DENZMODE (ID:HP10CILT35) under the ISCRA initiative, for the availability of high-performance computing resources and support The authors used an AI coding agent (Claude, Anthropic) to write and operate the software, run and analyse the simulations The code, the agent instructions and all runs discussed here are openly available on GitHub at https://github.com/GiuseppeELio/metasurface-agent-pipeline (MIT License) The TORCWA and Meep are installed separately under their own licences Author Declarations The authors have no conflicts to disclose The code, the agent instructions and all runs discussed here are openly available on GitHub at https://github.com/GiuseppeELio/metasurface-agent-pipeline (MIT License) and archived on Zenodo at 10.5281/zenodo.23982523 The TORCWA and Meep are installed separately under their own licences References The references include works on rigorous coupled-wave analysis, topology optimization, and inverse design in nanophotonics The references cover topics such as blazed binary subwavelength gratings and metalenses The references also include works on LLM-powered generative multimodal nanophotonics inverse design The references cover topics such as deep neural networks for the evaluation and design of photonic devices The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design The references include works on rigorous coupled-wave analysis of planar grating diffraction The references also include works on the focal shifts in diffracted converging spherical waves The references cover topics such as photonic topology optimization with semiconductor-foundry design-rule constraints References The references include works on inverse design of large-area metasurfaces The references also include works on learning electromagnetic metamaterial physics with ChatGPT The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design The references include works on rigorous coupled-wave analysis of planar grating diffraction The references also include works on the focal shifts in diffracted converging spherical waves References The references cover topics such as photonic topology optimization with semiconductor-foundry design-rule constraints The references include works on inverse design of large-area metasurfaces The references also include works on learning electromagnetic metamaterial physics with ChatGPT The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design References The references include works on rigorous coupled-wave analysis of planar grating diffraction The references also include works on the focal shifts in diffracted converging spherical waves The references cover topics such as photonic topology optimization with semiconductor-foundry design-rule constraints References The references include works on inverse design of large-area metasurfaces The references also include works on learning electromagnetic metamaterial physics with ChatGPT The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design References

Paper summary: Kai: So to get into segment two of this discussion, we're looking at "An Agent-Driven, Cross-Validated Inverse-Design Pipeline for Dielectric Metasurfaces." The paper argues that inverse design of these metasurfaces is powerful but it's very labor intensive. Each new target requires choosing a parameterization and a figure of merit, managing compute resources, and critically assessing results because they might not have converged properly or be sensitive to fabrication errors or trapped in local optima.

Mira: The thesis is that they present an open source pipeline where an artificial intelligence agent turns plain language specifications into metasurface optimization runs. It claims this approach is complementary to agents based on neural surrogates because a surrogate can propose candidates that the protocol of this work then optimizes rigorously, robustifies and validates.

Lev: The core of the pipeline involves an AI coding agent that transforms a plain language specification into metasurface optimization runs by following a written protocol stored in AGENTS dot md. This agent checks physical feasibility, writes configuration files, estimates computational cost, and proposes the next step.

Kai: That agent never connects to computing resources itself; it only writes one line requests to a queue folder via a minimal file based bridge. A watcher process started by the user validates those requests against a whitelist and executes them on the local GPU or an HPC cluster.

Mira: The optimization itself uses differentiable three dimensional rigorous coupled wave analysis, including robustness to fabrication tolerances. The optimization uses gradient based topology optimization where the update of the design is computed by the algorithm, not by the agent.

Lev: Fabrication robustness is imposed geometrically through a second Gaussian kernel and thresholding to enforce exact edge shifts of plus or minus d nanometers, mimicking fabricated features that are narrower or wider than designed. The loss channel analysis dictates the next change in the protocol for optimization.

Kai: Then they have cross solver validation where every reported design passes a fixed checklist and a three dimensional fdtd re simulation to ensure trustworthiness. This protocol compares results from rigorous coupled wave analysis and fdtd, assigning a verdict of agree, inconclusive, marginal, or disagree based on predefined tolerances.

Mira: The results show that when they ran this pipeline on three case studies at fifteen fifty nanometers—a freeform silicon metagrating, a polarization independent meta atom library assembled into supercells, and metalenses built from the same library—the pipeline worked as described.

Lev: The finding in the metagrating case was that the independent fdtd verification revealed a five percent overestimate of efficiency by the optimization model that a conventional convergence test had not detected. And this robust design retained most of its efficiency under plus or minus ten nanometer fabrication errors.

Kai: In the second case, they found that a global robust optimization of the whole twelve atom supercell raised its worst case efficiency for edge shifts up to plus or minus ten nanometers from seventy five percent to eighty five percent, at the cost of one point four percent of nominal efficiency.

Mira: So what this means is that coupling an AI agent to a differentiable three dimensional solver with exact fabrication robustness and a mandatory independent full wave verification yields designs whose reported figures can be trusted.

Lev: And they also showed that when they tested protocol transferability by designing a quasi bic state in the continuum with Q approximately one thousand near fifteen fifty nanometers, the independent fdtd verification exposed a numerical artifact on the fdtd side where grid induced symmetry breaking distorted the quality factor of that quasi bic.

Conclusion: Kai: So wrapping up this discussion on "An Agent-Driven, Cross-Validated Inverse-Design Pipeline for Dielectric Metasurfaces," the paper shows a systematic way to use an agent to drive complex inverse design problems. The authors are Giuseppe Emanuele Lio and his team at the University of Pisa and CNR institutes.

Mira: It really comes down to showing how this agent can be used not just as a suggestion generator, but as an active participant in the entire design loop, applying rigorous checks that a careful designer would do but rarely does it for every run.

Lev: The implication for researchers is that when we see agents taking over more of the simulation loop, cross validation between independent methods should become part of the loop rather than an afterthought.

Kai: That's right. This paper shows how to use this agent to generate designs where you can trust the reported figures because they pass a fixed checklist and a three dimensional fdtd re simulation.

Mira: It suggests that agents are valuable when they are programmed with these systematic checks, not just because of their intelligence alone, but because of the protocol they follow.

Lev: The main takeaway is that we need to integrate cross validation between independent methods directly into the loop as the agents become more involved in design tasks.

Giuseppe Emanuele Lio, Roberto Caputo, Alain J. Corso, Maria Guglielmina Pelizzo, Antonio Ferraro

Department of Physics “E. Fermi”, University of Pisa · Department of Physics, University of Calabria · Ánsiglio Nazionale delle Ricerche - Istituto di Nanotecnologia (CNR-Nanotec) · Consiglio Nazionale delle Ricerche, Istituto di Fotonica e Nanotecnologie (CNR - IFN) · Dipartimento di Ingegneria dell’Informazione, Universitáa degli Studi di Padova

physics.optics

Submitted: 2026-11-05

Updated: 2026-11-05

Comments: The code, are openly available on GitHub at \url{https://github.com/GiuseppeELio/metasurface-agent-pipeline} (MIT License) and archived on Zenodo at 10.5281/zenodo.23982523

Code: https://github.com/GiuseppeELio/metasurface-agent-pipeline

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 89/100

The gist: Inverse design of dielectric metasurfaces is powerful but labour-intensive: each new target requires choosing a parameterization and a figure of merit, managing compute resources…

Key concepts

Agent-Driven Workflow
An AI agent translates plain language design goals into optimization runs. It follows a strict protocol to check feasibility, manage computational cost, and propose the next design iteration. The agent does not handle computing directly but only submits requests via a simple bridge.
Differentiable RCWA Optimization
Designs are optimized using rigorous coupled-wave analysis (RCWA) that is differentiable. This allows a gradient-based algorithm to automatically update the design parameters to improve performance, ensuring the optimization process is guided by physics rather than just guessing.
Cross-Solver Validation
Every proposed design must pass a fixed checklist and be re-simulated using an independent method, like FDTD. This comparison ensures trustworthiness by checking if results from two different solvers agree within set tolerances, catching numerical artifacts or errors in either simulation.
Fabrication Robustness
The optimization enforces geometric robustness by mimicking real-world manufacturing limits. This is achieved through a second Gaussian kernel and thresholding to ensure that the final design remains functional even if fabricated features are slightly narrower or wider than intended.

Terminology

Summary

Inverse design of dielectric metasurfaces is powerful but labour-intensive: each new target requires choosing a parameterization and a figure of merit, managing compute resources, and critically assessing results that may be numerically unconverged, sensitive to fabrication errors or trapped in local optima The present work belongs to the third role: the agent runs a rigorous three-dimensional solver in the loop and, bound by a written protocol, every reported result is verified by an independent method This approach is complementary to agents based on neural surrogates because a surrogate can propose candidates that the protocol of this work then optimizes rigorously, robustifies and validates

Agent-Driven Workflow

The core of the pipeline involves an artificial intelligence (AI) coding agent that transforms a plain-language specification into metasurface optimization runs This agent follows a written protocol stored in AGENTS.md, which dictates steps like checking physical feasibility, writing configuration files, estimating computational cost, and proposing the next iteration The agent never connects to computing resources itself; it only writes one-line requests to a queue folder via a minimal file-based bridge A watcher process started by the user validates these requests against a whitelist and executes them on the local GPU or an HPC cluster

Optimization and Robustness

Designs are optimized with differentiable three-dimensional rigorous coupled-wave analysis (RCWA), including robustness to fabrication tolerances The optimization uses a gradient-based topology optimization where the update of the design is computed by the algorithm, not by the agent Fabrication robustness is imposed geometrically through a second Gaussian kernel and thresholding to enforce exact edge shifts of ±d nm, mimicking fabricated features that are narrower or wider than designed The loss channel analysis dictates the next change in the protocol

Cross-Solver Validation

Every reported design passes a fixed checklist and a three-dimensional FDTD re-simulation to ensure trustworthiness The validation protocol compares the results from RCWA and FDTD, assigning a verdict of agree, inconclusive, marginal, or disagree based on predefined tolerances For instance, for the robust metagrating v4 s2 in x polarization, the two solvers agreed to within 0.5 points over the whole resolution study

Case Studies and Findings

The pipeline was demonstrated on three case studies at a wavelength of 1550 nm: a freeform silicon metagrating, a polarization-independent meta-atom library assembled into supercells, and metalenses built from the same library In the metagrating case, the independent FDTD verification revealed a 5% overestimate of the efficiency by the optimization model that a conventional convergence test had not detected The robust design retained most of its efficiency under ±10 nm fabrication errors In the second case, a global robust optimization of the whole 12-atom supercell raised its worst-case efficiency for edge shifts up to ±10 nm from 75% to 85%, at the cost of 1.4% of nominal efficiency The work concludes that coupling an AI agent to a differentiable 3D solver with exact fabrication robustness and a mandatory independent full-wave verification yields designs whose reported figures can be trusted

Limitations and Future Directions

The paper notes four main limitations, including the lack of enforcement of a minimum feature size in the robust formulation The metalenses are validated but not optimized with full-wave simulations, and beyond one additional specification, the agent was not systematically evaluated across different specifications or language models The reliability of all results rests on convergence within each solver and on the agreement between two independent methods The agents' contribution lies in the systematic application of checks that a careful designer would make but rarely makes for every run

Process Record and Cost

The process record shows that on one V100S GPU a single metagrating optimization takes 6–19 min (non-robust and robust), a meta-atom 5 min, a 12-atom supercell refinement 50 min The agent executed 84 bridge requests and submitted 134 cluster jobs, including 96 optimizations (11.2 GPU-hours) and 14 FDTD validation jobs The total GPU wall time of the optimization runs was 11. p. 42 h

Positioning in Design Frameworks

The pipeline is positioned among three categories, including LLM scripting assistants, surrogate/generative frameworks, and this work which uses a solver in the loop This approach differs from surrogates where accuracy is limited by the training distribution and does not certify a design The agents' evidence for their role is shown through process records of Tables S5 and S6

Command Reference

The pipeline utilizes several commands, such as submit to run an optimization, array to execute sweeps or libraries, and meep to perform FDTD validations The command design run topopt.py --config c. p. 1json [--set k=v] [--init f] is used for any periodic cell summary with all orders, convergence, robustness, features The command validation/compare fields. p. 9py field comparison near fields, beam and order spectra of both solvers is used to compare the results The command paper/make figures. p. 9py after the runs all figures of this paper from the run directories is used to generate all figures

Transfer to a New Problem

To test protocol transferability, a new agent session was asked to design a TM quasi-bound state in the continuum (quasi-BIC) with Q ≈ 1000 near 1550 nm The agent added a spectral scanning tool based on the same RCWA solver to find λ0 and Q from a complex Fano fit The independent FDTD verification exposed a numerical artifact, this time on the FDTD side, where grid-induced symmetry breaking distorted the quality factor of a quasi-BIC This suggests that crossvalidation between independent methods should become part of the loop rather than an afterthought

Conclusion and Implications

The work shows that coupling an AI agent to a differentiable 3D solver with exact fabrication robustness and a mandatory independent full-wave verification yields designs whose reported figures can be trusted The independent verification detected numerical artifacts in both solvers, such as a polarization-dependent truncation error in RCWA that had passed a standard convergence test As agents take over more of the simulation loop, crossvalidation between independent methods should become part of the loop rather than an afterthought The work has four main limitations, including the lack of enforcement of a minimum feature size in the robust formulation The agents do not know more physics than an experienced designer, but the difference is that the checks are applied to every run by a fixed and documented protocol

Acknowledgements

G.E.L thanks the CINECA projects DENZMODE (ID:HP10CILT35) under the ISCRA initiative, for the availability of high-performance computing resources and support The authors used an AI coding agent (Claude, Anthropic) to write and operate the software, run and analyse the simulations The code, the agent instructions and all runs discussed here are openly available on GitHub at https://github. p. 5com/GiuseppeELio/metasurface-agent-pipeline (MIT License) The TORCWA and Meep are installed separately under their own licences

Author Declarations

The authors have no conflicts to disclose The code, the agent instructions and all runs discussed here are openly available on GitHub at https://github.com/GiuseppeELio/metasurface-agent-pipeline (MIT License) and archived on Zenodo at 10. p. 55281/zenodo. p. 523982523 The TORCWA and Meep are installed separately under their own licences

References

The references include works on rigorous coupled-wave analysis, topology optimization, and inverse design in nanophotonics The references cover topics such as blazed binary subwavelength gratings and metalenses The references also include works on LLM-powered generative multimodal nanophotonics inverse design The references cover topics such as deep neural networks for the evaluation and design of photonic devices The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design The references include works on rigorous coupled-wave analysis of planar grating diffraction The references also include works on the focal shifts in diffracted converging spherical waves The references cover topics such as photonic topology optimization with semiconductor-foundry design-rule constraints

The references include works on inverse design of large-area metasurfaces The references also include works on learning electromagnetic metamaterial physics with ChatGPT The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design The references include works on rigorous coupled-wave analysis of planar grating diffraction The references also include works on the focal shifts in diffracted converging spherical waves

The references cover topics such as photonic topology optimization with semiconductor-foundry design-rule constraints The references include works on inverse design of large-area metasurfaces The references also include works on learning electromagnetic metamaterial physics with ChatGPT The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design

The references include works on rigorous coupled-wave analysis of planar grating diffraction The references also include works on the focal shifts in diffracted converging spherical waves The references cover topics such as photonic topology optimization with semiconductor-foundry design-rule constraints

The references include works on inverse design of large-area metasurfaces The references also include works on learning electromagnetic metamaterial physics with ChatGPT The references cover topics such as a multi-agentic framework for real-time, autonomous freeform metasurface design

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Agent-Driven Verification Loop: Implement a mandatory cross-solver validation step where every reported design is independently verified with finite-difference time-domain (FDTD) simulations to ensure trust in optimization results. This allows the system to report on the independent verification [which] detected a 5% overestimate of the efficiency by the optimization model that a conventional convergence test had not detected.

  2. Robustness Enforcement: Integrate geometric robust formulation for fabrication tolerances, specifically using an edge shift of ±d = 10 nm, which is enforced exactly rather than relying on classical threshold formulations whose shifts depend on local grey levels. This ensures the design is robust to ±10 nm fabrication errors.

  3. Diagnosis Protocol Automation: Automate the diagnosis ladder prescribed when validation yields a non-agree verdict, requiring the agent to raise the RCWA truncation, raise the FDTD resolution, check that both solvers see the same geometry before reporting. This prevents premature reporting based on potentially flawed numerical models.

  4. Feature Size Reporting: Require every run to report a minimum features metric (fraction of solid and void narrower than 30, 40, 60 and 80 nm), addressing the limitation that the robust formulation does not enforce a minimum feature size.

  5. Contextual Optimization Initialization: Improve the agent's ability to handle local optima by implementing physics-informed initializations when starting a new phase optimization. This involves using a disk with the radius that already provides that phase in the sweep of Figure S3, plus a clover and a cross of equal area, as suggested by Table S5.

  6. Near-Field Coupling Assessment: Enhance the agent's analysis to specifically check for near-field coupling effects in metalens designs, as observed where the gap with the library prediction, which measures near-field coupling between neighbouring atoms, decreases from 7.6 points at N = 8 to 5.1 and 4.6 points at N = 12 and 24.

Sources

Related papers