Source-linked AI summary

Towards a universal meta-optics solver via large language models

Huanshu Zhang, Lei Kang, Yuyan Chen, Luxiang Wang, Zhaolong Cao, Douglas H. Werner

arXiv:2608.26417v1physics.opticscs.LG

TL;DR

Existing metasurface surrogates are often tied to individual geometry families and require repeated task-specific engineering, motivating a more scalable approach. The paper uses a shared instruction-following representation with a LoRA-fine-tuned Gemma-2-9B model across 8 families for forward prediction and inverse design. The joint model reduces MSE for every family by an average of 56.5% relative to selected single-family baselines, while the same interface supports parameter generation from target spectra.

  • Problem

    Existing metasurface surrogates commonly use family-specific descriptors, output formats, and repeated architecture tuning, limiting modeling across heterogeneous geometries.

  • Method

    The study converts geometry identity, wavelength range, parameters, and optical responses into a shared instruction-following format for LoRA fine-tuning Gemma-2-9B across 8 families.

  • Results

    56.5% average relative MSE reduction was achieved for the joint 8-family model versus selected single-family baselines, with improved MSE for every family and inverse-design support through the same interface.

  • Takeaways & Limitations

    A reusable text-based interface can support heterogeneous forward and inverse meta-optics workflows with minimal architecture redesign and merge future geometry-specific datasets.

  • Takeaways & Limitations

    The study does not establish universal accuracy across all metasurfaces, and benefits for entirely new future families remain untested.

Abstract

from arXiv · show

Metasurface design increasingly requires fast models that can operate across structurally distinct device families, rather than retraining a separate surrogate for every geometry class. Conventional neural network surrogates often depend on fixed-dimensional descriptors, family-specific output formats, and repeated architecture tuning, which limits their scalability across heterogeneous meta-atoms. Here, we present a unified large language model (LLM) workflow for multi-family metasurface modeling and inverse-design. Geometries, design parameters, and optical response channels were converted into a shared instruction-following text format and used to fine-tune Gemma-2-9B across 8 metasurface families. Compared with single-family baselines, the joint model simultaneously predicted the optical responses of all metasurface families while reducing the MSE for each family by an average of 56.5%. The same representation was also used for inverse design. These results show that a shared sequence-based LLM interface can provide a practical route to cross-family metasurface design while reducing the need for task-specific surrogate architectures.

1 Introduction

Metasurface surrogates must handle complex geometry-to-optical-response mappings, but existing approaches are usually family-specific and require repeated model engineering. The paper proposes a shared LLM representation and workflow to model heterogeneous families and support forward and inverse design.

  • Motivation: Metasurface geometry enables diverse optical functions but makes wavelength-dependent response prediction across large design spaces difficult.Standard workflows therefore rely heavily on repeated numerical simulation.
  • Motivation: Neural-network surrogates can replace repeated full-wave simulations with near-instant inference, accelerating screening, optimization, and inverse-design loops.
  • Scalability gap: Most existing surrogates remain organized around one geometry family, so new metasurface classes typically require fresh data preparation, architecture tuning, and retraining.
  • Proposed direction: LLMs provide a common sequence-based interface for heterogeneous scientific inputs and outputs, potentially reducing task-specific labor and machine-learning expertise requirements.
  • Proposed workflow: The paper presents one shared text representation for geometry identity, wavelength range, design parameters, and spectral responses across distinct families, supporting forward prediction and inverse design.The workflow is intended to reduce repeated model engineering while retaining geometry-aware predictions.

2 Methods

The study constructs heterogeneous eight-family datasets and fine-tunes Gemma-2-9B with a shared JSON-like representation for forward and inverse metasurface tasks. Evaluation compares joint training with single-family baselines under a checkpoint-selection procedure designed to favor the baselines.

  • Dataset construction: The benchmark contains 8 geometry families, combining five published datasets with three in-house nanorod families generated using a QNM simulation workflow.The families include cylinder, H, AOPS, micropyramids, ellipse, 4rods, 3rods, and 2rods.
  • Dataset construction: Training records preserve family-specific differences in parameter counts, wavelength ranges, response-channel meanings, and T1/T2 array lengths.The model must use the geometry label and full input context rather than a fixed-length response schema.
  • Dataset construction: The merged dataset contains 392,736 original training samples and 86,039 test samples, while minority-family duplication produced 811,422 effective training records for the 8-family run.
  • Forward modeling: LoRA fine-tuning of quantized Gemma-2-9B uses geometry tokens, wavelength ranges, and parameter lists to generate response arrays in the shared JSON format.The forward runs use 4 NVIDIA L40S GPUs, an effective batch size of 1200, and a maximum sequence length of 578 tokens.
  • Forward evaluation: The checkpoint score prioritizes MSE while penalizing parsing failure, and the comparison is conservative because single-family baselines use their best historical checkpoints whereas multi-family runs share a common epoch.
  • Inverse design: Inverse design reverses the representation: target spectra, geometry metadata, and wavelength range are input, while a parameter list is generated and assessed by round-trip spectral agreement.The inverse model is trained separately on the merged eight-family inverse dataset.

