Repository navigation
LLaMEA-HPO: ask the LLM for the configuration space - #264
Merged
Merged
Conversation
EoH calls random.seed(2024) on Python's global random module when it starts, so its parent selection was identical for every run seed, and in parallel runs it reset the random state of other methods. EoH's modules now use a per-run random.Random seeded from BLADE's run seed (or the new `seed` option), and EoH's reseed is ignored. ReEvo asks for temperature + 0.3 for its initial population; BLADE's adapter dropped it. LLM.query_at_temperature passes a per-call temperature to providers that accept one (LLM.accepts_temperature), and ReEvo's base temperature is now the LLM's own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HiY2guDd9wWLKRWPoa16yy
MCTS-AHD: - Progressive widening as in the paper (Eq. 4) and the reference: every node on the selection path with int(N ** alpha) > #children gets a new child (e1 at the root, e2 elsewhere). The dead is_fully_expanded helper is removed; the root starts with 0 visits; max_children is an optional cap (default none). - Selection stops at max_depth (10); a node there is expanded again. - Exploration: lambda = lambda_0 * (1 - t / budget) (Eq. 7) and the bonus sqrt(ln(N_parent + 1) / N). - An LLM failure while generating a node uses one evaluation, is logged as a failed candidate, and the search continues. Failed candidates are discarded from the tree and the operator retried (max 3 tries), as in the reference. Nodes are evaluated and back-propagated one at a time, in the reference's operator order; s1 is skipped at depth 1. - 4 initial nodes (initial_node_count), as in the paper. LHNS: - Use the evaluated candidate returned by the problem (the current solution never moved before). - Temperature cools: T = cooling_rate * (1 - (t - 1) / budget); relative worsening in the acceptance probability. - Adaptive VNS destruction ratio (ini_ratio, reset on accept, +0.1 per reject, wrap after 1.0); ceil(r * n) lines drawn with replacement and deleted by index (trailing-whitespace lines were never deleted); def/class/import lines kept, comments dropped. - ILS/TS destroy with ini_ratio and perturb after 10 non-improving iterations in a row (ILS from the best so far, TS merging a tabu entry). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HiY2guDd9wWLKRWPoa16yy
tree-sitter-language-pack 1.x downloads grammars at first use; on a Windows CI runner the download returned invalid JSON and test_moeh_evaluates_exactly_budget failed. Pass the grammar of the tree-sitter-python dependency to codebleu instead (same scores, no network access needed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HiY2guDd9wWLKRWPoa16yy
codebleu expects a list of references per candidate. Given a bare code string it iterated over its characters, so MoEH's code similarity was about 0 for every pair of real programs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HiY2guDd9wWLKRWPoa16yy
- MCTS-AHD e2: one rank-weighted node of the elite set (10 best distinct nodes) followed by the parent, as the e2 prompt text already assumed. - MCTS-AHD e1: one random node per root-child subtree, then randint(2, 5) of those with replacement. - LHNS: an LLM failure costs one evaluation, is logged as a failed candidate and rejected; the search continues. A failed initial generation is retried within the budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HiY2guDd9wWLKRWPoa16yy
LLaMEA adds its request for a SMAC configuration space to the output format only when it is given no format prompt, and BLADE always passes the problem's. With variant hpo or HPO: true the LLM was never asked for a space, so no solution had one and nothing was tuned. Append the request (in the format LLM.extract_configspace parses) to the problem's format prompt when the method uses HPO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HiY2guDd9wWLKRWPoa16yy
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
LLaMEA-HPO in BLADE never tuned anything, with either
variant: hpoorHPO: true.LLaMEA asks for a SMAC configuration space only when it is given no output format prompt (
llamea.py: the HPO format is set only in theoutput_format_prompt is Nonebranch). BLADE always passes the problem'sformat_prompt, so the request was dropped:LLM.extract_configspacefound nothing;solution.configspacestayed empty, and the problem'stune = cs is not None and self.hpowas always false.A leaderboard trial showed this. All 60 solutions of 5 LLaMEA-HPO runs on the BBOB groups had
configspace: '', and no prompt mentioned a configuration space.Fix
iohblade/methods/llamea.py: newHPO_FORMAT_PROMPT, appended to the problem's format prompt when the method uses HPO (uses_hpo). It asks for the hyperparameters as a SMAC3 configuration space (a Python dict): ranges as(lower, upper)tuples and options as lists. The hyperparameters must be__init__keyword arguments with defaults, since that is where tuned values are passed. The example uses theSpace:+ fenced block format that_DEFAULT_CS_PATTERNparses.Checked in a real run
The same trial, rerun with the fix (5 runs, budget 12):
Tests
In
tests/unit/test_hpo.py:variant: hpoandHPO: true, every prompt contains the request and the problem's own format prompt, and the problem receives the parsed space;_DEFAULT_CS_PATTERNinto a validConfigurationSpace.The new tests fail without the fix.
test_hpo,test_llamea_variants,test_hpo_benchmarksandtest_llamea_feature_guidance: 69 passed.Note
Earlier LLaMEA-HPO results produced with BLADE are plain LLaMEA (5+5) with the HPO mutation prompt, without tuning.
Generated by Claude Code