HiFo-Prompt: Prompting with Hindsight and Foresight for LLM-Based Automatic Heuristic Design

Abstract

This paper investigates the application of Large Language Models (LLMs) in Automated Heuristic Design (AHD), where their integration into evolutionary frameworks reveals a significant gap in global control and long-term learning. We propose the Hindsight-Foresight Prompt (HiFo-Prompt), a novel framework for LLM-based AHD designed to overcome these limitations. This is achieved through two synergistic strategies: Foresight and Hindsight. Foresight acts as a high-level meta-controller, monitoring population dynamics(e.g., stagnation and diversity collapse) to switch the global search strategy between exploration and exploitation explicitly. Hindsight builds a persistent knowledge base by distilling successful design principles from past generations, making this knowledge reusable. This dual mechanism ensures that the LLM is not just a passive operator but an active reasoner, guided by a global plan (Foresight) while continuously improving from its cumulative experience (Hindsight). Empirical results demonstrate that HiFo-Prompt significantly outperforms a comprehensive suite of state-of-the-art AHD methods, discovering higher-quality heuristics with substantially improved convergence speed and query efficiency. Our code is available at https://github.com/Challenger-XJTU/HiFo-Prompt.

Cite

Text

ChentongChen et al. "HiFo-Prompt: Prompting with Hindsight and Foresight for LLM-Based Automatic Heuristic Design." International Conference on Learning Representations, 2026.

Markdown

[ChentongChen et al. "HiFo-Prompt: Prompting with Hindsight and Foresight for LLM-Based Automatic Heuristic Design." International Conference on Learning Representations, 2026.](https://mlanthology.org/iclr/2026/chentongchen2026iclr-hifoprompt/)

BibTeX

@inproceedings{chentongchen2026iclr-hifoprompt,
  title     = {{HiFo-Prompt: Prompting with Hindsight and Foresight for LLM-Based Automatic Heuristic Design}},
  author    = {ChentongChen,  and Zhong, Mengyuan and Shi, Jialong and Sun, Jianyong and Fan, Ye},
  booktitle = {International Conference on Learning Representations},
  year      = {2026},
  url       = {https://mlanthology.org/iclr/2026/chentongchen2026iclr-hifoprompt/}
}