3 Results and discussion

The joint 8-family model predicts forward optical responses across heterogeneous metasurface families and improves per-family accuracy over selected single-family baselines. The same sequence-based representation also supports inverse design through round-trip spectral evaluation.

  • Forward prediction: 1.1 × 10−3 global MSE and 0.292% global parsing failure rate were achieved on the merged 8-family forward test set.The model’s average MSE decreased rapidly early in training and then improved more gradually.
  • Forward prediction: The joint model’s representative spectra often tracked ground-truth plateaus, broad resonances, and sharp features more closely than single-family baselines.Full MSE-distribution comparisons were also used to assess whether the selected examples were representative.
  • Multi-family training: Joint training reduced MSE for all metasurface families, although improvements were not strictly monotonic as additional families were introduced.Families could benefit when first added to joint training and could improve further as more families entered the mixture.
  • Multi-family training: 56.5% average relative MSE reduction was obtained with joint 8-family training versus selected single-family baselines.MSE improved for every family; reductions were about 90% for 2rod and H structures and 5% for micropyramids.
  • Inverse design: The inverse model generated parameters from target spectra and geometry metadata, then used forward evaluation or QNM to assess round-trip spectral agreement.The global inverse-design MSE was 2.06 × 10−3, combining non-rod surrogate evaluation and rod-family QNM evaluation.
  • Inverse design: The shared interface supported both forward prediction and inverse design across heterogeneous families without requiring separate family-specific modeling workflows.The inverse model produced valid round trips for 85,755 of 86,039 test samples at epoch 15.

4 Conclusions

The study presents a single LoRA fine-tuned Gemma-2-9B model and shared instruction-following representation for eight structurally distinct metasurface families. Joint training improved forward accuracy and extended the same interface to inverse design, while the authors limit broader claims beyond the tested families and settings.

  • Unified framework: A shared representation lets one LoRA fine-tuned Gemma-2-9B model learn across eight metasurface families without family-specific input layers, output heads, or descriptor redesign.The representation includes geometry identity, wavelength range, design parameters, and optical responses.
  • Forward results: 56.5% average relative MSE reduction was achieved by the joint 8-family model relative to selected single-family baselines.MSE decreased for every family, with the largest gains for H and 2rod structures.
  • Inverse design: The same sequence-based interface extends from optical-response prediction to inverse parameter generation.Inverse design uses the representation to predict geometry parameters from target spectra.
  • Scope: The framework’s broader contribution is a reusable text-based interface and eight-family instruction-following dataset rather than a claim of universal accuracy across all metasurfaces.Future tests are proposed for unseen families, extrapolation beyond trained parameter ranges, broader materials and structures, and more diverse response representations.

Supplementary Materials

The supplementary materials are associated with the paper “Towards a universal meta-optics solver via large language models.”

  • The paper is titled “Towards a universal meta-optics solver via large language models.”
  • The listed authors include Huanshu Zhang, Lei Kang, Yuyan Chen, Luxiang Wang, and Zhaolong Cao.

Wernera,*

The supplied passages identify the affiliations of the paper’s authors at The Pennsylvania State University and Sun Yat-Sen University, and list supplementary notes.

  • Affiliations: The Pennsylvania State University affiliation is the Department of Electrical Engineering in University Park, Pennsylvania, USA.
  • Affiliations: Sun Yat-Sen University affiliation is the School of Electronics and Information Technology in Guangzhou, China.
  • Supplementary materials: The supplied materials list supplementary notes on QNM simulation, dataset preprocessing, MSE distributions, and training balance.

Supplementary Note 1. QNM simulation workflow

The workflow uses quasi-normal modes to model coupled silver-nanorod metasurfaces and reconstruct their optical responses from precomputed resonant modes. It combines eigenmode simulation, field expansion, and a shared rod parameterization across 2rod, 3rod, and 4rod configurations.

  • Structures and materials: The modeled nanorod families contain coupled configurations with two, three, or four silver nanorod resonators.The rods are embedded in a glass dielectric matrix and treated as nonmagnetic, with a constant background permittivity of 2.25.
  • Spectral reconstruction: The optical response is reconstructed through a QNM field expansion using precomputed modes and their complex eigenfrequencies.Individual nanorod spectra are dominated by a single QNM, whose fields are computed with COMSOL; PMLs and periodic boundaries model the open resonant system.
  • QNM formulation: QNMs are computed as eigenmodes of linearized, source-free Maxwell equations with Sommerfeld radiation boundary conditions.The dispersive silver response is linearized by introducing auxiliary polarization and current fields, enabling a generalized linear eigenvalue problem.
  • Geometry parameterization: Each nanorod uses a six-element parameter vector describing width, aspect ratio, position, and in-plane rotation angle.The full structure vector has 6n-3 elements because the first rod position is fixed at (0, 0, 0).

