Table of Contents
Fetching ...

Using Large Language Models for Parametric Shape Optimization

Xinxin Zhang, Zhuoqun Xu, Guangpu Zhu, Chien Ming Jonathan Tay, Yongdong Cui, Boo Cheong Khoo, Lailai Zhu

TL;DR

This work addresses parametric shape optimization by replacing traditional optimization operators with a large language model that guides an evolutionary-search process. The LLM-PSO framework evolves a population of designs via a Gaussian search, using a curated record buffer and few-shot prompts to obtain a mean design $ar{oldsymbol{x}}_{ ext{LLM}}$ for the next generation, with all inputs appropriately discretized to integers and a deterministic output. Across two fluid-dynamics problems—the 2D airfoil in laminar flow at $ ext{Re}=100$ and a 3D axisymmetric body in Stokes flow—the approach identifies shapes that agree with benchmark solutions and often converges faster than GA or RL baselines, though higher DOFs pose challenges. The results suggest that LLMs can function as autonomous decision-makers in engineering design, opening pathways for higher-DOF optimization, LLM fine-tuning, and hybrid strategies that combine generative AI with established optimization methods.

Abstract

Recent advanced large language models (LLMs) have showcased their emergent capability of in-context learning, facilitating intelligent decision-making through natural language prompts without retraining. This new machine learning paradigm has shown promise in various fields, including general control and optimization problems. Inspired by these advancements, we explore the potential of LLMs for a specific and essential engineering task: parametric shape optimization (PSO). We develop an optimization framework, LLM-PSO, that leverages an LLM to determine the optimal shape of parameterized engineering designs in the spirit of evolutionary strategies. Utilizing the ``Claude 3.5 Sonnet'' LLM, we evaluate LLM-PSO on two benchmark flow optimization problems, specifically aiming to identify drag-minimizing profiles for 1) a two-dimensional airfoil in laminar flow, and 2) a three-dimensional axisymmetric body in Stokes flow. In both cases, LLM-PSO successfully identifies optimal shapes in agreement with benchmark solutions. Besides, it generally converges faster than other classical optimization algorithms. Our preliminary exploration may inspire further investigations into harnessing LLMs for shape optimization and engineering design more broadly.

Using Large Language Models for Parametric Shape Optimization

TL;DR

This work addresses parametric shape optimization by replacing traditional optimization operators with a large language model that guides an evolutionary-search process. The LLM-PSO framework evolves a population of designs via a Gaussian search, using a curated record buffer and few-shot prompts to obtain a mean design for the next generation, with all inputs appropriately discretized to integers and a deterministic output. Across two fluid-dynamics problems—the 2D airfoil in laminar flow at and a 3D axisymmetric body in Stokes flow—the approach identifies shapes that agree with benchmark solutions and often converges faster than GA or RL baselines, though higher DOFs pose challenges. The results suggest that LLMs can function as autonomous decision-makers in engineering design, opening pathways for higher-DOF optimization, LLM fine-tuning, and hybrid strategies that combine generative AI with established optimization methods.

Abstract

Recent advanced large language models (LLMs) have showcased their emergent capability of in-context learning, facilitating intelligent decision-making through natural language prompts without retraining. This new machine learning paradigm has shown promise in various fields, including general control and optimization problems. Inspired by these advancements, we explore the potential of LLMs for a specific and essential engineering task: parametric shape optimization (PSO). We develop an optimization framework, LLM-PSO, that leverages an LLM to determine the optimal shape of parameterized engineering designs in the spirit of evolutionary strategies. Utilizing the ``Claude 3.5 Sonnet'' LLM, we evaluate LLM-PSO on two benchmark flow optimization problems, specifically aiming to identify drag-minimizing profiles for 1) a two-dimensional airfoil in laminar flow, and 2) a three-dimensional axisymmetric body in Stokes flow. In both cases, LLM-PSO successfully identifies optimal shapes in agreement with benchmark solutions. Besides, it generally converges faster than other classical optimization algorithms. Our preliminary exploration may inspire further investigations into harnessing LLMs for shape optimization and engineering design more broadly.

Paper Structure

This paper contains 21 sections, 9 equations, 6 figures.

Figures (6)

  • Figure 1: Overview of LLM-PSO and its application to two PSO problems involving fluid dynamics.
  • Figure 2: A specific example prompt of LLM-PSO.
  • Figure 3: (a) Geometric parametrization of an airfoil profile by a four-point Bézier curve. (b) Optimal airfoils based on different number $n_{\text{F}} \in [1,4]$ of free points. (c) Comparison of the optimization trajectories: the lift-drag ratio versus iteration number $\mathcal{R}(n)$, between LLM-PSO and an RL algorithm viquerat2021direct.
  • Figure 4: (a) Parametrization of the 2D profile of an axisymmetric body using Legendre polynomials. The normalized drag $D_r$ averaged over five LLM-PSO-based optimizations versus the number $K$ of DOFs, when the (b) surface area or (c) volume of the body is fixed. The results are compared to theoretical solutions. (d) LLM-obtained optimal profiles (solid curve) in comparison to theoretical counterparts (symbol).
  • Figure 5: Comparison of the performance of LLM-PSO and GA based on their optimization trajectories: the normalized drag versus iteration number $D_r(n)$, represented by mean values and min-max ranges from five runs. The left and right columns present results for area-fixed and volume-fixed settings, respectively, while the top and bottom rows correspond to $K=2$ and $K=5$ degrees of freedom, respectively. To ensure a fair comparison, we adopt the same population size $N$ for LLM-PSO and GA.
  • ...and 1 more figures