LLM-Assisted Optimization for Simulation-Based Redesign
Authors: Chan-Eui Song, Jeremy J. Michalek, Christopher McComb
Organizations: Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, Pennsylvania, USA · Department of Mechanical Engineering, Department of Engineering and Public Policy, Dept. of Civil & Environmental Engineering, Carnegie Mellon University, Pittsburgh, Pennsylvania, USA
Engineering design frequently involves redesigning a prior solution to adapt to changes in context, such as material prices or system requirements. Redesign often leverages simulators too complex and/or computationally intensive for traditional numerical solvers, which lack engineering knowledge and context, to ensure global solution quality. Large language models (LLMs) can interpret semantic information, including engineering knowledge about the system and changes in context, to help guide search, and recent studies have shown that incorporating this knowledge into optimization can improve search performance. However, how best to combine LLMs with numerical solvers in redesign remains unclear. We develop and test an integrated LLM-optimization approach for redesign and compare three methods for leveraging LLMs (warm start, variable fixing and ReAct) and four black-box solvers (Bayesian optimization, genetic algorithms, mesh adaptive direct search and random search) on an electric vehicle battery pack cost minimization case study across four types of redesign scenarios. We find that the integrated approach can match feasible design discovery of the numerical-solver baselines with 80% fewer simulator evaluations while tripling the fraction of runs that find near-optimal solutions. We find that the best LLM-solver integration approach and the way the prior solution is leveraged depend on the structure of the design requirement change, and that the benefit of increasing LLM model size grows with the extent to which the LLM controls the search. These results show clear potential for LLMs in redesign tasks for guiding or replacing numerical solvers.
Figures & tables
Figure 1: Overview of the redesign experiments. Each run combines one redesign scenario (S1 to S4), one semantic-information level (L1 or L2), one model size (4B, 9B, or 27B), one redesign method, and one numerical optimizer where applicable (Bayesian optimization, genetic algorithm, MADS, or random search). The three panels outlined in green contain these experimental factors. The gray panels contain the design problem and the BatPaC simulator, which every run shares. The arrows show the information passed between components. Group 1 contains the two conventional baselines (the cold start and the reference-warm start), and group 2 contains the three WAFER methods. The three method boxes are filled with the colors used for these methods in all later figures: green for variable fixing, red for warm starting, and blue for ReAct.
Figure 2: Battery-pack design hierarchy in BatPaC and the optimization variables. The cathode chemistry xC and the positive-electrode thickness xT are defined at the cell level, xS gives the number of cells per module, xM the number of modules per row, and xR the number of module rows.
Var
Description
Type
Domain
xC
Cathode chemistry
categorical
{LFP,NMC811}
xT
Thickness (LFP)
continuous
[50,165]\penaltyμm
(NMC811)
[50,155]\penaltyμm
xS
Cells per module
integer
[1,30]
xM
Modules per row
integer
[1,50]
xR
Rows per pack
integer
[1,4]
Table 1: Battery-pack design variables used in the redesign study
Scenario
Changed quantity
Reference → Redesign
S1
NMC811 CAM cost
19.63 → 25.75 USD/kg
S2
Maximum pack width
1500 → 1100 mm
S3
Recharge time
60 → 30 min
S4
Required pack energy
84 → 130 kWh
Maximum pack length
2200 → 2700 mm
Maximum pack width
1500 → 1650 mm
Table 2: Reference-to-redesign changes for the four redesign scenarios
Figure 3: Cumulative feasible discovery over 20 accepted simulator evaluations. Curves show the median across configurations of the fraction of each configuration’s 50 runs that have found a feasible design, and shaded bands show the interquartile range across configurations. RW denotes the reference-warm baseline.
Figure 4: Cumulative attainment of an optimality gap of 2% or less over 20 accepted simulator evaluations. The fraction is computed over all runs. The best-known is the best feasible cost observed for each redesign problem. Curves and bands are defined as in Fig. 3 .
Sc.
xC
xT ( μ m)
xS
xM
xR
Cost (USD/kWh)
Reference
NMC811
155
29
2
4
96.5
S1
LFP
165
28
3
3
97.1
S2
NMC811
155
26
3
3
97.4
S3
NMC811
96.7
29
2
4
100
S4
LFP
165
28
3
4
90.3
Table 3: Best feasible design found in each redesign problem, against the common reference design. The cost of each redesign row is the best-known cost used for the optimality gap.
VF
WS
ReAct
Sc.
Disc.
Gap
Disc.
Gap
Disc.
Gap
S1
0/24
0/6
0/0
0/0
0/0
7 /2
S2
0/5
0/4
1 /0
1 /0
8 /2
8 /4
S3
17 /0
24 /0
18 /0
7 /0
17 /1
20 /0
S4
0/14
0/6
11 /0
14 /0
10 /0
20 /1
Table 4: Optimizer-matched comparisons with the reference-warm baseline at the end of the budget. Each entry is the number of comparisons in which the method is significantly better than RW, followed by the number in which it is significantly worse, under the Holm-adjusted two-sided Fisher exact test at α=0.05 . Each VF or WS configuration is compared with the RW configuration that uses the same downstream optimizer, and each of the six ReAct configurations is compared with all four RW configurations, which gives 24 comparisons per entry. Disc. is feasible discovery and Gap is attainment of an optimality gap of 2% or less. Bold marks a nonzero count of significantly better comparisons.
Figure 5: Feasible discovery and the gap of the median final feasible cost to the best-known cost across configurations. The gap is measured against the best-known cost of each scenario in Table 3 . Faded points show individual 50-run configurations. Large markers show strategy medians and whiskers show interquartile ranges. Lower-right values designate better optimization performance. The inset enlarges the boxed region in (a). The dashed line in (a) indicates the cost of the reference design. Best outcomes have a low cost gap (down) and high feasible discovery rates (right).
Figure 6: Variable-fixing masks selected in S1 and S3. Bars show feasible discovery and near-best attainment among the runs selecting each mask, and whiskers show 95% Wilson intervals. Masks are ordered by the number of released variables, and masks selected in fewer than 20 runs are omitted. R and F denote released and fixed variables in the order (xC,xT,xS,xM,xR) .
Figure 7: Near-best attainment of warm-start runs versus the number of the three proposed starting points that BatPaC evaluates as feasible. Whiskers show 95% Wilson intervals, and hollow markers indicate fewer than 10 runs.
Figure 8: Optimization after the first feasible design. (a) Near-best attainment for each configuration. Plus markers show ReAct configurations by model size, and circles show VF, WS, and numerical configurations. (b)–(e) Fraction of feasible runs reaching an optimality gap of 2% or less versus accepted evaluations after first feasibility. Curves are shown only while at least 20 runs contribute. In (b) to (e), ReAct curves are labeled by model size and the other curves by method, and (a) uses the same colors.
Figure 9: ReAct reasoning before and after feasibility. Bars show the fraction of accepted steps whose reasoning mentions each category, by model size, and arrows run from the value before first feasibility to the value after it.
Figure 10: Feasible discovery (a)–(d) and near-best attainment (e)–(h) against model size. Points are medians across the configurations that share a model size and whiskers span their interquartile range.
Figure 11: Variable-fixing masks selected in S3 by model size. Bars show the number of runs selecting each mask. R and F denote released and fixed variables in the order (xC,xT,xS,xM,xR) .
Tokens/run
Time/run (s)
Strategy
4B
9B
27B
4B
9B
27B
VF
6,145
6,140
5,750
17
18
37
WS
12,935
13,988
14,480
60
86
413
ReAct
775,090
459,364
254,678
474
438
592
Table 5: Median inference cost by strategy and model size
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Variable
Search range or values
Spacing
xC
LFP, NMC811
categorical
xT (NMC811)
{100,120,140,150,155}μ m
nonuniform
xT (LFP)
{100,120,140,150,160,165}μ m
nonuniform
xS
14 – 30
1
xM
2 – 4
1
xR
2 – 6
1
Appendix
Table 6: Preliminary grid used to select the common reference design
Sc.
Feasible
Shared by every feasible grid design
S2
55
xR=3 and xM≥3
S3
36
xT=100\penaltyμ m, the lowest thickness in the grid
S4
481
xM≥3
Appendix
Table 7: Feasible designs on the preliminary grid of Appendix A . S1 is omitted because its reference design remains feasible.
Discovery (%)
Gap ≤2% (%)
1st feas.
Strategy
Sc.
L1
L2
L1
L2
L1
L2
VF
S1
61
63
0
0
2
2
S2
11
12
6
5
13
13
S3
72
71
54
51
3
3
S4
28
27
2
1
10
10
WS
S1
99
99
10
12
1
1
Appendix
Table 8: Effect of the supplied engineering information. (a) Optimization outcomes under L1 and L2. (b) Redesign decisions under L1 and L2, pooled over scenarios.
Figure 12: Feasible fraction of the accepted evaluations in each (xR,xM) cell inside the VF subspace selected most often in S2 (FFFRR) and S4 (FRRRR) among the masks that fix at least one variable. The gold outline marks the reference design.
S2
S4
Mask
n
Disc. (%)
Gap ≤2% (%)
Mask
n
Disc. (%)
Gap ≤2% (%)
RRRRR
359
9
1
RRRRR
536
36
0
FRRRR
123
11
0
FRRRR
193
41
0
FRFRR
109
15
8
RRRFF
175
0
0
FFRRR
67
33
7
FFRRR
73
53
10
RRRFF
67
0
0
RRFFF
72
0
0
Appendix
Table 9: Supplementary results for variable fixing, warm starting, and ReAct. (a) Feasible discovery and near-best attainment of variable fixing by mask in S2 and S4, in the format of Fig. 6 . (b) Feasible discovery of variable fixing by downstream optimizer among the runs that selected FFFRR in S2 and FRRRR in S4, with 46 to 62 runs per optimizer. (c) Warm-start performance with and without the reference design among the starting points. (d) Conversion to a near-best design after the first feasible design in S2 to S4, for 27B ReAct and for the VF and WS configurations with the highest conversion among their feasible runs. nf is the number of runs that reached feasibility and Conv. is the percentage of those runs that also reached an optimality gap of 2% or less. The next column gives, among the runs with at least ten accepted evaluations remaining, the percentage that reach an optimality gap of 2% or less within ten evaluations after the first feasible design. no is the number of runs that were feasible but not yet within 2% at the first feasible design, and the last column is the percentage of those runs that reached 2% later. The scripts in the code repository reproduce these rates for every configuration.
Table 10: Coding rules for the seven reasoning categories. Terms are matched without regard to case, sentences are split at a period, question mark, exclamation mark, or semicolon, and ∃s means that one sentence of the rationale satisfies the condition. a→nb means that a term of b follows a term of a within n characters. The term sets are listed below the rules.
S1
S2
S3
S4
Method
Size
Level
Optimizer
Disc.
Gap
Disc.
Gap
Disc.
Gap
Disc.
Gap
Cold
BO
58
0
16
2
34
0
58
2
GA
26
2
6
0
10
0
24
0
MADS
28
0
8
2
18
2
32
2
Random
12
2
4
0
4
0
34
0
RW
BO
100
0
26
10
44
0
68
14
Appendix
Table 11: Feasible discovery and near-best attainment of every configuration. Each entry is the percentage of the 50 runs of a configuration, counting runs that ended without a usable decision as failures. Gap is attainment of an optimality gap of 2% or less relative to the best-known cost of Table 3 . Shaded cells are significantly better than the reference-warm baseline under the test of Table 4 .