Skip to main content
QUICK REVIEW

[Paper Review] Learning Electromagnetic Metamaterial Physics With ChatGPT

Darui Lu, Yang Deng|arXiv (Cornell University)|Apr 23, 2024
Model Reduction and Neural NetworksPhysics and Astronomy3 citations
TL;DR

This paper demonstrates that fine-tuning large language models (LLMs) like GPT-3.5 on up to 40,000 electromagnetic metamaterial geometry-spectrum pairs enables highly accurate prediction of spectral responses, outperforming traditional ML models including deep neural networks in regression tasks. The fine-tuned LLM achieves state-of-the-art performance in forward design, though struggles with inverse design due to output format instability and lack of structural generalization.

ABSTRACT

Large language models (LLMs) such as ChatGPT, Gemini, LlaMa, and Claude are trained on massive quantities of text parsed from the internet and have shown a remarkable ability to respond to complex prompts in a manner often indistinguishable from humans. For all-dielectric metamaterials consisting of unit cells with four elliptical resonators, we present a LLM fine-tuned on up to 40,000 data that can predict the absorptivity spectrum given a text prompt that only specifies the metasurface geometry. Results are compared to conventional machine learning approaches including feed-forward neural networks, random forest, linear regression, and K-nearest neighbor (KNN). Remarkably, the fine-tuned LLM (FT-LLM) achieves a comparable performance across large dataset sizes with a deep neural network. We also explore inverse problems by asking the LLM to predict the geometry necessary to achieve a desired spectrum. LLMs possess several advantages over humans that may give them benefits for research, including the ability to process enormous amounts of data, find hidden patterns in data, and operate in higher-dimensional spaces. This suggests they may be able to leverage their general knowledge of the world to learn faster from training data than traditional models, making them valuable tools for research and analysis.

Motivation & Objective

  • To investigate whether fine-tuned large language models (LLMs) can learn and predict electromagnetic spectral responses of metamaterials from geometric descriptions.
  • To compare the performance of fine-tuned LLMs against conventional machine learning models (e.g., feed-forward networks, random forests, KNN) in forward design of metamaterials.
  • To evaluate the feasibility of using LLMs for inverse design—generating geometries that produce target spectra—despite known challenges in one-to-many mapping.
  • To assess the interpretability of fine-tuned LLMs in reasoning about physical relationships between metamaterial geometry and electromagnetic response.
  • To explore whether LLMs can generalize physical knowledge from their pre-training to enable data-efficient metamaterials design.

Proposed method

  • Fine-tuned GPT-3.5 on a dataset of 40,000 geometry-spectrum pairs, where each sample was encoded as a text prompt describing the metasurface geometry.
  • Used two prompt templates: one concise vector-style input and one detailed descriptive input, to evaluate the impact of input format on model performance.
  • Trained the LLM using standard language modeling objectives (next-token prediction) with cross-entropy loss, adapting it to regression via structured output formatting.
  • Evaluated model performance using mean absolute relative error (MARE) and mean squared error (MSE) across varying dataset sizes (from 1,000 to 40,000 samples).
  • Applied the fine-tuned LLM to inverse design by prompting it to generate geometries that yield a specified target spectrum, using constrained output templates.
  • Assessed interpretability by querying the model with perturbation-based questions about geometric parameters and analyzing response coherence and physical plausibility.

Experimental results

Research questions

  • RQ1Can a fine-tuned LLM achieve superior regression performance in predicting electromagnetic spectra of metamaterials compared to conventional machine learning models, even with limited training data?
  • RQ2Does the input format (concise vector vs. descriptive text) significantly affect the predictive accuracy of the fine-tuned LLM?
  • RQ3Can fine-tuned LLMs effectively solve inverse design problems in metamaterials by generating geometry from desired spectral targets?
  • RQ4To what extent does fine-tuning improve the model’s physical reasoning and interpretability compared to the base LLM?
  • RQ5What are the primary limitations of LLMs in handling high-dimensional, one-to-many inverse design tasks in metamaterials?

Key findings

  • The fine-tuned LLM (FT-LLM) achieved lower mean absolute relative error (MARE) than all baseline models—including deep neural networks—across all dataset sizes tested, demonstrating superior regression performance.
  • Performance was nearly identical between the two prompt templates (vector vs. descriptive), indicating that input format has minimal impact on predictive accuracy.
  • The FT-LLM outperformed even deep neural networks in high-dimensional regression, suggesting LLMs can capture complex geometry-spectrum relationships with less data.
  • Inverse design attempts failed for models trained on >10,000 samples, as the model frequently ignored formatting constraints and generated invalid or nonsensical numerical outputs.
  • Small-dataset fine-tuned models produced some plausible geometries, but most were physically incorrect, indicating a lack of structural design capability.
  • The fine-tuned LLM did not show significantly improved physical understanding compared to the base model, and responses were often stylistically uniform (one-paragraph summaries), likely due to training data format.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.