Supplementary Note 2. Additional information for dataset construction and preprocessing

The dataset pipeline converted heterogeneous metasurface families into a shared instruction-following JSON representation while preserving family-specific geometry, wavelength, parameters, and response semantics. Training and test records were merged, split, scaled, and balanced for joint modeling.

  • Shared representation: All geometry families were converted into a shared instruction-following JSON format for forward and inverse tasks.Forward prediction maps geometry and wavelength context to T1 and T2 responses; inverse design reverses this direction to predict parameters.
  • Shared representation: T1 and T2 served as shared channel names, while their physical meanings and lengths remained family-specific.The interface retained family identity and wavelength metadata rather than enforcing globally identical observables.
  • Preprocessing: Response channels were multiplied by 1000 and rounded to integers, then divided by 1000 before MSE calculation.This preprocessing reduced token length while restoring the original response scale for evaluation.
  • Evaluation: Numerical MSE comparisons are affected by differences in spectral sampling, response-channel combinations, train-test splits, and metric definitions.Reported source-publication MSE values provide context, whereas this work computes MSE on its own preprocessed test set using retained T1 and T2 values.
  • Dataset construction: 392,736 original training samples and 86,039 test samples formed the final 8-family dataset.Minority-family training samples were duplicated for balancing, producing 811,422 effective training records; the merged test set was not duplicated.

Supplementary Note 3. MSE-distribution comparison for forward prediction

The supplementary analysis compares full per-sample MSE distributions for joint 8-family and optimized single-family forward models. The joint model generally shifts errors lower, with the clearest changes for several families and smaller changes for cylinder and micropyramids.

  • Distribution comparison: Full per-sample MSE distributions were compared between the joint 8-family model and corresponding single-family baselines.MSE used all points in both response channels after restoring response values to their original scale, and distributions were plotted on a log10 scale.
  • Distribution comparison: The joint 8-family model generally shifted MSE distributions toward lower error than single-family baselines.Histograms were normalized to percentages within each geometry family.
  • Family-level patterns: For H, AOPS, ellipse, 4 rods, and 2 rods, the joint model reduced both the high-error tail and central distribution.These distribution-level changes support the representativeness of the selected Figure 2 spectra.
  • Family-level patterns: Cylinder and micropyramids showed smaller distribution-level changes, consistent with their more modest family-level improvements.The supplementary distributions therefore complement, rather than replace, family-level performance comparisons.
  • Visualization: True zero-MSE cases were represented as <1e-9 bars solely for visualization on the log10 axis.Zero values cannot be plotted directly on that axis.

Supplementary Note 4. Balanced and unbalanced 8-family training

Balanced and unbalanced 8-family training used the same base model, test-set composition, and fine-tuning hyperparameters, but exact-duplication balancing altered the tradeoff between numerical error and structured-output reliability.

  • Figure overview: Supplementary Figure 3 reports global MSE, global parsing-failure rate, and family-resolved MSE comparisons across training.Its panels cover unbalanced-training curves and family-level comparisons for all 8 geometry families.
  • Matched-endpoint comparison: At approximately matched endpoints, unbalanced training achieved lower global MSE: 6.20e-4 versus 1.09e-3, a 43.1% reduction.The unbalanced run retained source-family record counts without intentional duplication, whereas the balanced run oversampled minority families.
  • Family-level MSE: The unbalanced run had lower MSE for 7 of 8 families, with ellipse as the only family favoring the balanced checkpoint.Unbalanced values were lower for AOPS, cylinder, H, micropyramids, 2 rods, 3 rods, and 4 rods; ellipse was 2.48e-3 balanced versus 2.59e-3 unbalanced.
  • Structured-output reliability: Balanced training achieved the lower global parsing-failure rate: 0.291% versus 0.471% for unbalanced training.The comparison used approximately matched endpoints despite different total planned updates and learning-rate trajectories.
  • Interpretation: Exact-duplication balancing changed the optimization trajectory and the tradeoff between numerical spectral error and structured-output reliability.Both runs used the same 8-family test composition, base model, and fine-tuning hyperparameters.
Loading 2608.26417v1…