Skip to content

Add taboo search mode to prevent re-evaluating similar solutions#131

Open
nikivanstein wants to merge 4 commits into
mainfrom
claude/taboo-search-mode-9zsAW
Open

Add taboo search mode to prevent re-evaluating similar solutions#131
nikivanstein wants to merge 4 commits into
mainfrom
claude/taboo-search-mode-9zsAW

Conversation

@nikivanstein

Copy link
Copy Markdown
Collaborator

Introduces four new LLaMEA parameters (taboo_mode, taboo_similarity_threshold,
taboo_max_retries, taboo_fitness_scaling) that enable a tabu-inspired filter.
Before a newly generated candidate is evaluated, it is compared against the full
run_history using the configured distance metric (default: AST-based
code_distance). If any history entry is closer than the effective threshold, the
candidate is discarded and the LLM is asked to regenerate up to
taboo_max_retries extra times, after which the last candidate is accepted to
avoid wasting budget. When taboo_fitness_scaling is enabled, the threshold is
scaled by (1 - normalised_parent_fitness) so that offspring of strong parents
face a lenient check (small improvements remain eligible) while offspring of
weak parents must produce more diverse code.

https://claude.ai/code/session_01EWsJqfh3NGhFtwpfbgGFk1

Introduces four new LLaMEA parameters (taboo_mode, taboo_similarity_threshold,
taboo_max_retries, taboo_fitness_scaling) that enable a tabu-inspired filter.
Before a newly generated candidate is evaluated, it is compared against the full
run_history using the configured distance metric (default: AST-based
code_distance). If any history entry is closer than the effective threshold, the
candidate is discarded and the LLM is asked to regenerate up to
taboo_max_retries extra times, after which the last candidate is accepted to
avoid wasting budget. When taboo_fitness_scaling is enabled, the threshold is
scaled by (1 - normalised_parent_fitness) so that offspring of strong parents
face a lenient check (small improvements remain eligible) while offspring of
weak parents must produce more diverse code.

https://claude.ai/code/session_01EWsJqfh3NGhFtwpfbgGFk1
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.95798% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
llamea/llamea.py 94.23% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5bd0e9423f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread llamea/llamea.py

evolved_individual = individual.empty_copy()
parent_ids = evolved_individual.parent_ids
max_attempts = (self.taboo_max_retries + 1) if self.taboo_mode else 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve warm-start compatibility for old archives

When running from an archive pickled before this change, __setstate__ restores an object that does not have the new taboo_mode/taboo_max_retries attributes, so the first call to evolve_solution raises AttributeError here before entering the try block. This breaks the existing LLaMEA.warm_start(...).run() workflow for older experiment archives unless defaults for the new fields are added during unpickling.

Useful? React with 👍 / 👎.

claude and others added 3 commits May 6, 2026 09:37
Replaces the implicit "check all of run_history" behaviour with an explicit,
configurable taboo_list that is populated according to one of three strategies:

* "always" (default) – every evaluated solution is added, preserving the
  original behaviour.
* "stagnation" – solutions are added only while no improvement has been
  observed for taboo_stagnation_window consecutive generations, mirroring
  classic tabu-search diversification.
* "poor_fitness" – only solutions whose fitness falls in the worst
  taboo_poor_fitness_percentile % of run_history are added, focusing the
  filter on genuinely bad code regions.

_is_taboo now compares against self.taboo_list (not run_history).
_update_taboo_list is called from initialize() and the main run() loop.
Tests updated to seed taboo_list directly; nine new tests cover the three
strategies plus the ValueError guard for unknown strategy names.

https://claude.ai/code/session_01EWsJqfh3NGhFtwpfbgGFk1
experiments/simulate_taboo.py replays recorded LLaMEA-HPO run files to
estimate the effect of taboo filtering without running a live LLM.  For each
.jsonl file it precomputes a pairwise AST-distance matrix once, then sweeps a
configurable grid of taboo settings (strategy × threshold × window/percentile)
and reports per-configuration pruning rate, precision, and recall metrics.

Supports both LLaMEA-HPO field names (_solution/_fitness/_generation) and the
standard LLaMEA log format (code/fitness/generation).

Also adds pandas as a dependency (required by the experiment script).

https://claude.ai/code/session_01EWsJqfh3NGhFtwpfbgGFk1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants