跳到正文
FunCoding

eoh

Evolution of Heuristics (EOH) method skill. USE WHEN the user explicitly requests EoH / Evolution of Heuristics, or wants population-level heuristic evolution with explore-exploit-merge-modify operators.

Star
725
分类
安全
许可证
BSD-3-Clause
最近提交
2026年11月30日

skills/algo-design/eoh/SKILL.md

在 GitHub 上查看

Evolution of Heuristics (EOH) Skill

Paper: Liu et al., "Evolution of Heuristics: Towards Efficient Automatic Algorithm Design Using Large Language Model", ICML 2024.

1. Method Essence

EOH treats the LLM as an evolutionary operator rather than a black-box sampler: it maintains a heuristic population and generates new individuals each generation using one of four LLM operators, evaluates them, and applies survival-of-the-fittest selection. The core is operator division of labor:

OperatorTypeRole
E1 (explore)MutationGenerate a variant from 1 selected individual (structural/parametric changes)
E2 (exploit)CrossoverCombine 2 selected individuals into a new one
M1 (merge)MergeFuse strengths of multiple individuals into one implementation
M2 (modify)RefinementTargeted fine-tuning of the current best

The following are starting-point recommendations from the paper and practical experience. Adjust based on your problem complexity and computational budget.

evolution:
  type: "eoh"
  max_generations: 50          # increase for harder problems
  population_size: 5           # top-k individuals kept after truncation
  selection_num: 2             # parents selected per E1/E2 crossover
  max_sample_nums: 100         # LLM call budget cap for the run
  num_samplers: 1              # parallel candidates per operator per gen
  use_e2_operator: true        # enable E2 (backbone-motivated crossover)
  use_m1_operator: true        # enable M1 (structural mutation)
  use_m2_operator: true        # enable M2 (parameter mutation)
  seed_path: null              # optional path to a seed heuristic file

Parameter Guidance:

  • population_size: Start with 5; increase for harder problems or decrease for faster iteration.
  • selection_num: 2 works well for most cases; increase for more diverse crossover.
  • max_sample_nums: Increase for harder problems (up to 200+); decrease for quick experiments.
  • Operator toggles: Enable/disable based on your search strategy.

What Happens During Evolution

  1. Population is initialized from seed or random variants
  2. Each generation: select operators (E1/E2/M1/M2), generate offspring via LLM, evaluate, truncate to top-k
  3. Operators rotate: E1 explores, E2 exploits, M1 merges, M2 refines
  4. Early generations favor E1 (exploration); later generations favor M2 (exploitation)

Common Pitfalls

  • Too small population → premature convergence; increase population_size
  • Too few samples → algorithm hasn't converged; increase max_sample_nums
  • Disabling all operators except E1 → no exploitation; keep at least M2 enabled

4. Acceptance Criteria

  • Population diversity maintained across generations
  • Operator rotation observed (not just E1 repeated)
  • Best individual shows clear improvement over initial population
  • Convergence pattern: rapid early improvement, gradual later refinement

相似的 Skill

agent-security-hardening

AFaffaan-m/ECC314k近 7 天新增 3,503 个 star

精选

ponytail-audit

审计整个代码库,找出 bug、安全漏洞和性能瓶颈,获得按重要性排序的通俗报告。

DIDietrichGebert/ponytail202k近 7 天新增 4,226 个 star

gstack

GAgarrytan/gstack143k近 7 天新增 524 个 star

精选

security-and-hardening

按 OWASP Top 10 检查输入处理、登录和依赖,加固代码。

ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star

doubt-driven-development

ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star

ruview-rvagent

RUruvnet/RuView106k近 7 天新增 596 个 star