Table of Contents
Fetching ...

From Prompt to Protocol: Fast Charging Batteries with Large Language Models

Ge Lei, Ferran Brosa Planella, Sterling G. Baird, Samuel J. Cooper

TL;DR

This work tackles the challenge of slow, costly, and non-differentiable battery charging evaluations by introducing two gradient-free, LLM-driven closed-loop frameworks, P2O and P2P, that broaden the space of exploitable charging protocols. P2O uses an outer LLM-driven evolution of small neural-network architectures paired with an inner SAASBO optimizer, while P2P directly generates explicit protocols in a single loop. Across three case studies, both approaches outperform traditional baselines, achieving approximately a $4.2\%$ improvement in final SOH over a state-of-the-art baseline, with P2P delivering strong results under the same trial budgets and P2O excelling with additional outer-loop refinement. The results demonstrate that LLMs can encode language-based constraints, expand functional forms beyond hand-crafted templates, and enable efficient optimization in high-cost experimental settings, with broad implications for accelerated discovery in battery design and potentially other slow-domain optimization tasks.

Abstract

Efficiently optimizing battery charging protocols is challenging because each evaluation is slow, costly, and non-differentiable. Many existing approaches address this difficulty by heavily constraining the protocol search space, which limits the diversity of protocols that can be explored, preventing the discovery of higher-performing solutions. We introduce two gradient-free, LLM-driven closed-loop methods: Prompt-to-Optimizer (P2O), which uses an LLM to propose the code for small neural-network-based protocols, which are then trained by an inner loop, and Prompt-to-Protocol (P2P), which simply writes an explicit function for the current and its scalar parameters. Across our case studies, LLM-guided P2O outperforms neural networks designed by Bayesian optimization, evolutionary algorithms, and random search. In a realistic fast charging scenario, both P2O and P2P yield around a 4.2 percent improvement in state of health (capacity retention based health metric under fast charging cycling) over a state-of-the-art multi-step constant current (CC) baseline, with P2P achieving this under matched evaluation budgets (same number of protocol evaluations). These results demonstrate that LLMs can expand the space of protocol functional forms, incorporate language-based constraints, and enable efficient optimization in high cost experimental settings.

From Prompt to Protocol: Fast Charging Batteries with Large Language Models

TL;DR

This work tackles the challenge of slow, costly, and non-differentiable battery charging evaluations by introducing two gradient-free, LLM-driven closed-loop frameworks, P2O and P2P, that broaden the space of exploitable charging protocols. P2O uses an outer LLM-driven evolution of small neural-network architectures paired with an inner SAASBO optimizer, while P2P directly generates explicit protocols in a single loop. Across three case studies, both approaches outperform traditional baselines, achieving approximately a improvement in final SOH over a state-of-the-art baseline, with P2P delivering strong results under the same trial budgets and P2O excelling with additional outer-loop refinement. The results demonstrate that LLMs can encode language-based constraints, expand functional forms beyond hand-crafted templates, and enable efficient optimization in high-cost experimental settings, with broad implications for accelerated discovery in battery design and potentially other slow-domain optimization tasks.

Abstract

Efficiently optimizing battery charging protocols is challenging because each evaluation is slow, costly, and non-differentiable. Many existing approaches address this difficulty by heavily constraining the protocol search space, which limits the diversity of protocols that can be explored, preventing the discovery of higher-performing solutions. We introduce two gradient-free, LLM-driven closed-loop methods: Prompt-to-Optimizer (P2O), which uses an LLM to propose the code for small neural-network-based protocols, which are then trained by an inner loop, and Prompt-to-Protocol (P2P), which simply writes an explicit function for the current and its scalar parameters. Across our case studies, LLM-guided P2O outperforms neural networks designed by Bayesian optimization, evolutionary algorithms, and random search. In a realistic fast charging scenario, both P2O and P2P yield around a 4.2 percent improvement in state of health (capacity retention based health metric under fast charging cycling) over a state-of-the-art multi-step constant current (CC) baseline, with P2P achieving this under matched evaluation budgets (same number of protocol evaluations). These results demonstrate that LLMs can expand the space of protocol functional forms, incorporate language-based constraints, and enable efficient optimization in high cost experimental settings.
Paper Structure (32 sections, 8 equations, 8 figures, 1 table, 4 algorithms)

This paper contains 32 sections, 8 equations, 8 figures, 1 table, 4 algorithms.

Figures (8)

  • Figure 1: Overview of the proposed LLM-driven optimization frameworks. (a) P2O (two loops): LLM-guided neural network generation and refinement with a SAASBO-based inner optimization loop. (b) P2P (single loop): Direct LLM generation of explicit charging protocols without inner-loop optimization.
  • Figure 2: Optimization results for P2O (two loops) and P2P (single loop) across two tasks. (a–c) Complex predefined protocol; (d–f) constant-heating protocol. (a, d) show P2P performance, where LLM directly generates explicit charging functions. (b, e) compare P2O variants using different outer-loop mechanisms—LLM-guided, BO, GA, and Random Sampling; each curve shows the cumulative best loss over iterations, where the solid line denotes the mean across 10 runs and the shaded area marks the range between the minimum and maximum best losses; the LLM-guided approach converges fastest and achieves the lowest loss (dashed lines mark best P2P results). (c, f) display predicted current and heat generation profiles of the best-performing protocols.
  • Figure 3: Optimization under a gradient-free setting. (a) Best final loss across ten runs of SAASBO and Random Search (inner-loop optimizers of P2O) and the LLM-based P2P method (single-loop). (b) Convergence of the best-so-far loss over battery-simulation trials for all three approaches. (c) Verification of the optimized charging protocol obtained from SAASBO.
  • Figure 4: Best loss comparison under controlled computational budgets. The multi-step CC baseline (CCCV) and P2P method were evaluated over 10 independent runs, each limited to 210 optimization attempts to match the inner-loop budget of the P2O method. The left panel shows the variance in best loss for 10 CCCV runs, 10 P2P runs, and P2O initialization (10 nn structures). The right panel demonstrates the iterative improvement of P2O over 10 outer-loop iterations (with 210 inner SAASBO evaluations per iteration). Note that P2P performs only algorithmic iterations without an inner-loop parameter optimization, whereas CCCV involves only parameter optimization without an outer-loop iterative process; therefore, only P2O exhibits a full iterative trajectory in the right panel.
  • Figure 5: Comparison of LLM-generated charging protocols with conventional baselines. (a) Charging-phase schematic: the LLM generates a variable-current profile until the cut-off voltage, followed (if needed) by a constrained CC phase to reach the target SOC within the time limit. (b--e) Full charge--discharge trajectories; the yellow region marks the charging phase (LLM segment + constrained CC). (b) Best P2O protocol across cycles, showing earlier voltage-limit entry with degradation. (c) P2O, (d) P2P, and (e) CCCV: best result with representative best, worst, and intermediate trajectories.
  • ...and 3 more figures