Source-linked AI summary

LLMDE: A Large Language Model-Driven Differential Evolution Algorithm for Portfolio Optimization

Rong Chai, Vaclav Snasel, Xiaopeng Wang, Seyedali Mirjalili, Crina Grosan

arXiv:2609.16846v1cs.NE

TL;DR

The paper addresses the reliance of Differential Evolution on handcrafted search-control rules for complex optimization. It proposes LLMDE, which uses prompt-guided, feedback-driven LLM recommendations for mutation strategies and parameters, and reports strong performance on CEC2022 and CVaR portfolio optimization. Computational overhead and API latency remain practical limitations.

  • Problem

    DE performance is sensitive to manually designed mutation and parameter rules, while real-time LLM guidance for evolutionary search and complex CVaR optimization remains limited.

  • Method

    LLMDE embeds an LLM in DE to dynamically select mutation strategies and configure control parameters from real-time optimization feedback.

  • Results

    LLMDE demonstrates superior optimization performance on the CEC2022 benchmark and CVaR portfolio optimization task.

  • Takeaways & Limitations

    The results support embedding LLMs within metaheuristics as a route toward LLM-assisted adaptive optimization techniques.

  • Takeaways & Limitations

    Substantial computational overhead and API latency may restrict LLMDE’s practical adoption in time-sensitive or resource-constrained settings.

Abstract

from arXiv · show

This study proposes a Large Language Model-Driven Differential Evolution (LLMDE) algorithm to reduce the reliance on handcrafted hyperparameter design. The proposed algorithm leverages a prompt engineering strategy, allowing large language models (LLMs) to dynamically select mutation strategies and configure control parameters guided by optimization feedback, thus enhancing the performance of the DE algorithm. We evaluate the performance of LLMDE on the CEC2022 benchmark suite, comparing it with standard DE and representative metaheuristics. Furthermore, we employ factor analysis and K-means clustering for stock selection, and then apply LLMDE to solve the Conditional Value at Risk (CVaR) portfolio optimization problem using the selected stocks, subject to budget and minimum expected return constraints. Experimental results demonstrate that LLMDE achieves competitive performance on the benchmark suite while continuously generating high-quality solutions for complex constrained optimization tasks. These outcomes successfully demonstrate the viability of embedding LLMs within metaheuristics, paving a promising path toward the design of advanced LLM-assisted optimization techniques.

1. Introduction

The paper motivates LLMDE by the difficulty of CVaR portfolio optimization and the sensitivity of DE to handcrafted strategy and parameter choices. It proposes using real-time optimization feedback to let an LLM adapt DE search control, then evaluates the approach on benchmark and portfolio tasks.

  • Variance-based portfolio models may misrepresent downside risk because financial returns exhibit skewness, kurtosis, and heavy tails.
  • CVaR portfolio optimization becomes NP-hard as realistic cardinality, budget, and minimum-return constraints are added, especially with many assets.
  • DE performance depends strongly on mutation strategies and control parameters, whose poor settings can cause premature convergence, diversity loss, and inferior solutions.
  • Existing LLM optimization studies largely emphasize code generation and offline heuristic synthesis, while real-time evolutionary guidance and CVaR applications remain scarce.
  • LLMDE integrates an LLM into DE to adaptively control evolutionary search and dynamically configure mutation strategies and parameters.
  • Experiments on CEC2022 and a real-world CVaR portfolio task validate LLMDE’s capability for complex optimization problems.

2. Preliminaries

