A multi-agentic framework for real-time, autonomous freeform metasurface design

Robert Lupoiu, Yixuan Shao, Tianxiang Dai, Chenkai Mao, Kofi Edée, Jonathan A. Fan

Introduction

Nanophotonic devices, particularly metasurfaces—ultra-thin surfaces capable of manipulating light at the sub-wavelength scale—hold transformative potential for technologies ranging from augmented reality (AR/VR) to medical imaging and advanced sensing. However, the design of these devices remains a significant bottleneck. Traditional workflows are heavily reliant on "human-in-the-loop" expertise to navigate the complex interplay between electromagnetic theory, geometric optimization, and computational simulation. These cycles are often slow, requiring days or weeks of iterative manual adjustments and computationally expensive Maxwell solvers.

To address this, we present MetaChat, a multi-agentic AI framework designed to automate the end-to-end design of complex, freeform metasurfaces. By integrating high-level semantic reasoning with ultrafast neural surrogate solvers, MetaChat enables the translation of plain-English requirements into high-performance photonic layouts in near real-time.

The MetaChat Framework

Agentic Iterative Monologue (AIM)

At the core of MetaChat is the Agentic Iterative Monologue (AIM) paradigm. Unlike traditional Large Language Model (LLM) tools that follow rigid, sequential instructions, AIM empowers agents with "true agency." Within this framework, agents engage in an internal monologue to self-reflect, interpret tool-generated error messages, and autonomously course-correct.

The system utilizes a specialized Design Agent to manage physics-based constraints and a Materials Expert Agent capable of querying optical property databases via SQL. By treating LLM outputs as intermediate thoughts rather than final answers, the framework allows the AI to recognize when it lacks specific data—such as a material's refractive index—and retrieve it without human intervention.

FiLM WaveY-Net: A Semi-General Surrogate Solver

To bypass the computational cost of traditional Finite-Difference Frequency-Domain (FDFD) simulations, we introduce FiLM WaveY-Net. This surrogate Maxwell solver utilizes Feature-wise Linear Modulation (FiLM) to condition a UNet architecture on variable physical parameters, including wavelength and incident angle.

While previous neural solvers were often limited to fixed conditions, FiLM WaveY-Net maintains high physical fidelity across a broad parameter space, enabling millisecond-speed simulations. This speed is critical for gradient-based optimization, where thousands of iterations may be required to converge on an optimal design.

Neuroparameterization and Manufacturability

To bridge the gap between theoretical design and physical fabrication, MetaChat employs a differentiable framework based on Signed Distance Functions (SDFs). This "neuroparameterization" ensures that the resulting freeform geometries adhere to strict manufacturing constraints, such as minimum feature sizes, preventing the generation of designs that are mathematically optimal but physically impossible to produce.

Experimental Results and Benchmarking

The Stanford Nanophotonics Benchmark

To rigorously evaluate the capabilities of AI agents in photonics, we introduced the Stanford Nanophotonics Benchmark. This suite consists of 101 diverse problems categorized into four domains: Direct Calculation, Multi-Step Reasoning, Material Search, and Function Calling.

Using GPT-4o as the underlying model, the AIM framework achieved an 81% success rate, significantly outperforming standard Chain-of-Thought prompting (72%) and vanilla LLM responses (65%). These results underscore the necessity of iterative reasoning in solving complex scientific tasks.

Performance and Speedup

The practical impact of MetaChat is most evident in its design speed. In a head-to-head comparison involving the design of a dual-wavelength metalens, MetaChat completed the task in just 11 minutes, performing approximately 300,000 simulations in the process. In contrast, a human expert using traditional FDFD methods on an 80-thread server would require roughly 5 days to achieve a comparable result. This represents a multi-order-of-magnitude reduction in design time.

Discussion and Future Directions

While MetaChat represents a leap forward in autonomous design, it remains dependent on the reasoning capabilities of the underlying LLM. Our testing indicates that while frontier models like GPT-4o excel, smaller open-source models currently struggle with the long-term coherence required for complex photonic reasoning.

Future work will focus on fine-tuning LLMs specifically on photonics literature to improve handling of non-trivial edge cases. Additionally, we aim to incorporate multimodality, allowing designers to provide "napkin sketches" as inputs, and eventually close the loop by linking the framework to robotic experimental setups for autonomous physical validation.

Summary updated

BibTeX
@inproceedings{lupoiu2025multi,
  author = {Robert Lupoiu and Yixuan Shao and Tianxiang Dai and Chenkai Mao and Kofi Edée and Jonathan A. Fan},
  title = {{A multi-agentic framework for real-time, autonomous freeform metasurface design}},
  booktitle = {Science},
  year = {2025},
  doi = {10.1126/sciadv.adx8006},
}
Figure