TL;DR
This paper demonstrates how Large Language Models (LLMs) can automatically discover and optimize high-performance continuous optimization algorithms for designing complex photonic structures. By enhancing the LLaMEA framework with domain-specific prompts and population-based evolutionary strategies, the authors generated algorithms that match or outperform established human-designed heuristics like Differential Evolution on real-world optical design problems.
What Problem Does This Paper Address?
Designing photonic structures—such as Bragg mirrors, solar cell coatings, and ellipsometry analysis tools—requires optimizing multi-layered materials to achieve specific optical properties. These optimization landscapes are notoriously difficult: they are continuous, high-dimensional, non-linear, and riddled with local minima due to wave interference effects.
While automated algorithm discovery using LLMs (like the LLaMEA framework) has emerged as a way to generate optimization code without human intervention, previous attempts suffered from two major flaws:
- Generic Prompts: They lacked domain-specific physics guidance, leading to suboptimal algorithm designs.
- Limited Exploration: They relied on simple (1,1) or (1+1) evolutionary strategies, missing out on the benefits of population-based exploration.
This paper addresses these gaps by introducing structured, physics-informed prompting and exploring diverse evolutionary strategies to balance exploration and exploitation.
Methods
The authors built upon the LLaMEA (Large Language Model Evolutionary Algorithm) framework, which uses an LLM in an iterative, self-debugging loop to write and refine optimization code. They introduced two major innovations:
- Enhanced Task Prompt Design: Instead of generic instructions, they used
gpt-4oto generate structured Problem Descriptions (e.g., layer thickness and permittivity constraints) and Algorithmic Insights (e.g., "encourage periodicity in solutions" or "use hybrid global-local search methods"). - Evolutionary Strategy (ES) Exploration: They expanded LLaMEA's internal selection mechanism beyond simple (1+1) strategies to population-based configurations, including comma strategies—(1,5), (2,10)—and plus strategies—(1+5), (2+10), (5+5).
The framework evaluates the generated algorithms on small-scale problems, using the Area Over the Convergence Curve (AOCC) and final fitness values as feedback to prompt the LLM for code mutations and refinements.
Datasets
The experiments were executed using the PyMoosh (Python-based Multilayer Optics Optimization and Simulation Hub) toolkit, integrated into the IOHexperimenter benchmarking platform. The algorithms were discovered on small-scale instances and benchmarked on larger scales across three real-world problems:
- Bragg Mirror: Discovered on mini-Bragg (10 layers); benchmarked on Bragg (20 layers).
- Ellipsometry Inverse Problem: Evaluated on a 1-layer gold substrate problem to retrieve thickness and permittivity.
- Photovoltaic Problem (Solar Cell Antireflection): Discovered on photovoltaic (10 layers); benchmarked on big-photovoltaic (20 layers) and huge-photovoltaic (32 layers).
Key Insights and Ideas
- Physics Insights Boost Performance (Mostly): For the Bragg mirror and ellipsometry problems, adding domain-specific insights (like guiding the model to look for periodic structures) significantly improved the quality of the generated algorithms, yielding a 10% boost in AOCC.
- Too Much Detail Can Backfire: Surprisingly, for the photovoltaic problem, generic prompts outperformed the physics-informed ones. The authors suggest that for highly noisy fitness landscapes, overly detailed prompts might restrict the LLM's creativity and cause it to limit exploration prematurely.
- Small-Scale Discovery Generalizes Well: Algorithms discovered on small, computationally cheap problem instances (10 layers) maintained their strong performance and rapid convergence when scaled up to complex, higher-dimensional problems (32 layers).
- Population Diversity Matters: Transitioning to population-based strategies like (5+5) allowed the framework to better maintain diversity, helping it navigate the complex wave-interference landscapes inherent to optical physics.
Key Results
- Superior Convergence Speed: On the Bragg mirror and ellipsometry tasks, the LLM-discovered algorithms demonstrated a significantly faster convergence trend in the initial stages compared to standard baselines like CMA-ES and standard Differential Evolution (DE).
- High Stability: For the Bragg mirror, the fitness distribution of the LLM-generated algorithms across multiple runs was exceptionally tight, proving that the discovered code is highly reliable and stable.
- Human-Level Performance: The automatically discovered algorithms successfully matched or outperformed advanced, human-designed optimization variants, such as Quasi-Oppositional Differential Evolution (QODE).
Limitations and Future Work
- Prompt Sensitivity: The unexpected drop in performance on the photovoltaic problem highlights that prompt engineering is highly sensitive to the specific landscape of a problem.
- Hyperparameter Tuning: While the LLM is excellent at structuring the logic of an algorithm, fine-tuning its internal parameters still requires manual effort or separate optimization loops (e.g., LLaMEA-HPO).
- Dimensionality Limits: This study focused entirely on 1D multilayered structures. Extending this framework to 2D or 3D nanophotonic structures, such as metasurfaces or photonic crystals, remains an open challenge for future research.
Summary updated