This section introduces Differential Evolution as the gradient-free optimizer and formulates the CVaR portfolio objective. It also describes penalty-based handling of return and budget constraints and gives DE’s computational complexity.

  • 2.1. Differential Evolution: DE iteratively refines a population through initialization, mutation, crossover, and greedy selection for nonlinear and rugged optimization landscapes.
  • 2.1. Differential Evolution: Mutation constructs donor vectors from weighted population differences, while the binomial crossover rate CR controls recombination with a forced mutant component.
  • 2.2. Computational Complexity of DE: DE’s effectiveness can deteriorate when configuration choices cause diversity loss, stagnation, slow convergence, or trapping in local optima.
  • 2.2. Computational Complexity of DE: DE has per-generation time complexity O(N · D), total complexity O(T · N · (D + feval)), and memory complexity O(N · D).
  • 2.3. CVaR Portfolio Optimization Model: CVaR measures the average portfolio loss exceeding the VaR threshold at confidence level α, thereby targeting tail losses.
  • 2.3. CVaR Portfolio Optimization Model: An exterior penalty function embeds minimum-return and budget violations into one objective, allowing metaheuristics to evaluate feasible and infeasible solutions together.

3. The Proposed LLMDE Algorithm

LLMDE couples a DE engine with an LLM strategy-scheduling module in a closed feedback loop. The LLM reads population-state indicators and periodically recommends mutation operators and control parameters that steer subsequent evolution.

  • 3.1. The LLMDE Framework: LLMDE combines DE operations with an LLM-driven scheduling module that exchanges population and performance information through closed-loop feedback.
  • 3.1. The LLMDE Framework: The LLM receives progress, stagnation, diversity, and fitness statistics, then recommends mutation strategies with scaling factor F and crossover rate CR.
  • 3.1. The LLMDE Framework: Greedy selection updates the population, whose new state is returned to the LLM for real-time adjustment until termination produces the best solution found.
  • 3.1. The LLMDE Framework: Continuous inter-module feedback dynamically regulates transitions between exploration and exploitation, supporting global optimization capability and environmental adaptability.
  • 3.2. LLM Prompt Engineering Design: LLMDE invokes the language model every ΔTLLM generations and randomly sets the number of prescribed parameter groups as K = ⌈r · |A|⌉.
  • 3.2. LLM Prompt Engineering Design: The prompt encodes swarm status and restricts choices to standard DE operators, defining a structured and valid decision space for strategy generation.

4. Experiments

The experiments evaluate LLMDE on CEC2022 under controlled settings, then examine LLM choice, invocation frequency, mechanism ablations, and mutation-strategy comparisons. LLMDE achieves the strongest overall benchmark performance, with results supporting adaptive, feedback-guided strategy selection.

  • 4. Experiments: The benchmark protocol uses CEC2022 at D = 20 with N = 100, MaxFEs = 1000×D, 30 independent runs, and five fixed-parameter DE baselines.Baseline variants use F = 0.5 and CR = 0.5, enabling controlled comparison across mutation strategies.
  • 4.2. LLM Model Selection: DeepSeek-V4-Flash achieves superior accuracy across most benchmark functions, ranks first in the Friedman test, and is selected as the default LLM.The comparison uses mean fitness values and statistical significance indicators across candidate models.
  • 4.3. Sensitivity Analysis of ΔTLLM: An invocation interval of ΔTLLM = 5 yields the strongest mean quality, lower variance across most functions, and the top overall rank.The experiments compare intervals of 5, 10, and 20 generations while holding other parameters constant.
  • 4.4. Ablation Study: The ablation study reports LLMDE as the best-ranked configuration, with win/tie/loss records of 4/8/0 against LLMDE rOC and 4/7/1 against DE Srand.LLMDE uses population-state feedback for adaptive strategy selection; LLMDE rOC removes that context, whereas DE Srand switches randomly without LLM involvement.
  • 4.4. Ablation Study: The ablation results attribute performance gains to population-state feedback and LLM-guided adaptation rather than merely alternating strategies.The comparisons against LLMDE rOC and DE Srand are used to isolate these components.
  • 4.5. Comparison with Different DE Mutation Strategies: LLMDE ranks first overall across CEC2022, with win/tie/loss counts of 12/0/0, 10/2/0, 3/6/3, 8/4/0, and 4/4/4 against DE S0–S4.DE S2 ranks second overall, while DE S4 performs well on selected landscapes but degrades on more complex multimodal functions.

