Skip to main contentpaceevolve-evolution-search
Improves LLM-based evolutionary search by addressing context pollution, mode collapse, and weak collaboration through hierarchical context management, momentum-based backtracking, and adaptive sampling policies.
インストールへ移動 Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/ADu2021/skillXiv --skill paceevolve-evolution-searchコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
| name | paceevolve-evolution-search |
| title | PACEvolve: Enabling Long-Horizon Progress-Aware Consistent Evolution |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2601.10657 |
| keywords | ["evolutionary-search","LLM-optimization","long-horizon","progress-aware","context-management"] |
| description | Improves LLM-based evolutionary search by addressing context pollution, mode collapse, and weak collaboration through hierarchical context management, momentum-based backtracking, and adaptive sampling policies. |
Overview
Enhance LLM-driven evolutionary search for long-horizon optimization tasks. Address three key failure modes: context pollution from accumulated experiment data, mode collapse from imbalanced exploration-exploitation, and weak collaboration between parallel search trajectories.
When to Use
- For autonomous optimization and search tasks requiring many candidate evaluations
- When LLMs guide evolutionary algorithms over extended search spaces
- For hyperparameter tuning, architecture search, or program synthesis
- When you need sustained self-improvement over multiple generations
When NOT to Use
- For simple single-pass optimization
- When evolutionary search already works well without LLM guidance
- For tasks with very limited evaluation budget
- In low-latency applications
Key Technical Components
Hierarchical Context Management (HCM)
Prevent context pollution by pruning irrelevant historical data.
class ContextManager:
def __init__(self, max_context_tokens=2000):
self.max_tokens = max_context_tokens
self.experiment_history = []
self.context_cache = {}
def maintain_context_hierarchy(self):
"""Organize context by relevance tiers"""
tiers = {
"recent": [],
"best": [],
"diverse": []
}
tiers["recent"] = self.experiment_history[-10:]
best_experiments = (
.experiment_history,
key= x: x[],
reverse=
)[:]
tiers[] = best_experiments
tiers[] = .select_diverse_representatives(
.experiment_history,
k=
)
tiers
():
(experiments) <= k:
experiments
clusters = .cluster_by_structure(experiments)
representatives = []
cluster clusters:
best_in_cluster = (cluster, key= x: x[])
representatives.append(best_in_cluster)
representatives[:k]
():
pruned_history = []
experiment .experiment_history:
recency_score = .compute_recency(experiment)
performance_score = .compute_performance(experiment)
relevance_score = .compute_problem_relevance(
experiment,
current_problem
)
overall_score = (
* recency_score +
* performance_score +
* relevance_score
)
overall_score > RETENTION_THRESHOLD:
pruned_history.append(experiment)
.experiment_history = pruned_history
pruned_history
():
age = (.experiment_history) - .experiment_history.index(experiment)
/ ( + age)
():
all_fitness = [e[] e .experiment_history]
min_f, max_f = (all_fitness), (all_fitness)
min_f == max_f:
(experiment[] - min_f) / (max_f - min_f)
():
experiment.get() == problem.get():
sorted
self
lambda
"fitness"
True
10
"best"
"diverse"
self
self
10
return
def
select_diverse_representatives
self, experiments, k=10
"""Select diverse experiments by clustering"""
if
len
return
self
for
in
max
lambda
"fitness"
return
def
prune_context
self, current_problem
"""Remove irrelevant historical data"""
for
in
self
self
self
self
0.3
0.3
0.4
if
self
return
def
compute_recency
self, experiment
"""Score based on how recent"""
len
self
self
return
1.0
1.0
def
compute_performance
self, experiment
"""Normalize fitness score"""
"fitness"
for
in
self
min
max
if
return
0.5
return
"fitness"
def
compute_problem_relevance
self, experiment, problem
"""Semantic relevance to current problem"""
if
"problem_id"
"id"
return
1.0
return
0.1
Momentum-Based Backtracking (MBB)
Escape local optima by reverting to diverse solutions.
class MomentumBacktracker:
def __init__(self, backtrack_window=5):
self.backtrack_window = backtrack_window
self.trajectory_history = []
self.fitness_trend = []
def detect_local_optimum(self):
"""Check if stuck in local optimum"""
if len(self.fitness_trend) < self.backtrack_window:
return False
recent_trend = self.fitness_trend[-self.backtrack_window:]
improvement = max(recent_trend) - min(recent_trend)
stagnation = improvement < STAGNATION_THRESHOLD
solution_similarity = self.compute_avg_similarity()
low_diversity = solution_similarity > SIMILARITY_THRESHOLD
is_stuck = stagnation and low_diversity
return {
"is_stuck": is_stuck,
"stagnation_score": improvement,
"diversity_score": 1.0 - solution_similarity
}
def backtrack_with_momentum(self, current_fitness):
"""Revert to promising past solution with momentum"""
checkpoint = self.select_backtrack_checkpoint()
if checkpoint is None:
return None
current_solution = self.trajectory_history[-1]["solution"]
checkpoint_solution = checkpoint["solution"]
momentum = self.compute_momentum_vector(current_solution, checkpoint_solution)
backtrack_solution = self.blend_solutions(
checkpoint_solution,
momentum,
alpha=0.7
)
return {
"solution": backtrack_solution,
"checkpoint_fitness": checkpoint["fitness"],
"momentum_direction": momentum
}
def select_backtrack_checkpoint(self):
"""Select good past solution with different structure"""
candidates = []
for i in range(max(0, len(self.trajectory_history) - 20), len(self.trajectory_history)):
solution = self.trajectory_history[i]
if solution["fitness"] > BACKTRACK_FITNESS_THRESHOLD:
diversity = self.compute_diversity_from_recent(solution)
if diversity > DIVERSITY_THRESHOLD:
candidates.append(solution)
if not candidates:
return None
return max(candidates, key=lambda x: x["fitness"])
def blend_solutions(self, base_solution, momentum, alpha=0.7):
"""Blend checkpoint with momentum direction"""
blended = alpha * base_solution + (1 - alpha) * momentum
return blended
def compute_momentum_vector(self, current, checkpoint):
"""Direction of progress from checkpoint to current"""
return current - checkpoint
def compute_diversity_from_recent(self, solution):
"""How different from recent solutions"""
recent_solutions = [s["solution"] for s in self.trajectory_history[-5:]]
similarities = [
self.compute_solution_similarity(solution["solution"], recent)
for recent in recent_solutions
]
avg_similarity = np.mean(similarities)
return 1.0 - avg_similarity
Self-Adaptive Sampling Policy
Dynamically balance exploration and exploitation.
class AdaptiveSamplingPolicy:
def __init__(self):
self.exploration_rate = 0.5
self.sampling_history = []
def compute_adaptive_rate(self, recent_progress):
"""Adjust exploration based on progress"""
improvement = np.mean(recent_progress)
if improvement > HIGH_PROGRESS_THRESHOLD:
self.exploration_rate = max(0.1, self.exploration_rate - 0.1)
elif improvement < LOW_PROGRESS_THRESHOLD:
self.exploration_rate = min(0.9, self.exploration_rate + 0.1)
return self.exploration_rate
def sample_next_candidate(self, best_candidates, random_candidates, exploration_rate):
"""Choose between exploiting best or exploring random"""
if np.random.random() < exploration_rate:
return np.random.choice(random_candidates)
else:
return np.random.choice(best_candidates)
def integrate_backtracking(self, backtrack_solution, exploration_rate):
"""Incorporate backtracking into sampling"""
backtrack_exploration = min(
exploration_rate + 0.3,
0.9
)
return backtrack_exploration
def compute_sampling_efficiency(self):
"""Track whether sampling strategy is effective"""
total_samples = len(self.sampling_history)
improvements = sum(
1 for i in range(1, len(self.sampling_history))
if self.sampling_history[i]["fitness"] > self.sampling_history[i-1]["fitness"]
)
efficiency = improvements / total_samples
return efficiency
Integration: Complete Loop
Combine all components into complete search loop.
class PACEevolveSearch:
def __init__(self, llm_generator):
self.generator = llm_generator
self.context_manager = ContextManager()
self.backtracker = MomentumBacktracker()
self.sampler = AdaptiveSamplingPolicy()
def search_iteration(self, problem, budget=100):
"""Single generation of evolutionary search"""
for step in range(budget):
context = self.context_manager.maintain_context_hierarchy()
self.context_manager.prune_context(problem)
candidates = self.generator.generate_candidates(
problem,
context,
num_candidates=10
)
candidates = self.evaluate_candidates(candidates)
stuck = self.backtracker.detect_local_optimum()
if stuck["is_stuck"]:
backtrack = self.backtracker.backtrack_with_momentum(
max(e["fitness"] for e in candidates)
)
if backtrack:
candidates.append(backtrack["solution"])
best_candidates = sorted(candidates, key=lambda x: x["fitness"], reverse=True)[:5]
self.sampler.compute_adaptive_rate(
[e["fitness"] for e in candidates]
)
if best_candidates:
self.context_manager.experiment_history.append(best_candidates[0])
return self.context_manager.experiment_history
Performance Characteristics
- State-of-the-art on LLM-SR and KernelBench benchmarks
- Discovers solutions exceeding previous records
- Sustained improvement over 100+ iterations
- Effective on Modded NanoGPT and similar tasks
Recommendations
- Initialize exploration rate at 0.5; let it adapt
- Backtrack when stagnation detected; don't backtrack too frequently
- Prune context every 10-20 iterations to prevent pollution
- Monitor sampling efficiency; adjust thresholds if needed
References
- Context pollution prevents long-horizon optimization
- Mode collapse causes premature convergence
- Momentum-based backtracking enables escape from local optima
- Adaptive sampling maintains balance without manual tuning