跳到正文
FunCoding

mcts-ahd

Monte Carlo Tree Search for Automatic Heuristic Design (MCTS-AHD) method skill. USE WHEN the user explicitly requests MCTS / Monte Carlo Tree Search for heuristic design, or wants tree-structured search with UCT-based exploration-exploitation balance.

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

skills/algo-design/mcts-ahd/SKILL.md

在 GitHub 上查看

MCTS-AHD Skill

Paper: Zheng et al., "Monte Carlo Tree Search for Comprehensive Exploration in LLM-based Automatic Heuristic Design", ICML 2025.

1. Method Essence

MCTS-AHD models heuristic search as a tree: the root is a template/initial solution, each node is a heuristic implementation, and edges are "mutations producing child nodes". Four-step cycle:

  1. Selection: From root, select a node using the UCT formula
  2. Expansion: Use LLM to generate child node variants from the selected node
  3. Evaluation: Evaluate the child node, obtain reward
  4. Backpropagation: Update Q-value and visit count for all ancestor nodes along the path

UCT formula:

UCT = (Q - q_min) / (q_max - q_min) + λ₀ × eval_remain × √(log(parent.visits + 1) / node.visits)
  • Term 1: Exploitation — normalized Q-value, favoring high-reward nodes
  • Term 2: Exploration — weighted by λ₀×remaining budget, favoring less-visited nodes
  • α and λ₀ jointly control the exploration-exploitation balance (reference: α=0.5, λ₀=0.1)

See params.yaml in this directory for the recommended parameter configuration.

Parameter Guidance:

  • max_generations: Interpreted as MCTS iterations; 500-2000 typical.
  • init_size: 4-6 works well for most problems.
  • population_size: 10-20 for moderate problems; increase for complex landscapes.
  • alpha: Higher (0.7-1.0) = wider tree; lower (0.3-0.5) = deeper tree.
  • lambda_0: Higher (0.2-0.5) = more exploration; lower (0.05-0.1) = more exploitation.
  • max_depth: 10-15 prevents infinite deepening.

What Happens During Evolution

  1. Root node initialized from seed or template
  2. Each iteration:
    • Select a node using UCT (balances Q-value and visit count)
    • Expand: generate 1-3 child nodes via LLM mutation
    • Evaluate children, update Q-values
    • Backpropagate: update all ancestors' visit counts and Q-values
  3. Tree grows asymmetrically — high-value branches get explored more
  4. Late iterations converge to the best branch for refinement

Common Pitfalls

  • Tree too shallow → increase max_depth or decrease lambda_0
  • Tree too wide → decrease alpha or increase lambda_0
  • All nodes similar → increase diversity in mutation prompts
  • Budget exhausted before convergence → increase max_sample_nums

4. Acceptance Criteria

  • Tree structure visible in evolution log (parent-child relationships)
  • UCT scores reported for each selection decision
  • Depth and breadth both explored (not just one path)
  • Late iterations focus on refining the best branch
  • Final best individual is a leaf node with highest Q-value

相似的 Skill

agent-security-hardening

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

精选

ponytail-audit

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

DIDietrichGebert/ponytail203k近 7 天新增 4,904 个 star

gstack

GAgarrytan/gstack143k近 7 天新增 598 个 star

精选

security-and-hardening

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

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

doubt-driven-development

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

ruview-rvagent

RUruvnet/RuView106k近 7 天新增 739 个 star