5. Application

The application builds a diversified stock basket through factor analysis and K-means clustering, then evaluates LLMDE for constrained CVaR portfolio optimization across confidence levels. LLMDE achieves the most competitive overall portfolio performance, attaining the minimum CVaR at three of four levels and adapting portfolio weights as risk preferences change.

  • Sample Selection and Factor Analysis: Factor analysis extracted four common factors explaining 76.7% of cumulative variance after KMO and Bartlett tests confirmed factorability.Varimax rotation was used to obtain more distinct and economically interpretable loadings.
  • Portfolio Optimization: The CVaR portfolio problem minimizes tail risk subject to a 5% minimum expected return and weights summing to one, with both constraints enforced by penalties.Experiments use confidence levels of 75%, 90%, 95%, and 99%, where higher levels emphasize low-probability, high-impact losses.
  • Portfolio Optimization: LLMDE achieves the most competitive CVaR portfolio performance, securing minimum CVaR at 75%, 90%, and 95% confidence levels, while PSO leads marginally at 99%.The experiments compare LLMDE with five DE variants and four representative metaheuristics under varying risk tolerances.
  • Portfolio Optimization: As confidence levels increase, LLMDE reallocates portfolio weights substantially, indicating adaptation to different risk preferences.LLMDE also consistently improves the objective value during optimization and converges to superior solutions compared with peers.

6. Conclusion

LLMDE embeds an LLM within Differential Evolution to adaptively select mutation strategies and tune control parameters from real-time optimization feedback. Evaluations on benchmark and portfolio tasks support its performance and extensibility, while highlighting prompt, computational, and interpretability limitations.

  • 6. Conclusion: LLMDE adaptively selects mutation strategies and tunes control parameters using real-time optimization feedback instead of manually designed adaptation rules.The framework embeds an LLM as an intelligent reasoning component within the evolutionary process.
  • 6. Conclusion: Evaluations on the CEC2022 benchmark suite and real-world CVaR portfolio optimization problem demonstrate that LLMDE consistently delivers superior optimization performance.The study also reports high-quality solutions for complex optimization tasks across both benchmark and applied settings.
  • 6. Conclusion: Because the LLM module is independent of the underlying optimizer, the framework can generalize to metaheuristics involving operator selection and parameter adaptation.This extensibility supports integrating LLMs with broader metaheuristic optimization methods.
  • 6. Conclusion: LLMDE remains sensitive to prompt design and optimization-state representation, making robust prompts and consistent decision-making non-trivial.The limitation concerns how essential state information is captured and supplied to the LLM.
  • 6. Conclusion: Frequent LLM queries impose substantial computational overhead and API latency, potentially restricting adoption in time-sensitive or resource-limited scenarios.The paper identifies reducing query frequency and computational cost as priorities for future research.
  • 6. Conclusion: The LLM’s black-box decision mechanism obscures the logic behind specific operator selections and parameter configurations, limiting interpretability.The paper links uncovering these mechanisms to improving interpretability in LLM-assisted evolutionary algorithms.

CRediT authorship contribution statement

The authors contributed across methodology, software, visualization, data curation, conceptualization, and manuscript preparation.

  • Rong Chai handled data curation, software, visualization, and the original draft.
  • Methodology was shared across all listed contributors, with additional conceptualization by V´aclav Sn´aˇsel.
  • Xiaopeng Wang contributed software and manuscript revision, while Seyedali Mirjalili contributed visualization and manuscript revision.
  • Crina Grosan contributed manuscript revision and editing.

Declaration of competing interest

The authors declare no known competing financial interests or personal relationships that may have influenced the reported work.

  • The authors report no known competing financial interests or personal relationships influencing the reported work.
Loading 2609.16846v1…