Large language model assisted hyper-heuristic evolutionary algorithm for groundwater level prediction

Large language model assisted hyper-heuristic evolutionary algorithm for groundwater level prediction

Large language model assisted hyper-heuristic evolutionary algorithm for groundwater level prediction

https://www.nature.com/articles/s41598-026-52801-3

Publish Date: 2026-05-10 23:43:00

Source Domain: www.nature.com

A. Additional related work

A.1. Prompt engineering

This section details the internal structure of the prompt engineering used to drive the evolution of metaheuristic algorithms. In our framework, the prompt information for the evolutionary process is meticulously designed with five key components. Their synergistic action aims to guide the LLM to efficiently and accurately generate new heuristic algorithms and their code implementations. As shown in Fig. 18, all evolutionary strategies adopt this unified prompt structure. The five components of prompt engineering are described as follows:

  • Task definition: This component provides the LLM with a clear problem context and objective, which is to evolve a metaheuristic algorithm for optimizing the hyperparameters of an ANN model. It forms the basis for all specific evolutionary strategies, ensuring the LLM reasons within the correct context.

  • Parent Heuristic: In evolutionary operations, this part contains a detailed description and executable code of the parent heuristic algorithm. It provides the LLM with rich contextual information, enabling it to perform in-context learning and make targeted improvements based on the strengths and weaknesses of the existing algorithm.

  • Evolutionary strategy prompt: This is the core instruction that guides the LLM in its creative work. Different prompting strategies are employed here to direct the LLM to perform specific reasoning tasks and explore the heuristic search space.

  • Expected output and format requirements: This component strictly specifies the structure and format of the LLM’s output. Specifically, we require it to provide a theoretical description of the new heuristic algorithm and generate a code implementation that conforms to Python syntax. We explicitly define the function’s name, input parameters, and return values to ensure the generated code can be seamlessly parsed and executed by our LLMHHEA framework.

  • Robustness and efficiency guidance: This part provides…

Source