MCP-Enabled LLM for Meta-optics Inverse Design: Leveraging Differentiable Solver without LLM Expertise
Pith reviewed 2026-05-18 23:36 UTC · model grok-4.3
The pith
The Model Context Protocol lets large language models autonomously generate inverse design codes for meta-optics by accessing code templates and documentation from dedicated servers.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The MCP-assisted framework allows LLMs to autonomously access verified code templates and comprehensive documentation through dedicated servers to generate complete inverse design codes without prescribed coordination rules. Evaluation on the Huygens meta-atom design task with the differentiable TorchRDIT solver shows that both natural language and structured prompting strategies achieve high success rates, yet structured prompting significantly outperforms in design quality, workflow efficiency, computational cost, and error reduction. The minimalist server design, using only 5 APIs, demonstrates how MCP makes sophisticated computational tools accessible to researchers without programming
What carries the argument
Model Context Protocol (MCP) that provides dynamic access to verified code templates and documentation through dedicated servers, enabling LLMs to generate complete inverse design codes autonomously.
If this is right
- Researchers without programming expertise can perform inverse design for meta-optics using LLMs and differentiable solvers.
- Structured prompting yields higher design quality and lower computational cost than natural language prompting.
- A server exposing only five APIs is sufficient to support full autonomous code generation for the task.
- The same MCP pattern offers a generalizable way to connect LLMs to other specialized scientific solvers.
Where Pith is reading between the lines
- The same server-based template approach could be applied to inverse design problems in related fields such as acoustics or nanophotonics.
- Success may hinge on the curation quality of the supplied templates, suggesting that template maintenance becomes a new research task.
- Extending the framework to multi-objective or fabrication-constrained designs would test whether LLM reasoning scales without added human oversight.
Load-bearing premise
LLMs can reliably interpret and correctly apply the dynamically provided code templates and documentation to produce functional, efficient inverse-design scripts without introducing critical errors or requiring human debugging for complex meta-optics tasks.
What would settle it
Executing the LLM-generated code on the Huygens meta-atom task with TorchRDIT and checking whether the output designs meet performance targets without manual error correction or additional debugging.
Figures
read the original abstract
Automatic differentiation (AD) enables powerful metasurface inverse design but requires extensive theoretical and programming expertise. We present a Model Context Protocol (MCP) assisted framework that allows researchers to conduct inverse design with differentiable solvers through large language models (LLMs). Since LLMs inherently lack knowledge of specialized solvers, our proposed solution provides dynamic access to verified code templates and comprehensive documentation through dedicated servers. The LLM autonomously accesses these resources to generate complete inverse design codes without prescribed coordination rules. Evaluation on the Huygens meta-atom design task with the differentiable TorchRDIT solver shows that while both natural language and structured prompting strategies achieve high success rates, structured prompting significantly outperforms in design quality, workflow efficiency, computational cost, and error reduction. The minimalist server design, using only 5 APIs, demonstrates how MCP makes sophisticated computational tools accessible to researchers without programming expertise, offering a generalizable integration solution for other scientific tasks.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript introduces an MCP-assisted framework that enables LLMs to perform inverse design of meta-optics using differentiable solvers (e.g., TorchRDIT) by dynamically accessing verified code templates and documentation via a minimalist 5-API server. The LLM generates complete inverse-design scripts autonomously without prescribed coordination rules. On the Huygens meta-atom design task, both natural-language and structured prompting achieve high success rates, with structured prompting reported as superior in design quality, workflow efficiency, computational cost, and error reduction. The approach aims to make advanced computational tools accessible to researchers lacking programming or LLM expertise.
Significance. If the quantitative claims hold, the work could lower barriers to using differentiable solvers for meta-optics inverse design and offer a generalizable integration pattern for other scientific domains. The minimalist server design and emphasis on autonomy without custom rules are positive features. However, the absence of numerical success fractions, success definitions, error breakdowns, and implementation details limits assessment of whether the framework truly delivers reliable, human-intervention-free results.
major comments (3)
- Abstract: The central claim that both prompting strategies 'achieve high success rates' on the Huygens meta-atom task lacks any numerical success fraction, definition of success (e.g., runtime-error-free code, convergence to target efficiency, correct use of autodiff), or distribution of failure modes. This information is load-bearing for evaluating whether the MCP-supplied templates enable genuine autonomy or merely near-working code that still requires human fixes.
- Evaluation section (implied by abstract claims): No quantitative metrics, error bars, retry counts, or human-intervention statistics are reported for the comparative success rates or the advantages of structured prompting. Without these, it is impossible to substantiate the reported superiority in design quality, efficiency, and error reduction.
- Server design description: The minimalist 5-API server is presented as sufficient to guarantee resource access and correct synthesis, yet the manuscript provides no concrete details on how the APIs prevent critical errors in code generation for complex meta-optics tasks or on the observed failure modes across trials.
minor comments (2)
- Clarify the exact scope of 'complete inverse design codes' generated by the LLM (e.g., whether they include full optimization loops, visualization, or only the forward model).
- Provide at least one concrete example of a generated script or a table summarizing success/failure cases to illustrate the workflow.
Simulated Author's Rebuttal
We thank the referee for their constructive feedback on our manuscript. The comments highlight important aspects for improving the presentation of our results. We provide detailed responses to each major comment and commit to revisions that enhance the manuscript's clarity and substantiation of claims.
read point-by-point responses
-
Referee: Abstract: The central claim that both prompting strategies 'achieve high success rates' on the Huygens meta-atom task lacks any numerical success fraction, definition of success (e.g., runtime-error-free code, convergence to target efficiency, correct use of autodiff), or distribution of failure modes. This information is load-bearing for evaluating whether the MCP-supplied templates enable genuine autonomy or merely near-working code that still requires human fixes.
Authors: We agree that the abstract should include more specific information to support the claims. In the revised manuscript, we will incorporate numerical success fractions from our experimental trials, provide a clear definition of success (including runtime-error-free code and convergence to target efficiency with correct autodiff usage), and outline the distribution of failure modes. This will allow readers to better assess the autonomy enabled by the MCP framework. revision: yes
-
Referee: Evaluation section (implied by abstract claims): No quantitative metrics, error bars, retry counts, or human-intervention statistics are reported for the comparative success rates or the advantages of structured prompting. Without these, it is impossible to substantiate the reported superiority in design quality, efficiency, and error reduction.
Authors: The current manuscript presents the advantages of structured prompting based on observed outcomes in the evaluation. To strengthen this, we will revise the evaluation section to include quantitative metrics such as success rates, error bars, retry counts, and human-intervention statistics. These additions will provide concrete evidence for the superiority in design quality, workflow efficiency, computational cost, and error reduction. revision: yes
-
Referee: Server design description: The minimalist 5-API server is presented as sufficient to guarantee resource access and correct synthesis, yet the manuscript provides no concrete details on how the APIs prevent critical errors in code generation for complex meta-optics tasks or on the observed failure modes across trials.
Authors: We will enhance the description of the server design by adding concrete details on the role of each of the 5 APIs in preventing critical errors during code generation. We will also include information on the observed failure modes across trials and how the MCP setup addresses them, thereby demonstrating the framework's reliability for complex tasks. revision: yes
Circularity Check
No circularity: empirical framework evaluation is self-contained against external solver benchmarks
full rationale
The paper describes an MCP-assisted LLM framework for generating inverse-design code for meta-optics tasks and evaluates it empirically on the Huygens meta-atom design problem using the external TorchRDIT differentiable solver. Claims rest on comparisons of natural-language versus structured prompting, reported success rates, and workflow metrics rather than any derivation, fitted parameter, or uniqueness theorem that reduces to the paper's own inputs. No equations, self-definitional loops, or load-bearing self-citations appear in the provided text; the approach is therefore independent of the circularity patterns enumerated in the guidelines.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption LLMs can reliably interpret and apply dynamically provided code templates and documentation to produce correct inverse-design code.
Lean theorems connected to this paper
-
IndisputableMonolith/Cost/FunctionalEquation.leanwashburn_uniqueness_aczel unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
The LLM autonomously accesses these resources to generate complete inverse design codes without prescribed coordination rules. Evaluation on the Huygens meta-atom design task with the differentiable TorchRDIT solver shows that while both natural language and structured prompting strategies achieve high success rates...
-
IndisputableMonolith/Foundation/BranchSelection.leanbranch_selection unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
Our minimalist server design, using only 5 APIs, demonstrates how MCP makes sophisticated computational tools accessible...
What do these tags mean?
- matches
- The paper's claim is directly supported by a theorem in the formal canon.
- supports
- The theorem supports part of the paper's argument, but the paper may add assumptions or extra steps.
- extends
- The paper goes beyond the formal theorem; the theorem is a base layer rather than the whole result.
- uses
- The paper appears to rely on the theorem as machinery.
- contradicts
- The paper's claim conflicts with a theorem or certificate in the canon.
- unclear
- Pith found a possible connection, but the passage is too broad, indirect, or ambiguous to say the theorem truly supports the claim.
Forward citations
Cited by 1 Pith paper
-
A General Differentiable Ray-Wave Framework for Hybrid Refractive-Diffractive System Modeling and Optimization
A plug-and-play differentiable model bridging ray and wave optics for hybrid systems that enables end-to-end optimization of planar and conformal diffractive elements.
Reference graph
Works this paper leans on
-
[1]
A review of metasurfaces: Physics and applications,
H.-T. Chen, A. J. Taylor, and N. Yu, “A review of metasurfaces: Physics and applications,” Rep. Prog. Phys., vol. 79, p. 076401, July 2016
work page 2016
-
[2]
Advances in Meta-Optics and Metasurfaces: Fundamentals and Applications,
K. Ou, H. Wan, G. Wang, J. Zhu, S. Dong, T. He, H. Yang, Z. Wei, Z. Wang, and X. Cheng, “Advances in Meta-Optics and Metasurfaces: Fundamentals and Applications,” Nanomaterials, vol. 13, p. 1235, Jan. 2023
work page 2023
-
[3]
Metasurfaces: Physics and applications in wireless communications,
V . G. Ataloglou, S. Taravati, and G. V . Eleftheriades, “Metasurfaces: Physics and applications in wireless communications,” National Science Review, vol. 10, p. nwad164, Aug. 2023
work page 2023
-
[4]
Inverse design and flexible parameterization of meta-optics using algorithmic differentiation,
S. Colburn and A. Majumdar, “Inverse design and flexible parameterization of meta-optics using algorithmic differentiation,”Commun Phys, vol. 4, p. 65, Mar. 2021
work page 2021
-
[5]
Empowering Metasurfaces with Inverse Design: Principles and Applications,
Z. Li, R. Pestourie, Z. Lin, S. G. Johnson, and F. Capasso, “Empowering Metasurfaces with Inverse Design: Principles and Applications,” ACS Photonics, vol. 9, pp. 2178–2192, July 2022
work page 2022
-
[6]
Merging automatic differentiation and the adjoint method for photonic inverse design,
A. Luce, R. Alaee, F. Knorr, and F. Marquardt, “Merging automatic differentiation and the adjoint method for photonic inverse design,”Mach. Learn.: Sci. Technol., vol. 5, p. 025076, June 2024
work page 2024
-
[7]
A Differentiable Wave Optics Model for End-to-End Computational Imaging System Optimization,
C.-J. Ho, Y . Belhe, S. Rotenberg, R. Ramamoorthi, T.-M. Li, and N. Antipa, “A Differentiable Wave Optics Model for End-to-End Computational Imaging System Optimization,” Dec. 2024
work page 2024
-
[8]
Eigendecomposition-free inverse design of meta-optics devices,
Y . Huang, Z. Zhu, Y . Dong, H. Tang, B. Zheng, V . A. Podolskiy, and H. Zhang, “Eigendecomposition-free inverse design of meta-optics devices,”Opt. Express, vol. 32, pp. 13986–13997, Apr. 2024
work page 2024
-
[9]
Differentiable inverse design of free-form meta-optics using multiplicative filter network,
Y . Huang, Y . Dong, H. Zhao, H. Tang, B. Zheng, and H. Zhang, “Differentiable inverse design of free-form meta-optics using multiplicative filter network,” in2024 International Applied Computational Electromagnetics Society Symposium (ACES), pp. 1–2, IEEE, 2024
work page 2024
-
[10]
A 3D-Printed Millimeter-Wave Free-Form Metasurface Based on Automatic Differentiable Inverse Design,
Y . Huang, H. Tang, H. Zhao, Y . Dong, B. Zheng, and H. Zhang, “A 3D-Printed Millimeter-Wave Free-Form Metasurface Based on Automatic Differentiable Inverse Design,” in2024 IEEE/MTT-S International Microwave Symposium - IMS 2024 , (Washington, DC, USA), pp. 559–562, IEEE, June 2024
work page 2024
-
[11]
Differential Shape Optimization with Image Representation for Photonic Design,
Z. Liu and J. Bonar, “Differential Shape Optimization with Image Representation for Photonic Design,” Dec. 2024
work page 2024
-
[12]
S. Hooten, P. Sun, L. Gantz, M. Fiorentino, R. Beausoleil, and T. Van Vaerenbergh, “Automatic Differentiation Accelerated Shape Optimization Approaches to Photonic Inverse Design in FDFD/FDTD,”Laser & Photonics Reviews, vol. 19, p. 2301199, Jan. 2025. 11
work page 2025
-
[13]
Y . Mahlau, F. Schubert, K. Bethmann, R. Caspary, A. Calà Lesina, M. Munderloh, J. Ostermann, and B. Rosenhahn, “A flexible framework for large-scale FDTD simulations: Open-source inverse design for 3D nanostructures,” in Photonic and Phononic Properties of Engineered Nanostructures XV (A. Adibi, S.-Y . Lin, and A. Scherer, eds.), (San Francisco, United S...
work page 2025
-
[14]
Large Language Models: A Survey,
S. Minaee, T. Mikolov, N. Nikzad, M. Chenaghlu, R. Socher, X. Amatriain, and J. Gao, “Large Language Models: A Survey,” Mar. 2025
work page 2025
-
[15]
H. Zhou, C. Hu, Y . Yuan, Y . Cui, Y . Jin, C. Chen, H. Wu, D. Yuan, L. Jiang, D. Wu, X. Liu, C. Zhang, X. Wang, and J. Liu, “Large Language Model (LLM) for Telecommunications: A Comprehensive Survey on Principles, Key Techniques, and Opportunities,” Sept. 2024
work page 2024
-
[16]
Survey on Large Language Model-Enhanced Reinforcement Learning: Concept, Taxonomy, and Methods,
Y . Cao, H. Zhao, Y . Cheng, T. Shu, Y . Chen, G. Liu, G. Liang, J. Zhao, J. Yan, and Y . Li, “Survey on Large Language Model-Enhanced Reinforcement Learning: Concept, Taxonomy, and Methods,”IEEE Trans. Neural Netw. Learning Syst., vol. 36, pp. 9737–9757, June 2025
work page 2025
-
[17]
OptoGPT: A foundation model for inverse design in optical multilayer thin film structures,
T. Ma, H. Wang, L. J. Guo, Department of Physics, University of Michigan, Ann Arbor, Michigan 48109, USA, and Department of Electrical Engineering and Computer Science, University of Michigan, Ann Arbor, Michigan 48109, USA, “OptoGPT: A foundation model for inverse design in optical multilayer thin film structures,”OEA, vol. 7, no. 7, pp. 240062–240062, 2024
work page 2024
-
[18]
MetasurfaceViT: A generic AI model for metasurface inverse design,
J. Yan, J. Yi, C. Ma, Y . Bao, Q. Chen, and B. Li, “MetasurfaceViT: A generic AI model for metasurface inverse design,” Apr. 2025
work page 2025
-
[19]
Nanophotonic device design based on large language models: Multilayer and metasurface examples,
M. Kim, H. Park, and J. Shin, “Nanophotonic device design based on large language models: Multilayer and metasurface examples,”Nanophotonics, vol. 14, pp. 1273–1282, Apr. 2025
work page 2025
-
[20]
Learning Electromagnetic Metamaterial Physics With ChatGPT,
D. Lu, Y . Deng, J. M. Malof, and W. J. Padilla, “Learning Electromagnetic Metamaterial Physics With ChatGPT,” Feb. 2025
work page 2025
-
[21]
A multi-agentic framework for real-time, autonomous freeform metasurface design,
R. Lupoiu, Y . Shao, T. Dai, C. Mao, K. Edee, and J. A. Fan, “A multi-agentic framework for real-time, autonomous freeform metasurface design,” Mar. 2025
work page 2025
-
[22]
Practical Considerations for Agentic LLM Systems,
C. Sypherd and V . Belle, “Practical Considerations for Agentic LLM Systems,” Dec. 2024
work page 2024
-
[23]
Agentic AI: Autonomous Intelligence for Complex Goals—A Comprehensive Survey,
D. B. Acharya, K. Kuppan, and B. Divya, “Agentic AI: Autonomous Intelligence for Complex Goals—A Comprehensive Survey,”IEEE Access, vol. 13, pp. 18912–18936, 2025
work page 2025
-
[24]
Function calling and other API updates,
OpenAI, “Function calling and other API updates,” June 2023
work page 2023
-
[25]
Y .-C. Chen, P.-C. Hsu, C.-J. Hsu, and D.-s. Shiu, “Enhancing Function-Calling Capabilities in LLMs: Strategies for Prompt Formats, Data Integration, and Multilingual Translation,” Dec. 2024
work page 2024
-
[26]
Machine Learning Driven API Data Standardization,
B. B. Sreeravindra and A. Gupta, “Machine Learning Driven API Data Standardization,”International Journal of Global Innovations and Solutions (IJGIS) , Oct. 2024
work page 2024
-
[27]
Anthropic, “Model Context Protocol.” https://modelcontextprotocol.io/introduction, Nov. 2024
work page 2024
-
[28]
Introducing the Model Context Protocol,
Anthropic, “Introducing the Model Context Protocol,” Nov. 2024
work page 2024
-
[29]
N. Krishnan, “Advancing Multi-Agent Systems Through Model Context Protocol: Architecture, Implementation, and Applications,” Apr. 2025
work page 2025
-
[30]
Unlocking the power of Model Context Protocol (MCP) on AWS
Aditya Addepalli, Elie Schoppik, Jawhny Cooke, Kenton Blacutt, Mani Khanuja, and Nicolai van der Smagt, “Unlocking the power of Model Context Protocol (MCP) on AWS.” https://aws.amazon.com/blogs/machine- learning/unlocking-the-power-of-model-context-protocol-mcp-on-aws/, June 2025
work page 2025
-
[31]
Model Context Protocol (MCP): Landscape, Security Threats, and Future Research Directions,
X. Hou, Y . Zhao, S. Wang, and H. Wang, “Model Context Protocol (MCP): Landscape, Security Threats, and Future Research Directions,” Apr. 2025
work page 2025
-
[32]
A. Singh, A. Ehtesham, S. Kumar, and T. T. Khoei, “A Survey of the Model Context Protocol (MCP): Standardizing Context to Enhance Large Language Models (LLMs),” Apr. 2025
work page 2025
-
[33]
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks,
P. Lewis, E. Perez, A. Piktus, F. Petroni, V . Karpukhin, N. Goyal, H. Küttler, M. Lewis, W.-t. Yih, T. Rocktäschel, S. Riedel, and D. Kiela, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks,” Apr. 2021
work page 2021
- [34]
-
[35]
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models,
J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. Chi, Q. Le, and D. Zhou, “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models,” Jan. 2023. 12 Supplementary Information S1 Complete Content of Structured Prompt P2 <role> You are a TorchRDIT Design Assistant that creates photonic device optimizations for domain experts. Gene...
work page 2023
-
[36]
Use ‘list_templates()‘ if unsure what’s possible
**Clarify Goal**: Identify the user’s objective (e.g., ‘basic_simulation‘, ‘optimization‘, ‘ metasurface‘). Use ‘list_templates()‘ if unsure what’s possible
-
[37]
This is your primary strategy tool
**Propose Workflow**: Use ‘get_workflow_guide(workflow_type=...)‘ to get a structured plan. This is your primary strategy tool
-
[38]
Combine these blocks to build the full script
**Assemble Code**: Sequentially call ‘get_template()‘ for each template listed in the workflow guide. Combine these blocks to build the full script
-
[39]
**Verify APIs (If Necessary)**: If you encounter an unfamiliar API or need more detail than the templates provide, use the Context7 tools. First, call ‘resolve_library_id()‘ to find the library, then use ‘get_library_docs()‘ to retrieve specific documentation
-
[40]
**Incorporate Best Practices**: For optimization tasks, call ‘get_optimization_tips()‘ and apply relevant advice (e.g., gradient clipping, parameter clamping)
-
[41]
**Validate and Refine**: - Use ‘validate_layer_setup()‘ on the generated layer code to catch common API mistakes. - Refer to clarification templates (‘layer_order‘, ‘material_api‘, ‘common_mistakes‘) to ensure correctness
-
[42]
**Deliver and Explain**: Present the complete script, explaining the design choices and how to run it. If optimization is involved, explain the strategy. </workflow> <optimization_strategy> **MANDATORY: Two-stage global optimization (when applicable)** This is critical for avoiding local minima in complex photonic design spaces. **Stage 1 - Parameter Expl...
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.